|
 |
 |
William
Scott Rickman
Math Fun
Pendulum: (Requirements: Trigonometry, DPGraph)
|
Weight:
1. We'll use the rectangular command in DPGraph. Its syntax is
rectangular(x,y,z)
where x,y,z are the coordinates of the points to plot.
2. Then, we'll use a spherical transformation. Spherical
coordinates are:
r=distance from origin
θ=horizontal angle from x-axis.
Ф=angle off z-axis.

It can be shown that the transformation to rectangular
coordinates are
x=r cos(θ) sin(Ф)
y=r sin(θ) sin(Ф)
z=r cos(Ф).
3. In DPGraph we have 2 parameters of U and V. We'll use U as θ,
and V as Ф. So U will run from 0 to 2π,and
V from 0 to π. Also, we'll
graph in a viewing box of -4 to 4 for x, y and z. So our setup
commands will be:
graph3d.box := true
graph3d.mesh := false
graph3d.view := front
graph3d.perspective := true
graph3d.resolution := 30
graph3d.highlight := 1
graph3d.shading := 0
graph3d.contrast := .5
graph3d.transparency := 0
graph3d.color := blue
graph3d.minimumx := -4
graph3d.maximumx :=4
graph3d.minimumy := -4
graph3d.maximumy := 4
graph3d.minimumz := -4
graph3d.maximumz := 4
GRAPH3D.STEPSU := 40
GRAPH3D.STEPSV := 40
GRAPH3D.MINIMUMU := 0
GRAPH3D.MAXIMUMU := 2*PI
GRAPH3D.MINIMUMV := 0
GRAPH3D.MAXIMUMV :=PI
4. Now putting the transformations into the rectangular command
using U and V for θ and Ф respectively. As for r, since I want
shape that is circular in the xz-plane but thin the y's
direction, I will use r=1 in the formulas for x and z, but r=0.2
for the formula for y. To help see the coordinates I'm going to
start breaking the command between coordinates.
graph3d((rectangular(
cos(U)*sin(V),
0.2*sin(U)*sin(V),
cos(V)))).
The Weight |
|
Line:
1. The pivot point for the pendulum will be at the point
(0,0,4). For now we'll just going to make the line to the
point(0,0,0). The equation z=start+(end-start)t will change the
z coordinate from a start value when t=0 to the end value when
t=1. Since I want z for go from 4 to 0 for now, the equation
becomes
z=4+(0-4)t
z=4-4t
For t, we'll use V/π
because
0<V<π
0<V/π<1
So we now need a second command of
rectangular(0,0,4-4*V/PI)
But if you try this you won't see the line since graph3d.mesh
:= false and
the line would have 0 thickness.
2. To give the line thickness, add cos(U)/40 to x and sin(U)/40
to y. So the full graphing command is
graph3d((
rectangular(
cos(U)*sin(V),
0.2*sin(U)*sin(V),
cos(V)),
rectangular(
cos(U)/40,
sin(U)/40,
4-4*V/PI)
)).
Note , the comma separating the rectangular commands.
The Weight and Line |
|
Sliding:
1. We need the pendulum to slow down at the ends of the swing
and accelerate to the center of the swing. Thus, cos(time) would
be good to control the movement. Since we need the swing to go
from x=-3 to x=3, we'll add 3*cos(time) to x in both rectangular
commands.
graph3d((
rectangular(
cos(U)*sin(V)+3*cos(time),
0.2*sin(U)*sin(V),
cos(V)),
rectangular(
cos(U)/40+3*cos(time),
sin(U)/40,
4-4*V/PI)
)).
The Sliding Weight and
Line |
|
Fixing the pivot point:
1. To fix the pivot point we need to have x go from 0 to 3*cos(time)
as z goes from 4 to 0. We use the same type of equation.
x=0+(3cos(time)-0)(V/π)
x=3cos(time)(V/π)
We only make this change for the line.
graph3d((
rectangular(
cos(U)*sin(V)+3*cos(time),
0.2*sin(U)*sin(V),
cos(V)),
rectangular(
cos(U)/40+3*cos(time)*V/PI,
sin(U)/40,
4-4*V/PI)
)).
Fixed Pivot Point |
|
Swinging:
1. Since a pendulum swings in an arc of a circle in the xz-plane
where the center is (0,0,4) and r=distance from (0,0,4) to
(0,0,-3)=7. Thus,
x2+(z-4)2=72
(z-4)2=49-x2
z-4=-(49-x2)0.5
z=4-(49-x2)0.5
Note, we took the negative square root since the weight would be
on the bottom of the circle.
Since,
x=3cos(time)
Thus,
z=4-(49-(3cos(time))2)0.5
z=4-(49-9cos2(time))0.5
This needs to be added to the z for the weight. For the line,
z=4+(4-(49-9cos2(time))0.5-4)(V/π)
z=4-(49-9cos2(time))0.5)(V/π).
Finally the command is
graph3d((
rectangular(
cos(U)*sin(V)+3*cos(time),
0.2*sin(U)*sin(V),
cos(V)+4-(49-9*cos(time)^2)^0.5),
rectangular(
cos(U)/40+3*cos(time)*V/PI,
sin(U)/40,
4-((49-9*cos(time)^2)^0.5)*V/PI)
)).
The Pendulum |
Last
Edited on
12/17/2009
EMAIL:rickmanw@seminolestate.edu
Take
Me Back
Rickman
Home
Seminole State
Math Student Website
Seminole State
Math Home
Seminole State
Home
Disclaimer
Copyright
2009
|