I have tried to use NDSolve for solving 4th order coupled ODEs problems (see the attached codes). The MMA solver fails to solve this problem.
ClearAll["Global`*"]
L = 10;
ode1 = y''[t] - 0.01 y''''[t] == 0;
ic11 = y[0] == 0;
ic12 = y''[0] == 0;
ic13 = y'[L] == 0;
ic14 = x[L]*x[L]*(y'[L] - 0.01*y'''[L]) == 1/20;
ode2 = -10 (4.7169 (1.12 - x[t]) + 0.2120 x''[t]) +
424000 x[t] (y'[t]^2 + 0.010 y''[t]^2) == 0;
ic21 = x'[0] == 0;
ic22 = x'[L] == 0;
sn = NDSolveValue[{ode1, ode2, ic11, ic12, ic13, ic14, ic21,
ic22}, {x[t], y[t]}, {t, 0, L},
Method -> {"Shooting",
"ImplicitSolver" -> {"Newton", "StepControl" -> "LineSearch"},
"StartingInitialConditions" -> {x[0] == 1}}];
Note that the initial value of x must equal 1.12.
How can I set the "Shooting" method in MMA for solving Stiff System of ODEs? Namely, how to define the initial values for the "Shooting" method in MMA.
Update Version 01_2020.
Now we are trying to verify the method proposed by @bbgodfrey
Such test procedure looks like that:
ic4 has changed to
ic14 = x[L]x[L](y'[L] - 0.01*y'''[L]) == 0;
The input file:
L = 10;
ode1 = y''[t] - 0.01 y''''[t] == 0;
ic11 = y[0] == 0;
ic12 = y''[0] == 0;
ic13 = y'[L] == 0;
ic14 = x[L]*x[L]*(y'[L] - 0.01*y'''[L]) == 0;
ode2 = -10 (4.7169 (1.12 - x[t]) + 0.2120 x''[t]) +
424000 x[t] (y'[t]^2 + 0.010 y''[t]^2) == 0;
ic21 = x'[0] == 0;
ic22 = x'[L] == 0;
sy = (DSolve[{ode1, ic11, ic12, ic13}, y, t] // Flatten) /.
C[1] -> c Exp[-100]
ode2x = Simplify[ode2 /. sy];
ic14x = Collect[ic14 /. sy, x[10], Simplify];
sn = NDSolveValue[{ode2x /. c -> c[t], ic14x /. c -> c[L], ic21, ic22,
c'[t] == 0}, {x[t], c[10]}, t,
Method -> {"Shooting",
"ImplicitSolver" -> {"Newton", "StepControl" -> "LineSearch"},
"StartingInitialConditions" -> {x[0] == -1/2, c[0] == I/8}}] //
Flatten;
sn // Last
Plot[Evaluate@ReIm@First@sn, {t, 0, L}, ImageSize -> Large,
AxesLabel -> {t, x}, LabelStyle -> {15, Bold, Black}]
Plot[Evaluate@ReIm@Last[y /. sy /. c -> Last[sn]], {t, 0, L},
ImageSize -> Large, AxesLabel -> {t, y},
LabelStyle -> {15, Bold, Black}]
the output: should be y ==0 and x = const 1.12 for ic4 (new one):
ic14 = x[L]x[L](y'[L] - 0.01*y'''[L]) == 0;
The simulated results:
Obviously, x is not const, oscillation can be observed.
y
, using any boundary conditions that depend ony
only, and then insert that result into the ODE forx
. Also, be sure to replace anyC[_]
constants in the expression fory
by constants without indices before that substitution. $\endgroup$Print[Dynamic@{foo, Clock[Infinity]}]; sn = NDSolveValue[..., StepMonitor :> (foo = t)]
. It shows that shooting for the correct initial conditions takes a long time. You say the problem is stiffness — maybe you know that theoretically — but if you could give better starting initial conditions, you might solve it. [Added: @bbgodfrey's idea seems better; didn't see it.] $\endgroup$x[0] == 1
as a boundary condition would overspecify this ode system. Note, however, that"StartingInitialConditions" -> {x[0] == 1}
does not guarantee that the solution forx
is equal to1
att = 0
. $\endgroup$