what is my problem in numerov method code?

this is my hole code for vibrating string
clc
clear
disp 'numerov method for finding zero of function'
k=1;
dk=0.5;
tol=1e-08;
phim=0;
phiz=0.01;
phipold=funcnuv(k,phiz,phim);
for i=1:90
phip=funcnuv(k,phiz,phim);
phim=phiz;
phiz=phip;
k=k+dk;
if(phipold*phip<0)
k=k-dk;
dk=dk/2;
end
if (abs(dk)<tol)
break
end
end
disp 'phip=' ; disp(phip)
disp 'k='; disp(k)
disp 'i='; disp(i)
and this is function that i have used
function phip=funcnuv(k,phiz,phim)
h=0.01;
const=(k*h)*(k*h)/12;
phip=(2*(1-5*const)*phiz-(1+const)*phim)/(1+const);

댓글 수: 1

Pawel Ladosz
Pawel Ladosz 2016년 9월 29일
The code runs just fine, so not sure what you mean by problem? You not getting right answer?

댓글을 달려면 로그인하십시오.

답변 (2개)

Zakir Khan
Zakir Khan 2021년 8월 10일

0 개 추천

Detail is given here: https://www.iue.tuwien.ac.at/phd/brech/ch_2_2.htm, I implemented the code. https://www.fiverr.com/users/tala1971
Zakir Khan
Zakir Khan 2021년 8월 10일

0 개 추천

Here it is given at the link: https://fr.mathworks.com/matlabcentral/fileexchange/23384-gaas-gaalas-quantum-wells which I tested it my self. https://www.upwork.com/freelancers/~015508901db48c1b4c

카테고리

도움말 센터File Exchange에서 Vibration Analysis에 대해 자세히 알아보기

질문:

2016년 9월 28일

댓글:

2021년 8월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by