- #1
stephanie22
- 2
- 0
Dear all,
If someone could help me solve this mathematica NDSolve problem, that would be really nice. Here is a related, simpler problem to the one I am having. Suppose I want to solve the nonlinear ODE
[tex]
\left(2 r + f(r) f'(r) \right) (1 + f'(r)^2) + r f(r) f''(r) = 0
[/tex]
subject to the initial conditions
[tex]
f(R) = f(-R) = 0 \,.
[/tex]
This problem is simpler than the one I actually want to solve, because in this case I know that the solution is
[tex]
f(r) = (R^2 - r^2)^{1/2} \,.
[/tex]
I would like to try and recreate the above solution by using NDSolve in mathematica. I try using the code
but I receive the error message "Power::infy: Infinite expression 1/0. encountered." I would like to recreate the solution f(r) = \sqrt{1 - r^2}.
Thanks in advance for any help!
Steph
If someone could help me solve this mathematica NDSolve problem, that would be really nice. Here is a related, simpler problem to the one I am having. Suppose I want to solve the nonlinear ODE
[tex]
\left(2 r + f(r) f'(r) \right) (1 + f'(r)^2) + r f(r) f''(r) = 0
[/tex]
subject to the initial conditions
[tex]
f(R) = f(-R) = 0 \,.
[/tex]
This problem is simpler than the one I actually want to solve, because in this case I know that the solution is
[tex]
f(r) = (R^2 - r^2)^{1/2} \,.
[/tex]
I would like to try and recreate the above solution by using NDSolve in mathematica. I try using the code
Code:
NDSolve[{(2 r + f[r] f'[r]) (1 + f'[r]^2) + r f[r] f''[r] == 0,
f[1] == 0, f[-1] == 0}, f, {r, -1, 1}]
Thanks in advance for any help!
Steph
Last edited: