Does anyone know how to incorporate numerical analysis into Graphics? I set up a numerical solution to a differential equation using NDSolve. The solution executes perfectly fine. However, when you call the solution in Graphics, an error message pops up saying that it doesn't recognize the number of the solution (i.e. the coordinates). Is this a feature of Graphics? Plot can recognize the solution and use it just fine.
Here is example script (simple harmonic oscillator for demonstrative purposes):
Eqn1[\[Alpha]1_, \[Gamma]1_, \[Omega]01_, \[Omega]1_, A1_, t_] =
D[f1[t], {t, 2}] + \[Omega]01^2*f1[t] == A1*Cos[\[Omega]1*t];
IC11[\[Alpha]1_, \[Gamma]1_, \[Omega]01_, \[Omega]1_, A1_, t_] =
f1[0] == \[Alpha]1;
IC12[\[Alpha]1_, \[Gamma]1_, \[Omega]01_, \[Omega]1_, A1_,
t_] = (D[f1[t], {t, 1}] == \[Gamma]1) /. { t -> 0 };
Sol1[\[Alpha]1_, \[Gamma]1_, \[Omega]01_, \[Omega]1_, A1_, t0_,
time_] := NDSolve[
{
Eqn1[\[Alpha]1, \[Gamma]1, \[Omega]01, \[Omega]1, A1, t],
IC11[\[Alpha]1, \[Gamma]1, \[Omega]01, \[Omega]1, A1, t],
IC12[\[Alpha]1, \[Gamma]1, \[Omega]01, \[Omega]1, A1, t]
},
f1[t],
{t, t0, time}
]
x1[\[Alpha]1_, \[Gamma]1_, \[Omega]01_, \[Omega]1_, A1_, t0_, time_] :=
Replace[
f1[t],
Sol1[\[Alpha]1, \[Gamma]1, \[Omega]01, \[Omega]1, A1, t0, time]
]
Evaluate[x1[1, 0, 1, 0, 0, 0, 10]]
Graphics[{
Rectangle[ { Evaluate[x1[1, 0, 1, 0, 0, 0, 10]] + 1/3 , 0 }, {
Evaluate[x1[1, 0, 1, 0, 0, 0, 10]] - 1/3, 2/3 } ]
(* Graphics *)}, ImageSize -> Medium]