Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8811 > unrolled thread

NDSolve

Started byrf248 <rf248@st-andrews.ac.uk>
First post2012-03-01 10:37 +0000
Last post2012-03-02 12:53 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  NDSolve rf248 <rf248@st-andrews.ac.uk> - 2012-03-01 10:37 +0000
    Re: NDSolve Cos Lol <giaexams@gmail.com> - 2012-03-02 12:53 +0000

#8811 — NDSolve

Fromrf248 <rf248@st-andrews.ac.uk>
Date2012-03-01 10:37 +0000
SubjectNDSolve
Message-ID<jinjgp$d0k$1@smc.vnet.net>
Hello,
I am trying to solve an initial value problem with NDSolve. However, the initial values are set on a regular singular point. When solving Bessel's differential equation, one can avoid this problem with the option SolveDelayed ->True.
This however does not help with the following problem (hydrogen atom) to which the analytic solution is a Laguerre polynomial.

l = 0; n = 1; a = 1; eps = -1/(2 n^2);
func = r D[r R[r], {r, 2}] + (2 (a r + eps r^2) - l (l + 1)) R[r] == 0;
nrad = NDSolve[{func, R[0] == 2, R'[0] == -2}, R[r], {r, 0, 100}, 
  SolveDelayed -> True]

Above, the initial values chosen correspond to an exact solution for constants l, n, a and eps. Mathematica must therefor be able to find a solution.

Thanks!

[toc] | [next] | [standalone]


#8834

FromCos Lol <giaexams@gmail.com>
Date2012-03-02 12:53 +0000
Message-ID<jiqfsb$7e$1@smc.vnet.net>
In reply to#8811
On 1 =CC=E1=F1, 12:37, rf248 <rf...@st-andrews.ac.uk> wrote:
> Hello,
> I am trying to solve an initial value problem with NDSolve. However, the initial values are set on a regular singular point. When solving Bessel's differential equation, one can avoid this problem with the option SolveDelayed ->True.
> This however does not help with the following problem (hydrogen atom) to which the analytic solution is a Laguerre polynomial.
>
> l = 0; n = 1; a = 1; eps = -1/(2 n^2);
> func = r D[r R[r], {r, 2}] + (2 (a r + eps r^2) - l (l + 1)) R[r] == 0;
> nrad = NDSolve[{func, R[0] == 2, R'[0] == -2}, R[r], {r, 0, 100},
>   SolveDelayed -> True]
>
> Above, the initial values chosen correspond to an exact solution for constants l, n, a and eps. Mathematica must therefor be able to find a solution.
>
> Thanks!

it's a mathematical problem
the func becomes r*(...) so if you drop the r assuming r is not equal
to 0, mathematica then solves the DE

otherwise if you want the formula to stand for any values-expressions,
use isntead of 0 a number e=$MachineEpsilon i.e.
l = 0; n = 1; a = 1; eps = -1/(2 n^2); e=$MachineEpsilon;
func = r D[r R[r], {r, 2}] + (2 (a r + eps r^2) - l (l + 1)) R[r] =
0;
nrad = NDSolve[{func, R[e] == 2, R'[e] == -2}, R[r], {r, e, 100},
  SolveDelayed -> True]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web