Group Abstract Group Abstract

Message Boards Message Boards

Solving Boundary Value ODEs With Quasi-Linearization

POSTED BY: Frank Kampas
5 Replies

the solutions are slightly different

In[17]:= AbsoluteTiming[
 sol = NDSolve[{y''[x] - 5*Sinh[5*y[x]] == 0, y[0] == 0, y[1] == 1}, 
    y, {x, 0, 1}, Method -> "ExplicitEuler", 
    "StartingStepSize" -> 1/100];]

Out[17]= {0.0407043, Null}

In[19]:= y'[0] /. sol

Out[19]= {0.0538005}

In[22]:= x'[0] /. nsln

Out[22]= {0.0457504}

In[23]:= Plot[(x[t] /. nsln) - (y[t] /. sol), {t, 0, 1}]

enter image description here

It might be better to use the ExplicitEuler result to set an InitialSeeding for the default method.

POSTED BY: Frank Kampas

With this code works fine:

sol = NDSolve[{y''[x] - 5*Sinh[5*y[x]] == 0, y[0] == 0, y[1] == 1}, y, {x, 0, 1}, Method -> "ExplicitEuler", 
"StartingStepSize" -> 1/100];
Plot[y[x] /. sol, {x, 0, 1}, PlotRange -> All]

Regards M.I.

POSTED BY: Mariusz Iwaniuk
 Another approach to finding an InitialSeeding for Troesch's equation
is the Principle of Least Action, by considering the equation to be an 
equation of motion. 

 A Lagrangian can be constructed with its equation of motion being
Troesch's equation.

In[1]:= Needs["VariationalMethods`"]

In[2]:= EulerEquations[1/2 x'[t]^2 + Cosh[5 x[t]], x[t], t]

Out[2]= 5 Sinh[5 x[t]] - (x^\[Prime]\[Prime])[t] == 0

 The solution to the boundary value equation of motion can be constructed
 by minimizing the Action, which is the integral of the Lagrangian
  over the time period.  The Lagrangian is the kinetic energy minus
  the potential energy.  The two terms can be discretized, using a finite
  difference approximation for the time derivative.

 Discretized variables with bounds:

In[3]:= vwb = Table[{x[t], -1, 2}, {t, 0, 1, 1/20}];

Discretized approximation to integral of kinetic energy 

In[4]:= sumKE = 1/20*1/
    2 Sum[((x[t + 1/40] - x[t - 1/40])/(1/20))^2, {t, 1/40, 39/40, 1/20}] // 
   Expand;

 Discretized approximation to the integral of the potential energy

In[5]:= sumPE = - (1/21) Sum[Cosh[5 x[t]], {t, 0, 1, 1/20}];

 Minimize the discretized approximation to the Action

In[6]:= AbsoluteTiming[nmsln = NMinimize[{sumKE - sumPE, x[0] == 0, x[1] == 1}, vwb];]

Out[6]= {0.123725, Null}

 Construct an interpolation function from the solution

In[7]:= int = Interpolation[Table[{t, x[t]}, {t, 0, 1, 1/20}] /. nmsln[[2]]];

 Find the derivative at t = 0

In[8]:= int'[0]

Out[8]= 0.0523738

 Use the derivative as an Initial Seeding

In[9]:= AbsoluteTiming[
  nsln = NDSolve[{5 Sinh[5 x[t]] - (x^\[Prime]\[Prime])[t] == 0, x[0] == 0, 
     x[1] == 1}, x, t, InitialSeeding -> {x'[0] == 0.0523}]];

 Plot the result

enter image description here

POSTED BY: Frank Kampas

Thanks for pointing out the article.

POSTED BY: Frank Kampas
Anonymous User
Anonymous User
Posted 6 years ago

Troesch’s equation is a boundary value problem (BVP) expressed as where prime denotes differentiation with respect to x and n (sinh(n y)) is known as Troesch’s parameter.

https://www.hindawi.com/journals/mpe/2012/208375/ a comparison of convergence speed of the various solutions

POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard