solve a system of ODE
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!