# NDSolve and strange “nonlinear coefficients problem”

I'm stuck solving the following problem. I defined two functions as follows:

$$\varphi(\lambda) = \frac{\left((\lambda-2)^2-1 \right)^2}{4}$$ $$\gamma(\lambda) = \varepsilon^2 \quad\text{where}\quad \varepsilon^2=2 \times10^{-2}$$

φφ[λ_] = ((λ - 2)^2 - 1)^2/4;
γγ[λ_] = -ε^2 /. \ε^2 -> 2 10^-2;


Then, I solved the following 4th order PDE:

$$\dot{u} = \gamma(1+u')u^{iv} + \varphi''(1+u') u''$$ and boundary and initial conditions set as follows: $$u(x,0) = x$$ $$u(x_1,t) = 0 \qquad u(x_2,t) = 5$$ $$u''(x_1,t) = 0 \qquad u''(x_2,t) = 0$$

X1=0;
X2=5;
TS = 15;
ICs[x_]= x;

SIM1 = NDSolveValue[{
\!$$\*SubscriptBox[\(∂$$, $$t$$]$$u[x, t]$$\) == γγ[1 + \!$$\*SubscriptBox[\(∂$$, $$x$$]$$u[x, t]$$\)] \!$$\*SubscriptBox[\(∂$$, $$x, x, x, x$$]$$u[x, t]$$\) + φφ''[1 + \!$$\*SubscriptBox[\(∂$$, $$x$$]$$u[x, t]$$\)] \!$$\*SubscriptBox[\(∂$$, $$x, x$$]$$u[x, t]$$\),
(* BCs *)
Derivative[0, 0][u][X1, t] == ICs[X1],
Derivative[0, 0][u][X2, t] == ICs[X2],
Derivative[2, 0][u][X1, t] == 0,
Derivative[2, 0][u][X2, t] == 0,
(* ICs *)
Derivative[0, 0][u][x, 0] == ICs[x]
}, u, {x, X1, X2}, {t, 0, TS}, MaxStepFraction -> 1/200]


And it works (even if the solution seems to be dependent of value TS). Then, I tried to impose $u'' = w$ for solving the system in a different way $$\left\{\begin{array}{l} 0 = u'' - w \\ \dot{u} = \gamma(1+u')w'' + \varphi''(1+u') w \end{array} \right.$$
and boundary and initial conditions as follows: $$u(x,0) = x$$ $$u(x_1,t) = 0 \qquad u(x_2,t) = 5$$ $$w(x_1,t) = 0 \qquad w(x_2,t) = 0$$ but the system cannot be solved:

SIM2 = NDSolveValue[{
\!$$\*SubscriptBox[\(∂$$, $$t$$]$$u[x, t]$$\) == γγ[1 + \!$$\*SubscriptBox[\(∂$$, $$x$$]$$u[x, t]$$\)] \!$$\*SubscriptBox[\(∂$$, $$x, x$$]$$w[x, t]$$\) + φφ''[1 + \!$$\*SubscriptBox[\(∂$$, $$x$$]$$u[x, t]$$\)] w[x, t],
0 == \!$$\*SubscriptBox[\(∂$$, $$x, x$$]$$u[x, t]$$\) - w[x, t],
(* BCs *)
Derivative[0, 0][u][X1, t] == ICs[X1],
Derivative[0, 0][u][X2, t] == ICs[X2],
Derivative[0, 0][w][X1, t] == 0,
Derivative[0, 0][w][X2, t] == 0,
(* ICs *)
Derivative[0, 0][u][x, 0] == ICs[x]
}, {u, w}, {x, X1, X2}, {t, 0, TS}, MaxStepFraction -> 1/200]


NDSolveValue::femnonlinear: Nonlinear coefficients are not supported in this version of NDSolve.

I can't understand this error message, since the functions used are the same! How can I overcome this problem?

==== EDIT ====

Thanks to Michael E2 and xzczd for their advises.

I tried to solve the same equation by coding a finite-difference scheme with Matlab, and I get the solution $u(x) = x$ (no evolution from the initial condition). The same result was obtained by using the PDE toolbox of COMSOL. At the end of the day, I need a perturbation on the initial configuration. Then I did the following:

λλ = 2;

nn = 3;
μ[x_] = 1/100 Sin[nn π (x - X1)/(X2 - X1)]

λic[x_] = λλ + μ[x];

uic[x_] = Integrate[λic[x] - 1, x];
uic[x_] = uic[x] - uic[X1];


even if $\mu(x)$ does not satisfy the BCs (I know a different perturbative function is needed). The 4th order equation is solved as before, but I'm still wondering on strange behaviour of the low-order system. Now the code is:

TS = 5;
SIM12 = NDSolveValue[{
\!$$\*SubscriptBox[\(\[∂]$$, $$t$$]$$u[x, t]$$\) == γγ[1 + \!$$\*SubscriptBox[\(\[∂]$$, $$x$$]$$u[x, t]$$\)] \!$$\*SubscriptBox[\(\[∂]$$, $$x, x$$]$$w[x, t]$$\) + \φφ''[1 + \!$$\*SubscriptBox[\(\[∂]$$, $$x$$]$$u[x, t]$$\)] w[x, t],
0 == \!$$\*SubscriptBox[\(\[∂]$$, $$x, x$$]$$u[x, t]$$\) - w[x, t],
(* BCs *)
Derivative[0, 0][u][X1, t] == uic[X1],
Derivative[0, 0][u][X2, t] == uic[X2],
Derivative[0, 0][w][X1, t] == 0,
Derivative[0, 0][w][X2, t] == 0,
(* ICs *)
Derivative[0, 0][u][x, 0] == uic[x],
Derivative[0, 0][w][x, 0] == 0
}, u, {x, X1, X2}, {t, 0, TS},
Method -> {"MethodOfLines", "TemporalVariable" -> t},
MaxStepFraction -> 1/70]


1) NDSolveValue::pdord: Some of the functions have zero differential order, so the equations will be solved as a system of differential-algebraic equations. >>

