MathGroup Archive 2001

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

Search the Archive

Re: non-linear boundary value problem

Richard, Here is one method based on a shooting technique. Consider
the following BVP:

Note the eqns are nonlinear due to the Sin[y[x]] term.
Write the above as two first order ODEs by letting


with initial conditions


Here the parameter a is the unknown "initial condition" we want to
find such that y1[1]=0.

The following code implements the shooting technique 

system[a_] := {y1'[x] == y2[x], y2'[x] == -Sin[y2[x]] + Cos[5x],
y1[-1] == 0,
      y2[-1] == a};
myODEsoln[a_] := NDSolve[system[a], {y1[x], y2[x]}, {x, -1, 1}]
yend[a_] := (y1[x] /. myODEsoln[a]) /. x -> 1
bc = FindRoot[First[yend[a]] == 0, {a, -2, 2}];
Plot[Evaluate[y1[x] /. myODEsoln[a /. bc]], {x, -1, 1}, 
    AxesLabel -> {"x", "y1(x)"}];

 This method can be used to solve higher order systems with a variety
of BCs. The key is to determine good  guesses for the FindRoot
If the equations are very stiff, then it is advisible to plot the
solution as a function of a to get some idea how the solution behaves
before attempting a Findroot calculation.

Have fun



Richard S Hsu <rhsu at U.Arizona.EDU> wrote in message news:<9kg1h0$ii8$1 at>...
> Hi,  I am sorry that I asked  a wrong question before.
> The question should be
> Where I could find a mathematica program to solve
> a non-linear boundary value problem :
> f''[ x ] ==  g[ f[x] ],   f[0] == a,  f'[L] ==  b ,
> where g is a known function, a,b and L are constants.
> The NDSolve does not work for non-linear problems.
> Thanks.

  • Prev by Date: Re: boundary value problem
  • Next by Date: Re: Can Mathematica 3.0 be run under Windows ME and/or Windows 98 SE?
  • Previous by thread: non-linear boundary value problem
  • Next by thread: Translator Needed