ListPlot is not plotting functions from DSolve, brought by ReplaceAll(/.) command
The problem here is the way the replacements are made. ODE
is a replacement rule that looks like:
{{x[t] -> 1 + t}}
The Manipulate
effectively tries to evaluate something like the following (for some value of t
you selected):
DynamicModule[{t = 10}, ListPlot[{{x[t] /. ODE, 0}}]]
The problem here is that during the evaluation, x[t]
first gets evaluated to x[10]
and then the replacement rule x[t] -> 1 + t
doesn't match x[10]
any more.
You can fix this in two ways. The first way is to use this definition of ODE
instead:
ODE = First @ DSolve[{x'[t] == 1, x[0] == 1}, x, t]
Manipulate[ListPlot[{{x[t] /. ODE, 0}}, PlotRange -> {{0,10},{-1,1}}], {t, 0, 10}]
{x -> Function[{t}, 1 + t]}
This works because the replacement rule now specifies that x
is a function, rather than that x[t]
is a symbolic expression.
The second (and in my opinion the superior) way is to use DSolveValue
instead so you don't have to muck about with replacement rules at all:
ODE = DSolveValue[{x'[t] == 1, x[0] == 1}, x, t]
Manipulate[ListPlot[{{ODE[t], 0}}, PlotRange -> {{0,10},{-1,1}}], {t, 0, 30}]
Function[{t}, 1 + t]
Edit
You also remarked that Plot
does work. This is because Plot
uses Block
to assign a value to t
and in that case the value of t
in x[t]
and in ODE
matches again. Compare:
Block[{t = 10}, x[t] /. ODE]
Module[{t = 10}, x[t] /. ODE]