Heun's Method program code
Ältere Kommentare anzeigen
%%%% I can't figure out why my function 'HeunIter' doesnot work; even cannot try it! >>>>>>>>>>>>>> function HeunIter(x, y, h, ynew)
es=0.01;
maxit=20;
Call Derivs(x, y, dy1dx);
ye=y+dy1dx*h;
iter=0;
while (ea>es or iter<=maxit)
yeold=ye;
call Derivs(x+h,ye,dy2dx);
slope=(dy1dx+dy2dx)/2;
ye=y+slope*y;
iter=iter+1;
ea=abs((ye-yeold)/ye)*100;
end
ynew=ye
x=x+h
end
%%%% Below is when i try to run function.
>> HeunIter(0,4800,1,2) 'HeunIter'은(는) 정의되지 않은 함수 또는 변수입니다. %%%% It means 'HeunIter' is undefined function or variable. (In korean)
Antworten (1)
Hojin Jung
am 8 Jun. 2018
0 Stimmen
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!