fsolve in a for loop
Mostrar comentarios más antiguos
I am trying an analytical solution from nonlinear equation for a transient temperature problem. I call the function as
fun = @funhouse;
x0 = [1,1]';
options = optimoptions('fsolve','Display','iter');
[x,fval] = fsolve(@funhouse,x0,options);
And the function is
function F = funhouse(x,Tain)
Ts=18+273;% in K
Ca=11918;% kJ/K
Hae=52.33;%W/K
Hame=41.26;%W/K
Has=87.43;%W/K
Hag=15.54;%W/K
Htot=Hae+Hame+Has+Hag;
tao=17;%W/K
Te=10+273;
t=1;
tao=17;
%FUNHOUSE Summary of this function goes here
% Detailed explanation goes here
F = [x(1)-Ca*(x(2)-Tain)-Hae*(x(2)-Te)-Hame*(x(2)-Te)-Hag*(x(2)-Te)-Has*(x(2)-Te);
x(2)-(Tain-(x(1)/Htot)-(Htot-Has)*Te/Htot-Has*Ts/Htot)*exp(-t/tao)-(x(1)+(Htot-Has)*Te+Has*Ts)/Htot];
end
How to pass Tain as the last value found from the fsolve to the next iteration and save the output in an array.
Respuestas (1)
Rajeev kamal
el 19 de En. de 2016
0 votos
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!