solve a system of ODE
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!