0
$\begingroup$

I want to solve this equation:

sol = NDSolve[{10000 u'[r] (1+u'[r]) - 
 1.`*^-6 (r + u[r]) (u[r] + r u'[r]) + 
 10000 r u'[r] u''[r] + 
 10000 r (1 + u'[r]) u''[r] == 0, 10000 u'[1] == 3.001, 10000 u'[3] == 1}, u, r,
   MaxSteps ->Infinity]

the error message is:

FindRoot::sszero: The step size in the search has become less than the tolerance 
 prescribed by the PrecisionGoal option, but the function value is still greater than 
 the tolerance prescribed by the AccuracyGoal option. >>
 NDSolve::berr: There are significant errors {-0.000159873,0.000479427} in the boundary 
value residuals. Returning the best solution found. >>

what option should I add into NDSolve to resolve the problem? thanks

$\endgroup$
5
$\begingroup$

I think you need to check your equations and/or the numeric values you are using. To me it looks like this problem might well have no solution:

equation = 
  10000 u'[r] (1 + u'[r]) - 1.`*^-6 (r + u[r]) (u[r] + r u'[r]) + 
    10000 r u'[r] u''[r] + 10000 r (1 + u'[r]) u''[r] == 0;

derivativeAtEndPoint[uStart_?NumericQ] := 
  NDSolveValue[{equation, 10000 u'[1] == 3.001, u[1] == uStart}, 
    u', {r, 1, 3}, MaxSteps -> Infinity][3];

NMinimize[derivativeAtEndPoint[x], {x}]

(* {0.000100045, {x -> -1.26152}} *)

Remark: This is a boundary value problem and Mathematica typically uses the "Shooting" method to solve it. The above is a manual formulation of the shooting method, where instead of solving for the end point condition I am minimizing it to show that the desired condition can't be fulfilled. If it could be, you would just need to use FindRoot to determine the value for uStart which gives the desired value. That is basically also what NDSolve does internally, but as the condition can't be fulfilled, FindRoot starts complaining...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.