Trying to build a parametric plot based on a NDSolve results, the Mathematica gives an error:
ReplaceAll::reps: {sol} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing
Can someone tell me what's the matter and how can I fix it?
Clear["Global`*"]
m = 10^-30;
n = 8;
l = 650*10^-9;
k = 2 Pi/l;
a = 10^-5;
A = 0.01;
T = 10;
vo = (k/a)10^-2;
b = (10^-4)(k/a)^2/2n;
eq = x''[t]-b(1 + t)(Sin[x[t]] - A/k);
sol =
NDSolve[{eq == 0, x'[0] == vo, x[0] == 0}, x[t], {t, 0, T},
MaxSteps -> 10^10, AccuracyGoal -> 10, MaxStepSize -> 0.001];
ParametricPlot[
Evaluate[{x[t], x'[t]} /. sol], {t, 0, T},
AxesLabel -> {"x(t)", "v(t)"},
PlotRange -> {Full, Full},
AspectRatio -> 1/2]
NDSolve
is removed, we'll seeNDSolve
spits outmxst
warning and stops at about2.234784800684802`*^-8
, further check shows the solution seems to increase linearly to about500
in this region, is this expected behavior? $\endgroup$reps
suggests that thesol = ……
line doesn't even calculated successfully.MaxSteps -> 10^10
is a rather demanding setting, are you sure your computer has enough memory to finish calculating? $\endgroup$