Second Order Runge-Kutta Method for Problem
1 回表示 (過去 30 日間)
古いコメントを表示
![4a.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247442/image.png)
I am trying to generate a second order Runge Kutta method in matlab for the above problem and not sure where to start. Tried asking for help but was shown Mathematica code and example and I dont have Mathematica. Any help would be appreicated.
0 件のコメント
回答 (1 件)
Jeremy
2019 年 11 月 8 日
The ode solvers built into MATLAB are based on the runge-kutta method. Are you meant to implement your own method, or can you use ode23?
2 件のコメント
Jeremy
2019 年 11 月 8 日
編集済み: Jeremy
2019 年 11 月 8 日
I would encourage you to read the documentation. Here is some syntax, if I read your problem correctly this should be the solution to the first part of your problem using ode23:
dxdt = @(t,x) 0.02 - 0.01*sqrt(x);
x0 = 0;
tspan = [0 600];
sol = ode23(dxdt,tspan,x0);
plot(sol.x,sol.y)
Also, please look at this:
doc ode23
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!