Numerical solution of non-linear model
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bdayz
el 4 de Oct. de 2016
Comentada: Luca Fenzi
el 5 de Oct. de 2016
hi all;
I have a model for liquid level in a tank as;
dh/dt = (F/dA) - (B*sqrt(h))/dA,
Where B,d,A are constants,
I want to get the numerical solution for a step input change in F, say 0.4
using Euler method or any other suitable numerical method.
Thanks.
2 comentarios
Respuesta aceptada
Luca Fenzi
el 4 de Oct. de 2016
Editada: Luca Fenzi
el 4 de Oct. de 2016
I think that equation can be recast as: h'(t)=(F/dA) - (B*sqrt(h(t)))/dA, d,B,A,F constants Instead of using Euler method I will prefer the buil in function ode23 or ode4, since they will provide you better simulations
% Parameters of the model
B=1;
A=1;
F=1;
d=1;
% Parameters for the simulations
tspan=[0,5] % time interval of the simulations
h0=0; % Intial data
% simulation with ode23
[t,h] = ode23(@(t,h) F/(d*A) - B*sqrt(h)/d*A, tspan, h0);
% simulation with ode45
% [t,h] = ode23(@(t,h) F/(d*A) - B*sqrt(h)/d*A, tspan, h0);
% Show the results:
plot(t,h)
xlabel('t')
ylabel('h(t)')
2 comentarios
Luca Fenzi
el 5 de Oct. de 2016
I did not understand your question, what variable is the temperature? (h(t)?)
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!