root equation in matlab
Hi AhSa2003
I think Saeidj is true. In Matlab, "solve(eq,var)" solves the equation eq=0 for the variable var. In Fofou equation: eTa=1-exp(-e(t0-te)) the unknown variable is e, so:
eq = e*ta -1 + exp(-e*(t0-te))
var = e
If you do not set the variabels t0, ta, and te with known values , Matlab only return one root (e=0), while it may have two roots.
syms e ta t0 te;
f=e*ta-1+exp(-e*(t0-te) );
x = solve(f,e)
Matlab returns: x = 0
But if you set the known values:
t0 = 1;
te = 0.55;
ta = 0.04;
syms e;
f=e*ta-1+exp(-e*(t0-te) );
x = eval(solve(f,e))
Matlab returns: x = 24.9997 , 0