Let me start off by saying that I am a complete newbie to Mathematica, so I don't really know what I'm doing.
For my assignment I have to find the numerical probability of a particle in a harmonic oscillator potential in between quantum numbers $n=0$ and $n=5$. For simplicity's sake, I am only trying to find the probability where $n=0$.
The wave function of n=0 in a harmonic oscillator is:
$\Psi(x)$ = $N_0H_0 e^{(-x^2/2)}$
So the probability of finding a particle with the given wave function is:
$\int \Psi^2(x) dx$
The classically bound region is defined as $y= \frac 12{kx^2}$
ClearAll["Global`*"];
norm[n_] := (1/(Sqrt[π] 2^n n!))^(1/2)
u[x_, n_] := 1/Sqrt[a] norm[n] HermiteH[n, x/a] exp^[-(a*x^2/2)]
b[x_] := 0.5 kx^2
φ1[x_, n_] := 1/Sqrt[2 π] NIntegrate[u[x, n]^2, {x, -1, 1}, {n, 0, 5}]
However, this does not result in any output. I am wondering how you could format this to result in a valid output, and how to get the numerical probability within the bounds of $y= \frac 12{kx^2}$ and $E_v = \hbar \omega (v + 1)$.
Filling. Type?Filling, click on the>>and scroll to the bottom. – David G. Stork Jul 16 '18 at 19:22expbyExp, separatekandx^2, definea. The definitionφ1[x_, n_] :=doesn't make sense. Useφ1[ n_] :=instead. Then evaluateφ1[1]. The function is also missing a calculation of the classical turning points as integration limits. Related: Find eigen energies of time-independent Schrödinger equation. – Jens Jul 16 '18 at 20:14`f[n_, x_] := Abs[((1/Pi)^(1/4) HermiteH[n, x])/(E^(x^2/2) Sqrt[2^n n!])]^2
xtp := Sqrt[(2*n + 1)/a]
a := 1
NIntegrate[f[0, x], {x, -t, t}]` <\br>
– Dylan Hendrickson Jul 16 '18 at 20:23NIntegratedoes not do symbolic integration, i.e., you need to assign values tot, (2) You can useIntegrate, and (3) you should put such modifications in the question rather than the comments. That's what theeditbutton is for. – JimB Jul 16 '18 at 20:32SetandSetDelayed. You won't get output fromSetDelayed(:=), but from=. Basically,:=defines functions that will be evaluated when you invoke their name again later (usually with arguments). – Jens Jul 16 '18 at 21:11