Assignment 1

Name:
Student #:

1 Displacement from acceleration

a)

The acceleration of an object moving along a track as a function of time is

a(t) = 3 (t^2) exp(- 7 t/13)   (m/s/s)

If the initial (t=0s) position of the object is 5m and the initial velocity is -7 m/s, find and plot the position of the object from t=0 to 10 s.  Include axes labels with units.
[First integrate the accelation to get the velocity as a function of time, then integrate the velocity to get the position.]

b)

When does the object come to rest (momentarily)?  What is its position at that time?

c)

The acceleration of another object moving along a track as a function of time is

a(t) = (t^2) cos((t^2)/20) exp(- 3 (t^1.5) /10)+2   (m/s/s)

If the initial (t=0s) position of the object is 5m and the initial velocity is -5 m/s, find and plot the position of the object from t=0 to 6 s.  Include axes labels with units.
[The simplest way to solve this problem is to cast it as an ODE.]

d)

When does the object come to rest (momentarily)?  What is its position at that time?  To answer this question, use the FindMinimum function.  Store the results in appropriately named variables.

2. Simple pendulum

Remove["Global`*"]

By considering the tangential component of the net force on the bob of a simle pendulum, one arrives at the following ODE for the simple pendulum,

θ''(t)=-(g/L)sin(θ)

Let us instead frame the problem in cartesian coordinates to show that we get the same result.  In the diagram above, the x-axis is horizontal and increasing to the right and the y-axis is vertical and increases upwards.  θ is the angle in between the downward vertical and the light pendulum string.

Calling T the tension in the string, what is the x-component of the tension force (pick the correct option)?

Tx:=T Sin[θ[t]]
Tx := T Cos[θ[t]]
Tx:=-T Sin[θ[t]]
Tx:=-T Cos[θ[t]]
(here we indicate θ as a function of t because we anticipate solving for θ(t) using NDSolve

The gravitational force has no x-component, so Newton’s 2nd law in the x-direction is,

eqx:=Tx Sin[θ[t]]==m x’’[t]
eqx:=Tx==m x’’[t]
eqx:=Tx==m x[t]

Execute the following

eqx

What is the y-component of the tension force?
Ty:=T Sin[θ[t]]
Ty:=T Cos[θ[t]]
Ty:=-T Sin[θ[t]]
Ty :=-T Cos[θ[t]]

The force law in the y-direction is then
eqy:=Ty Sin[θ[t]]==m y’’[t]
eqy:=Ty-m g Sin[θ[t]]==m y[t]
eqy:=Ty-m g==m y’’[t]

eqy

At this point we choose to eliminate T from the equations, using the function Eliminate.  We also divide through by m.

eqS1=Eliminate[{eqx,eqy},T]

and

eqS2=Assuming[m>0,Simplify[eqS1]]

The angle θ, length of the string L, x and y are related through trigonometry (notice that for angles between -90 and 90 degrees, y is negative)

x[t_]:=L Sin[θ[t]]
x[t_]:=L Cos[θ[t]]
x[t_]:=-L Sin[θ[t]]
x[t_]:=-L Cos[θ[t]]

y[t_]:=  ... Fill in with the aprpriate definition

You should get the following result.

eqPendulum=eqS2//Simplify

eqPendulum, if all is correct, should be the familiar equation for the pendulum.  Let’s solve it for a pendulum initially raised to the horizontal position and released form rest.

g=9.8;L=2;
sol=NDSolve[{eqPendulum,θ[0]==BLANK,θ’[0]==BLANK},θ[t],{t,0,20}]

And store the numerical solution in a function.

th[t_]=θ[t]/.sol[[1]]

Plot[th[t],{t,0,20}]

Now, instead of casting the problem in terms of θ, let us keep x and y.  We begin by clearing our definitions for x[t] and y[t].

x[t_]=.
y[t_]=.

We need to write cos(θ) and sin(θ) in terms of x, y and L when finding the x and y components of the tension force.

Tx :=(T/L)x[t]
Tx:=(T/L)y[t]
Tx:=-(T/L)x[t]
Tx:=-(T/L)y[t]

So our equation in the x-direction becomes

eqx

Similarly for the y-direction

Ty:=

eqy

Just as before, we choose to eliminate T from the equations.  (We could simply have written it as T[t] and let NDSolve find it.)

eqxy=Assuming[{m>0,L>0},Simplify[Eliminate[{eqx,eqy},T]]]

However, we need to constrain the trajectory to lie on the circular path.  We do this be writing (L^2)=(x^2)+(y^2) and demanding the second derivative of this expression equal zero.

eqc=D[x[t]^2+y[t]^2,{t,2}]==0

Now we solve the two equations, stored in eqxy and eqc, to find x[t] and y[t].  Again, the pendulum is initially horizontal and at rest.

We store the numerical solution expressed as replacement rules in functions for x and y.

{X[t_],Y[t_]}={x[t],y[t]}/.sol[[1]]

Plotting θ=atan(-x/y), we should obtain the same result as the one obtained earlier.

Plot[{ArcTan[-X[t]/Y[t]],th[t]},{t,0,20}]

3. Pendulum bob on a spring

Remove["Global`*"]

Consider a sort of pendulum consisting of a spring obeying Hooke’s Law of equilibrium length L with one end pivoted to the origin and the other attached to a bob of mass m.  The difference between this system and the simple pendulum is that the bob is no longer constrained to follow a circular path, and the “tension” in the spring is goverend by

T = k ( r - L),

where r is (Sqrt[(x^2)+(y^2)]) and k is the spring constant.  A negative value of T means that the spring is compressed and the spring force acts to extend the spring.  A positive value of T means that the spring is streched and the spring force acts to shorten the spring.

Solve for the trajectory of the bob for the first 20s.  The solution should be very similar to the Cartesian approach to the simple pendulum, only there is no constraint equation.

For this problem, use g=9.8, L=2, m=1, x(0)=2.2, y(0)=0 and k=100.  Compare your solution to the equivalent simple pendulum by plotting θ as a function of time.  

(As a check on your work, note that in the limit that k becomes large (a stiff spring) with x(0)=L, you should recover the simple pendulum.)

Here is some code to start you off.

r:=(Sqrt[x[t]^2+y[t]^2])

T:=k(r-L)

If X[t] and Y[t] are the coordinates of the bob and th[t] is the solution to the pendulum, the following code should animated the two systems.

Manipulate[ListPlot[{{{X[t],Y[t]}},{{L Sin[th[t]],-L Cos[th[t]]}}},PlotRange->{{-2.5,2.5},{-2.5,1}},PlotStyle->{{Blue,PointSize[0.03]},{Red,PointSize[0.03]}}],{t,0,20}]