import math
K=math.exp((198*10**3-188*1000)/((8.31*1000)))
def f(ksi):
    return (ksi**2*(3-ksi))/(1-ksi)**3-K

def dichotomie (f,a,b,x):
    while (b-a)>x:
        m=(a+b)/2
        if f(m)*f(a)<=0:
            b=m
        else :
            a=m
    return (a+b)/2

ksie=(dichotomie (f,0,0.9999,1*10**-2))
print(round(ksie,2))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: