NDSolve::ndssc NDSolveValue::ndssc ParametricNDSolve::ndssc ParametricNDSolveValue::ndssc
Examples
Basic Examples (1)
Consider the following equation:
eqns = {(Derivative[1][q1][t]/50) + 6.54`*^-6 Derivative[2][q1][t] + 0.0000100268 Derivative[2][q2][-(1/25000000) + t] == (Piecewise[{{0, t <= 0}, {3.047985604177748968262`5.*^21*t^3 - 1.1439276070233271491461117021`5.*^28*
t^4 + 1.144794341360834`5.*^34*t^5, 0 < t < 1/2500000},
{40*((48*Cos[200000*Pi*t])/(25*Pi) - (44*Cos[600000*Pi*t])/(75*Pi) +
(8*Cos[1000000*Pi*t])/(25*Pi) - (36*Cos[1400000*Pi*t])/(175*Pi) +
(32*Cos[1800000*Pi*t])/(225*Pi) - (28*Cos[2200000*Pi*t])/(275*Pi) +
(24*Cos[2600000*Pi*t])/(325*Pi) - (4*Cos[3000000*Pi*t])/(75*Pi) +
(16*Cos[3400000*Pi*t])/(425*Pi) - (12*Cos[3800000*Pi*t])/(475*Pi) +
(8*Cos[4200000*Pi*t])/(525*Pi) - (4*Cos[4600000*Pi*t])/(575*Pi)), t >= 1/2500000}}, 0]), 4.02 Derivative[1][q2][t] + 0.0000100268 Derivative[2][q1][-(1/25000000) + t] + 0.00001675 Derivative[2][q2][t] == 0, q1[t /; t < 0] == 0, q2[t /; t < 0] == 0};
NDSolve[eqns, {q1, q2}, {t, 0, 0.00004}, MaxSteps -> 50000000, StartingStepSize -> (1/1000000000), Method -> {"FixedStep", Method -> "ExplicitEuler"}];Getting a result from the equation above at machine precision will be hopeless due to the vast difference in scales of some of the numbers. There are powers to the 34th along with numbers like 0.00001. That is nearly 40 orders of magnitude. The error message can be resolved by rationalizing the equations, then using an increased WorkingPrecision:
newEqns = Rationalize[eqns, 0];
NDSolve[newEqns, {q1, q2}, {t, 0, 1 / 25000}, MaxSteps -> 50000000, StartingStepSize -> (1/1000000000), Method -> {"FixedStep", Method -> "ExplicitEuler"}, WorkingPrecision -> 20]