I'm working on a set of relatively basic ODEs of a physical pendulum and motor:
$$\left\{\text{jb} \theta ''(t\text{s})+\text{rb} \theta '(t\text{s})+\alpha \sin (\theta (t\text{s}))+\mu \tan ^{-1}\left(\frac{\theta '(t\text{s})}{\iota }\right)=\text{jw} \phi ''(t\text{s}),\tau u(t\text{s})=\text{jw} \left(\theta ''(t\text{s})+\phi ''(t\text{s})\right)+\text{rw} \phi '(t\text{s})\right\}$$
In an attempt to understand the system some more, I've updated the code to use real world values via Quantity[]:
displacement = Quantity[5 \[Pi]/180, "Radians"];
params = {\[Mu] -> 0.000795, rw -> 0.000039255383907286545`,
rb -> 0.00016799999999999996`, \[Iota] -> 0.1,
g -> Quantity[9.81, ("Meters")/("Seconds")^2],
mb -> Quantity[88, "Grams"], mw -> Quantity[129.31, "Grams"],
x -> Quantity[60.519, "Millimeters"],
y -> Quantity[61.816, "Millimeters"],
l -> Quantity[86.50, "Millimeters"],
k -> Quantity[90, "Millimeters"],
jw -> Quantity[0.0004032497194086029`, "Kilograms" ("Meters")^2],
jb -> Quantity[0.001412, "Kilograms" ("Meters")^2], \[Tau] ->
Quantity[33.5, ("Millinewtons" "Meters")/("Amperes")]};
eqn1 = g (l mb + k mw) Sin[\[Theta][Quantity[t, "Seconds"]]] +
jb (\[Theta]^\[Prime]\[Prime])[Quantity[t, "Seconds"]];
eqn2 = jw (\[Phi]^\[Prime]\[Prime])[Quantity[t, "Seconds"]];
deqns = {eqn1 ==
jw \[Phi]''[Quantity[t, "Seconds"]] -
rb \[Theta]'[
Quantity[t, "Seconds"]] - \[Mu] ArcTan[\[Theta]'[
Quantity[t, "Seconds"]]/\[Iota]] + fx + fy ,
eqn2 == \[Tau] u[Quantity[t, "Seconds"]] -
jw \[Theta]''[Quantity[t, "Seconds"]] -
rw \[Phi]'[Quantity[t, "Seconds"]]} ;
ics = {\[Theta][Quantity[0, "Seconds"]] ==
displacement, \[Theta]'[Quantity[0, "Seconds"]] ==
Quantity[0, "Radians"] , \[Phi][Quantity[0, "Seconds"]] ==
0, \[Phi]'[Quantity[0, "Seconds"]] == 0};
And from here try to to use NDSolve[]
sol = NDSolve[{{deqns /. params, ics} /. {u[t] -> 0,
f[t] -> 0}}, {\[Theta][Quantity[t, "Seconds"]], \[Phi][
Quantity[t, "Seconds"]]}, {t, 0, 60}];
(*pen ={k Sin[\[Theta][t]],-k Cos[\[Theta][t]]} /. sol;*)
However, I get the following error:
NDSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in [Theta][ts] should literally match the independent variables.
Is this error because NDSolve can't work with Quantity[], or how can I give units with NDSolve?
The resulting unit should be in Radians.
Thank you for the help!
equation = FormulaData[ "StefanBoltzmannLaw", {"\[Epsilon]" -> 1, "T" -> Quantity[t, "Kelvins"]}]
, andIntegrate[equation[[2]], {t, 0, 1000}]
$\endgroup$