Implementing Heun's first order ODE

This what I have so far
function[t,y]=heun(f,a,b,h,y0)
n=(b-a)/h;
t=[a];y=[y0];
for k=2:n+1,
t=[t; a+(k-1)*h];
y=[y; y(k-1)+h*f(t(k-1),y(k-1))];
end
But I need it to do the corrector cycle equations to make the y values more accurate. This is the formula for corrector cycle
%

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2017 年 4 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by