Heun's Method program code
Afficher commentaires plus anciens
%%%% 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)
Réponses (1)
Hojin Jung
le 8 Juin 2018
0 votes
Catégories
En savoir plus sur Introduction to Installation and Licensing 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!