solve a system of ODE
古いコメントを表示
Hi, this is explicit Euler method to solve a ODE
function [x,t]=euleroesplicito(fcn,t0,x0,h,tend) n = fix((tend-t0)/h)+1; t = linspace(t0,t0+(n-1)*h,n); x = zeros(n,1); x(1) = x0; for i = 2:n x(i) = x(i-1) + h*feval(fcn,t(i-1),x(i-1)); end plot(t,x);
How can I extend this method to solve a system of two or more equations? Thank you.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!