Infinite expression encountered in NDSolve

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.

• It's due to your initial conditions. Can you start at a different point? – J. M.'s ennui Apr 2 '18 at 8:07
• I start from t=0.0001, it gies the same error. I also try to alter w[0] and try with w[0]=0.0001, but the solution is highly oscillating. This should not be the case. – Asatur Khurshudyan Apr 2 '18 at 8:12
• You need to change the left endpoint in {t, 0, 2} as well if you're doing the perturbation. This is a known limitation of NDSolve[]. May I suggest using $MachineEpsilon instead of 0? – J. M.'s ennui Apr 2 '18 at 8:16 • Tried with $MachineEpsilon, but the solution amplitude becomes 10^106. – Asatur Khurshudyan Apr 2 '18 at 8:21
• Speaking of... your code did not provide the definition for f[t]; please edit your question to include it. – J. M.'s ennui Apr 2 '18 at 8:24

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}]