Can't get Quantum Harmonic Oscillator Wave Function by ode45
Afficher commentaires plus anciens
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 commentaire
Sho
le 10 Déc 2014
Réponses (0)
Catégories
En savoir plus sur Quantum Mechanics 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!