maverick280857
- 1,774
- 5
To the moderator: Please shift this to an appropriate forum, if necessary.
Hi,
I am solving a QM problem which requires using Mathematica to solve two equations,
J_{\alpha}'(2\sqrt{\lambda}) = 0
(derivative of Bessel function)
and
J_{\alpha}(2\sqrt{\lambda}) = 0
(not simultaneously) where \alpha is the unknown and \lambda is known. I want to plot the dependence of \alpha^{2} on \lambda.
First, I take x = 2\sqrt{\lambda} and vary x from 1 to 10 (so \lambda \in [0.25, 25]). Now, I use
FindRoot[0.5*(BesselJ(-1+alpha,x) - BesselJ(1+alpha,x)), {alpha,0}]
for different values of x which are being keyed in by hand while typing this command. To automate it, I set up an array:
Array[SOL, 1000]
and then use a for loop
For[c=1;x=1,c<=1000;x<=100,c = c + 1; x=x+0.01, SOL[c] = {x,FindRoot[(BesselJ[-1+alpha,x] + BesselJ[1+alpha,x])/2, {alpha,0}]}]
so SOL[10] is of the form:
{1.09, {alpha -> 0.448962}}
I have the following questions:
1. The second element of the ordered pair above is of the form {alpha --> value}. How do I extract alpha from this? I want to store it in (x, alpha) form.
2. How do I plot some function of alpha^2 versus some function of x, from this data?
3. Is there an easier way to do all this?
I've been trying to figure this out for some time but I haven't had much success.
Thanks in advance.
Cheers
Vivek
Hi,
I am solving a QM problem which requires using Mathematica to solve two equations,
J_{\alpha}'(2\sqrt{\lambda}) = 0
(derivative of Bessel function)
and
J_{\alpha}(2\sqrt{\lambda}) = 0
(not simultaneously) where \alpha is the unknown and \lambda is known. I want to plot the dependence of \alpha^{2} on \lambda.
First, I take x = 2\sqrt{\lambda} and vary x from 1 to 10 (so \lambda \in [0.25, 25]). Now, I use
FindRoot[0.5*(BesselJ(-1+alpha,x) - BesselJ(1+alpha,x)), {alpha,0}]
for different values of x which are being keyed in by hand while typing this command. To automate it, I set up an array:
Array[SOL, 1000]
and then use a for loop
For[c=1;x=1,c<=1000;x<=100,c = c + 1; x=x+0.01, SOL[c] = {x,FindRoot[(BesselJ[-1+alpha,x] + BesselJ[1+alpha,x])/2, {alpha,0}]}]
so SOL[10] is of the form:
{1.09, {alpha -> 0.448962}}
I have the following questions:
1. The second element of the ordered pair above is of the form {alpha --> value}. How do I extract alpha from this? I want to store it in (x, alpha) form.
2. How do I plot some function of alpha^2 versus some function of x, from this data?
3. Is there an easier way to do all this?
I've been trying to figure this out for some time but I haven't had much success.
Thanks in advance.
Cheers
Vivek