1

Trying to solve the following ODE:

solw = NDSolve[{0.75 (w[t] w''[t] - w'[t]^2) + w[t]^3 == 1/2 (1 + Tanh[100 t]), 
    w[0] == 0, w'[0] == 0}, w, {t, 0, 2}, Method -> "MethodOfLines"];
wsol[t_] := Evaluate[w[t] /. solw]

However, NDSolve gives an error:

Power::infy: Infinite expression 1/0. encountered.

I can't figure out why this happens and how to overcome this. Any idea will be appreciated.

Reviewed some related questions like this question or this question, but this does not help.

1 Answers1

5

Your initial conditions do not satisfy the ODE:

eqn = 0.75 (w[t] w''[t]-w'[t]^2)+w[t]^3==1/2 (1+Tanh[100 t]);
eqn /. t->0 /. {w[0]->0, w'[0]->0}

False

The only way your initial conditions can satisfy the ODE is if $$\lim_{t\to 0} w(t) w''(t) = \frac{2}{3}$$ which means that $$\lim_{t\to 0} w''(t) \to \infty$$

This is why NDSolve is unable to compute a solution, and why you get Power::infy messages. If you choose initial conditions that can satisfy the ODE, then NDSolve has no problems:

solw = NDSolveValue[{eqn, w[0] == (1/2)^(1/3), w'[0] == 0}, w, {t, 0, 2}];

Plot[solw[t], {t, 0, 2}]

plot

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Carl Woll
  • 130,679
  • 6
  • 243
  • 355