フィルターのクリア

Modeling efflux time from a tank. Equation 11 in the attached document

1 回表示 (過去 30 日間)
Eric  Gray
Eric Gray 2017 年 1 月 27 日
回答済み: Sergey Kasyanov 2017 年 1 月 27 日
The equation is first-order nonlinear ordinary differential equation. Says to combine Newton-Rhapson and Runge-Kutta methods to solve numerically.

回答 (1 件)

Sergey Kasyanov
Sergey Kasyanov 2017 年 1 月 27 日
I think it can be helpful.
You have this function with A, B, C, D are known:
fun = A * (dHdt)^2 + B * (dHdt)^1.75 + C * (dHdt) + D* H;
A=number;
B=number;
C=number;
D=number;
Then you define initial condition:
dHdt0=dHdt0;
H0=H0;
Then you combine solving of function fun(dHdt) and integrate ODE fun(dHdt,H):
%create new function
fun1 = A * (dHdt)^2 + B * (dHdt)^1.75 + C * (dHdt);
%define interval to integrate
T=number;
%define step
dt = 1e-3;
dH = [dHdt0,zeros(1,T/dt)];
H = [H0,zeros(1,T/dt)];
i=2;
%integrate
while i<T/dt+1
%solving of fun(dHdt)
dH(i)=vpasolve(fun1 + H(i-1) * D,dHdt);
%integrate with euler method
H(i)=H(i-1) + dH(i) * dt;
i=i+1;
end
t=[1:i]*dt;
plot(t,H);

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by