Mathematica: Infinite expression error when using NDSolve

Click For Summary
SUMMARY

The forum discussion centers on an issue encountered while using Mathematica's NDSolve function to solve a nonlinear ordinary differential equation (ODE). The user attempts to solve the equation with initial conditions f(1) = 0 and f(-1) = 0 but receives an "Infinite expression 1/0" error. The suggested approach includes using the Trace function to diagnose the problem, which indicates that NDSolve is employing the shooting method. The user is advised to contact Wolfram Research, Inc. (WRI) tech support for further assistance.

PREREQUISITES
  • Familiarity with nonlinear ordinary differential equations (ODEs)
  • Understanding of Mathematica's NDSolve function
  • Basic knowledge of initial conditions in differential equations
  • Experience using Mathematica's Trace function for debugging
NEXT STEPS
  • Explore advanced features of Mathematica's NDSolve function
  • Learn about the shooting method for solving boundary value problems
  • Investigate common error messages in Mathematica and their solutions
  • Contact Wolfram Research, Inc. tech support for specific Mathematica issues
USEFUL FOR

Mathematica users, mathematicians, and engineers working with differential equations who need to troubleshoot NDSolve errors.

stephanie22
Messages
1
Reaction score
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
<br /> \left(2 r + f(r) f&#039;(r) \right) (1 + f&#039;(r)^2) + r f(r) f&#039;&#039;(r) = 0 <br />
subject to the initial conditions
<br /> f(R) = f(-R) = 0 \,.<br />
This problem is simpler than the one I actually want to solve, because in this case I know that the solution is
<br /> f(r) = (R^2 - r^2)^{1/2} \,. <br />

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}]
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
 
Last edited:
Physics news on Phys.org
An interesting question (and well asked). Unfortunately, I don't have a good answer for you.

If you use Trace[ NDSolve[...], TraceInternals->True], then you can see that NDSolve is trying the shooting method when it all goes wrong. However, I'm not sure what exactly is going wrong nor how to fix it.

I suggest you contact WRI tech support (http://www.wolfram.com/support/contact/) and see if they can sort it out.
If they do have a good answer, it would be great if you could post it here.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 0 ·
Replies
0
Views
1K