I'm doing my end of semester project for a physics class. We were supposed to graphically model a physical occurrence; I chose doing a Pendulum Wave.
I have my code written, however Mathematica keeps kicking out these errors:
Manipulate::vsform: Manipulate argument Null does not have the correct form for a variable specification.
The help files isn't much use, but going to the error box gives these errors:
Lighter is not a Graphics primitive or directive.
Darker is not a Graphics primitive or directive.
Blue is not a Graphics primitive or directive.
There are a couple of more errors dealing with the Coordinate command. Below is all of my code. My best guess as to what's going on is that Graphics cannot be combined with the Table command. If that's the case, how do I use the list of solutions for the lengths with Graphics?
Manipulate[
Module[
{sol, \[Theta], t, L, periods, perFcn, nPend, \[Theta]0, lens,
g = 9.8},
periods = 60/Range[51 + nPend - 1, 51, -1] ;
perFcn =
Sqrt[(32 L)/(g (1 - Cos[\[Theta]0]))]
EllipticF[\[Theta]0/2, Csc[\[Theta]0/2]^2];
lens = Chop[
Table[L /. First@Solve[periods[[i]] == perFcn, L], {i, nPend}] // N];
sol = Table[
NDSolve[{\[Theta]''[t] + g/lens[[i]] Sin[\[Theta][t]] ==
0, \[Theta][0] == \[Theta]0, \[Theta]'[0] == 0}, \[Theta][
t], {t, 0, time}, Method -> "StiffnessSwitching"]
, {i, 1, nPend}
];
Table[
Graphics[{
{Line[{{0,
0}, {(lens[[i]])*Sin[sol[[i]]], -(lens[[i]])*
Cos[sol[[i]]]}}]},
{Lighter[Brown], Rectangle[{-4, 0}, {4, .5}]},
{Darker[Red], Disk[{0, 0}, .1]},
{Blue,
Disk[{(lens[[i]])*Sin[sol[[i]]], -(lens[[i]])*
Cos[sol[[i]]]}, .2]}
},
PlotRange -> {{-5, 5}, {.5, -14}}, ImageSize -> {500, 300}
],
{i, 1, nPend}
]
]
,
{{nPend, 10, "Number of Pendulums"}, 1, 25, 1(*,Appearance->"Labelled"*)},
{{\[Theta]0, \[Pi]/6, "Initial Angle"}, {0, \[Pi]/12, \[Pi]/6, \[Pi]/4, \[Pi]/3}},
]
The graphics code came from this, with minor variations.
time
is undefined. $\endgroup$