I'm trying obtain the roots of a function that depends on a parameter. For example : The equation
eos= math.log(1.-x)+x**2*(e22*y+ e11*(1-y) + 2*y*(1-y)*e12)
I need to obtain the roots (x) such as eos = 0 for a specific value of y. In order words, I fix y, and I solve (using fsolve) eos. I'm trying to do :
`def EOS(x,y) : e11=1.00 ; e22=0.40 ; e12=0.60 return math.log(1.-x)+x**2*(e22*y+ e11*(1-y) + 2*x2*(1-y)*e12) for i in arange(1,99,1) : y=i*0.01 ans[i]=fsolve(lambda x: EOS(x,y),x0)
But I have a wrong answer. Someone know how use the fsolve (or other alternative way) with y as parameter (not a variable) ? Someone could help me ?
Many thanks for the help