Solving one non linear differential equation
7 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a question involving solving a NLDE. The equation is of the form: dx/dt = -C1*(C2+C3*x^(0.25))*x
I would like to solve this equation in MATLAB, and get x(t). I first tried to do this with a simple dsolve, but it says solution = 0.
Main code i used: solution = dsolve('Dx = ((-k*A)/(L*m*Cp))*(0.68+Const*x^(0.25))*x')
(all variables other than x are constants i have defined above.)
Is dsolve the right choice for this equation? I want to try ODE45 but i don't know how (syntax-wise) define this function so that i can input it in ODE45.
Can anyone make a suggestion? Maybe use of implicit ODE's?
Kind regards, Wim
0 件のコメント
回答 (1 件)
Star Strider
2012 年 11 月 4 日
See if this works for you:
DX = @(t,x) ((-k.*A)./(L.*m.*Cp)).*(0.68+Const.*x.^(0.25)).*x;
then call it as:
[T,Y] = ode45(DX, [linspace(0, 10, 1000)], [0.1]);
Since DX is set up as an anonymous function, you don't have to define it as a separate program file. It will also be able to access k, A, and all the other variables in your workspace.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Numerical Integration and Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!