Solving a nonlinear equation with time-varying parameters
Ältere Kommentare anzeigen
Dear all,
I want to solve this nonlinear equation: (a*b*exp(-c*d))*exp(-x)+2*b -2*x-b=0,
where in each iteration of the algorithm the a,b,c,d change values.
So I set up the following algorithm
Myfun = @(x, a, b,c,d) (a*b*exp(-c*d))*exp(-x)+2*b -2*x-b;
fun = @(x) Myfun(x, a, b,c,d);
x0=0;
options = optimoptions('fsolve','Display','none');
A = fsolve(fun,x0,options);
Is this code correct the way I have written it? Is there an alternative faster way to solve this problem? Because I noticed that the above algorithm is very slow.
Thanks in advance
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Optimization Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!