Hello guys,
I played around with NDSolve and I found out that ExplicitEuler Method works instead of ExplicitRungeKutta Method
Does ExplicitEuler Method not encounter "infinity" as stiffness?
Doesn't Work
NDSolve[{y'[x] ==
y[x]^3 (1 - y[x]) x^2 - (1 - y[x])^3 x^2 +
3/8 y[x] (1/2 y[x]^(-1/2)), y[0] == 0.}, y, {x, 0, 1
},
Method -> "ExplicitRungeKutta", "StartingStepSize" -> 1/1000]
Work
NDSolve[{y'[x] ==
y[x]^3 (1 - y[x]) x^2 - (1 - y[x])^3 x^2 +
3/8 y[x] (1/2 y[x]^(-1/2)), y[0] == 0.}, y, {x, 0, 1
},
Method -> "ExplicitEuler", "StartingStepSize" -> 1/10]
NDSolve[{y'[x] ==
y[x]^3 (1 - y[x]) x^2 - (1 - y[x])^3 x^2 +
3/8 y[x] (1/2 y[x]^(-1/2)), y[0] == 0.}, y, {x, 0, 1
},
Method -> "ExplicitEuler", "StartingStepSize" -> 1/1000]
Btw, I get 2 different graphs for different step size.
Also, I would like to know how to input my equation into the Runge Kutta Plug-in Method.
It was in the tutorial guide under ExplicitRungeKuttaMethod but what was written is just the basic formula.
ClassicalRungeKutta[__]["Step"[f, t, h, y, yp]] :=
Block[{deltay, k1, k2, k3, k4},
k1 = yp;
k2 = f[t + 1/2 h, y + 1/2 h k1];
k3 = f[t + 1/2 h, y + 1/2 h k2];
k4 = f[t + h, y + h k3];
deltay = h (1/6 k1 + 1/3 k2 + 1/3 k3 + 1/6 k4);
{h, deltay}
];
What does this command means?
["Step"[f, t, h, y, yp_]]
Thanks your the help :D