When solving a system of differential equations numerically, I get two interpolating functions. I can graph both of these, but when I try to evaluate either of the functions at a point, it just spits out:
{x1[5]}
x1[t]
is the interpolating function, and 5 is the number I chose to try to evaluate it at.
I set prsol=NDSolve[blah blah]
To evaluate it, I've tried:
Evaluate[x1[5]/.prsol]
and
one[t_]:=x1[t]/.prsol
one[5]
Both of these spit out {x1[5]}
which is contrary to what the F1 Help says it should do.
P0h = 1.856*10^7;
V0h = .826063;
T0 = 299.817
g = 9.81;
Aac=.16;
Abe=.025;
Vr=1.067;
Vst=.006306;
Vh[x_] := Vr - x*Aac;
Vl[x_] := Vst + x*Abe;
m1 = 290000;
m4 = 9021;
k3 = 8*10^6;
R = 8.3144621;
Tc = 126.1;
Pc = 3.394*10^6;
ω = .040;
b = .07779607*(R*Tc)/Pc;
Trr[T_] := T/Tc;
κ = .37464 + 1.54226 ω - .26993 ω^2
α[T_] := (1 + κ (1 - Sqrt[Trr[T]]))^2
ac = .45723553*(R^2*Tc^2)/Pc;
a[T_] := ac*α[T]
nh = (P0h*V0h)/(R*T0);
nl = (P0l*V0l)/(R*T0);
Vmolh[x_] := Vh[x]/nh
Vmoll[x_] := Vl[x]/nl
Ppr[x_] := (R*T0)/(Vmolh[x] - b) -
a[T0]/(Vmolh[x]^2 + 2*b*Vmolh[x] - b^2)
Fpr[x_] :=
Aac ((R*T0)/(Vmolh[x] - b) -
a[T0]/(Vmolh[x]^2 + 2*b*Vmolh[x] - b^2)) -
Abe ((R*T0)/(Vmoll[x] - b) -
a[T0]/(Vmoll[x]^2 + 2*b*Vmoll[x] - b^2))
A1 = .1;
ω2 = π/4;
c = 10000;
d = 300000;
ctipmot[t_] := A1 Cos[ω2 t]
prsol = NDSolve[{-c x4'[t] -
k3 ((m4 g + Fpr[54/39.3701])/k3 + ctipmot[t] + x4[t]) +
Fpr[x1[t] - x4[t] + 54/39.3701] + m4 g ==
m4 x4''[t], -c x1'[t] - d x1'[t]*Abs[x1'[t]] -
Fpr[x1[t] - x4[t] + 54/39.3701] + m1 g == m1 x1''[t], x1[0] == 1,
x4[0] == 0, x1'[0] == 0, x4'[0] == 0}, {x1[t], x4[t]}, {t, 0,
100}]
{{x1[t] -> InterpolatingFunction[{{0.,100.}},<>][t],x4[t] -> InterpolatingFunction[{{0.,100.}},<>][t]}}
Plot[Evaluate[x1[t] /. prsol], {t, 0, 32}]
^That gives me a graph
Evaluate[x1[5] /. prsol]
^That gives me:
{x1[5]}
instead of a value.