MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Numerical solution of differential equation with boundary

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109882] Re: Numerical solution of differential equation with boundary
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Fri, 21 May 2010 06:44:38 -0400 (EDT)

susy wrote:
> Hallo,
> 
> I need to solve the following differential equation:
> 
> (1/4 r^2 + 2 Sin[F[r]]^2) F''[r] + 1/2 r F'[r] + 
>   Sin[2 F[r]] (F'[r])^2 - 1/4 Sin[2 F[r]] - (Sin[F[r]]^2 Sin[2 F[r]])/r^2 == 0
> 
> with boundary values:
> F[0]==Pi, F[Infinity]==0.
> 
> I tried NDSolve, but failed to get a solution.
> How can I solve that equation?
> 
> Best regards,
> susy
> 

I had some luck by changing to a finite interval via r->1/(1+r). But I 
still needed to scoot in a bit from the origin (corresponding to 
infinity in the original coordinate).

new = (1/4 r^2 + 2 Sin[ff[r]]^2) D[ff[r], {r, 2}] +
     1/2 r D[ff[r], {r, 1}] + Sin[2 ff[r]] (D[ff[r], {r, 1}])^2 -
     1/4 Sin[2 ff[r]] - (Sin[ff[r]]^2 Sin[2 ff[r]])/r^2 /.
    Derivative[j_][ff][r] :> Derivative[j][ff][r]*D[1/(1 + r), {r, j}];

In[125]:= eps = .0001;

In[126]:= gg =
  ff[r] /. First[
    NDSolve[{new == 0, ff[1 - eps] == Pi, ff[eps] == 0},
     ff[r], {r, 1 - eps, eps}]];

During evaluation of In[126]:= 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. >>

During evaluation of In[126]:= NDSolve::berr: There are significant 
errors {-7.77603*10^-8,0.000328812} in the boundary value residuals. 
Returning the best solution found. >>

(*Ignoring the warning messages, the plot seems reasonable. *)

hh[s_?NumberQ] := gg /. r -> 1/(s + 1)

Plot[hh[s], {s, 1/(1 - eps) - 1, 1/eps - 1}]

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Orthogonal Distance Regression available?
  • Next by Date: Re: Orthogonal Distance Regression available?
  • Previous by thread: Re: Changing image from grey-scale to another
  • Next by thread: Re: data in absolutetime