# Why is the amplitude of my numerically generated wavefunction not constant?

I am plotting a wavefunction that is generated by using the Euler Method. The scenario is the infinite square well.

I have two test cases - one with initial energy guess of 2.0 and another with initial energy guess of 9.0. Below are the resulting plots.

Energy: 2.0

Energy: 9.0

I had to say that the first case was not good because the wavefunction was nowhere near a necessary value of $\psi(10)=0$. The second test was closer, but for some reason the amplitude of the wavefunction doesn't stay constant. Does anyone have an idea as to why it isn't staying constant? It looks constant in the first case.

• Euler's method is not going to give a conserving answer. Try a Verlet method, so a modified Euler (semi-implicit Euler). – Bill N Mar 5 '17 at 2:49
• @BillN let's go off the assumption that Euler Method is a requirement here. – loltospoon Mar 5 '17 at 19:14