Solving nonlinear equation using fsolve.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
kusniar deny permana
el 30 de Nov. de 2015
Editada: kusniar deny permana
el 1 de Dic. de 2015
I have nonlinear coupled equation. I have T varied from 300 to 1300, each T give coupled-equation. How to solve each equation using fsolve? I know to solve coupled equation if only there is one coupled-equation, but do I have to solve one by one? 1000 equation total. Thank you
0 comentarios
Respuestas (1)
Torsten
el 30 de Nov. de 2015
Use a for-loop in which you call fsolve (or fzero) 1000 times with T varying from 300 to 1300.
Best wishes
Torsten.
3 comentarios
Torsten
el 1 de Dic. de 2015
Editada: Torsten
el 1 de Dic. de 2015
If I understand you correctly, the equation you are trying to solve vary with T.
Thus my suggestion is to call fsolve somehow like
x0 = 1;
for i = 1:1001
T = 300+(i-1);
sol(i) = fsolve(@(x)fun(x,T),x0);
x0 = sol(i);
end
This way, you get a solution array sol(i) depending on the temperature T(i).
Best wishes
Torsten.
kusniar deny permana
el 1 de Dic. de 2015
Editada: kusniar deny permana
el 1 de Dic. de 2015
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!