Can't get Quantum Harmonic Oscillator Wave Function by ode45

I have just tested if I can get correct Quantum Harmonic Oscillator Wave Function by ode45 But the result doesn't looks like what it should be. What's problem? (I haven't used ode45 for a while, maybe some basic silly mistakes)
function Wavefcn
[x,Phi] = ode45(@WaveFunction,[0 10],[1 0]);
plot(x,Phi(:,1));
function dPhi = WaveFunction(x,phi)
n = 0; %grand state
eps = 2*n+1;
dPhi = zeros(2,1);
dPhi(1) = phi(2);
dPhi(2) = (x^2-eps)*phi(1);
end
end

댓글 수: 1

Now I found it but I have to zoom it. Actually I want to do a more complicated job. In that case I probably don't know what the scale Phi would be(I have to normalise Phi later). Do you have some idea to avoid problem like it?

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

답변 (0개)

카테고리

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

질문:

Sho
2014년 12월 10일

댓글:

Sho
2014년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by