Numerical solution of non-linear model

2 次查看(过去 30 天)
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 个评论
José-Luis
José-Luis 2016-10-4
How is d a constant? Isn't your equation a differential equation?
Bdayz
Bdayz 2016-10-5
Hello José-Luis,
d actually stands for density, should have capitalized it to help in the understanding,sorry.
Thanks

请先登录,再进行评论。

采纳的回答

Luca  Fenzi
Luca Fenzi 2016-10-4
编辑:Luca Fenzi 2016-10-4
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 个评论
Bdayz
Bdayz 2016-10-5
Hi Luca Fenzi,
Thanks very much for the response, got my way around it, am now struggling with the temperature response for now. Hope you can be of help?
Luca  Fenzi
Luca Fenzi 2016-10-5
I did not understand your question, what variable is the temperature? (h(t)?)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assembly 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by