# Drawing disk with coordinates from NDSolve

I have simple Manipulation expression, but continuously getting error

Coordinate {x[0.], y[0.]} should be a pair of numbers, or a Scaled or Offset form.

I assume that something is wrong with Graphics, but don't know why Evaluate doesn't give numerical values.

The expression is:

Manipulate [{
sx = NDSolve[{x''[t] + (2 k1)/m  (x[t] - a) == 0, x == x0, x' == vx0}, x[t], {t, 0, 10}];
sy = NDSolve[{y''[t] + (2 k2)/m  (y[t] - a) == 0, y == y0, y' == vy0}, y[t], {t, 0, 10}];
Graphics[{Disk[{Evaluate[x[tl] /. sx][], Evaluate[y[tl] /. sy][]}, 0.1]}, {PlotRange -> 6}]
}[],
{a, 1, 10}, {m, 1, 10}, {k1, 1, 100}, {k2, 1, 100}, {x0, 0, 10}, {y0, 0, 10}, {vx0, 2, 10}, {vy0, 2, 10}, {tl, 0, 10}
]


Manipulate[{sx = NDSolve[{x''[t] + (2 k1)/m (x[t] - a) == 0, x == x0, x' == vx0},
x[t], {t, 0, 10}];
sy = NDSolve[{y''[t] + (2 k2)/m (y[t] - a) == 0, y == y0, y' == vy0},
y[t], {t, 0, 10}];
Graphics[{Disk[{Evaluate[x[t] /. sx][],  Evaluate[y[t] /. sy][]}, 0.4]},
PlotRange -> 6] /. t -> tl}[],
{a, 1, 10}, {m, 1, 10}, {k1, 1, 100}, {k2, 1, 100}, {x0, 0, 10},
{y0, 0, 10}, {vx0, 2, 10}, {vy0, 2, 10}, {tl, 0, 10}] To get a hint as to why the original code does not work, try

Evaluate[y[t] /. sy]
(* {InterpolatingFunction[{{0.,10.}},"<>"][t]} *)


and

Evaluate[y[tl] /. sy]
(* {y[tl]} *)


Similarly, for x[t].

• Simple. Thanks. – tobix10 Oct 10 '14 at 16:31