2) NDSolveValue::bcart: Warning: an insufficient number of boundary conditions have been specified for the direction of independent variable x. Artificial boundary effects may be present in the solution. >>

3) NDSolveValue::ivres: NDSolve has computed initial values that give a zero residual for the differential-algebraic system, but some components are different from those specified. If you need them to be satisfied, giving initial conditions for all dependent variables and their derivatives is recommended. >>

4) NDSolveValue::eerr: Warning: scaled local spatial error estimate of 39.903135757967355at t = 5. in the direction of independent variable x is much greater than the prescribed error tolerance. Grid spacing with 71 points may be too large to achieve the desired accuracy or precision. A singularity may have formed or a smaller grid spacing can be specified using the MaxStepSize or MinPoints method options. >>  Questions:

a) Increasing the number of gridpoints, the solution becomes better, but when I use 101 points Mathematica starts the computation, but it seems to never end..

b) Why is it a DAE? The second equation does not depend on time, but it has not 0th differential order (and the others are initial and boundary conditions). Moreover, following warning (2), at the edges the BCs are not satisfied, as shown in the below figure.

c) Why does Mathematica find an insufficient number of BCs?

d) Why does Mathematica give an evolution result for the 4th order equation (SIM1) while both COMSOL and a finite-difference scheme does not?

I know the initial configuration does not satisfy the BCs, so I'm not worried about that.

==== EDIT 2 ====

The following perturbation satisfies BCs:

nn = 4;
μ[x_] = 1/100 (1 - Cos[nn π (x - X1)/(X2 - X1)])


PS

how can I get the greek symbols?

Thanks again for all your precious (and appreciated) help!

Petrus

• The short answer is that NDSolve is using different methods, which have different requirements. You can try Method -> "MethodOfLines". It seems to want an initial value for the time integration of w; and it warns that there is no time derivative of w, so it will treat the system as a DAE. I tried the IC w[x, 0] == 0, but it returned the trivial-ish solution u[x, t] = x, which is in fact a solution of SIM1, too. Not sure what to do.... – Michael E2 Nov 19 '14 at 13:44
• Using Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> 151, "MinPoints" -> 151, "DifferenceOrder" -> "Pseudospectral"}} in SIM1 also leads to the u[x, t] = x solution. – xzczd Nov 20 '14 at 6:16
• @MichaelE2: thanks very much for your suggestions! I also tried to solve the same equation using a finite-difference code written by myself in Matlab, and with a linear initial condition I get the same results. At the end of day, I need to use a perturbation on the initial condition. Anyway, there still are some errors that I cannot understand. (I'm updating the question) – Petrus Nov 20 '14 at 10:40
• @xzczd: thanks to you too! Same comment as above – Petrus Nov 20 '14 at 10:40
• As to the last question, have a look at this and this. – xzczd Nov 21 '14 at 8:56