Docsity

using midpoint method, Exercises of Mathematics

Partial preview of the text

Download using midpoint method and more Exercises Mathematics in PDF only on Docsity!

a = (left end of the domain); b = (right end of the domain); h = (step size); F = @(s,r) (function y'=...); t = a:h:b; y = zeros(size(t)); y(1) = (initial data); % set the initial condition for n=1:length(t)- y(n+1) = y(n) + hF(t(n) + h/2, y(n) + (h/2)F(t(n),y(n))) end