Lab 2  Problems of Physics Past

Name: 
Student number:

REMEMBER TO SAVE YOUR WORK FREQUENTLY!

Bicycle and Truck

A cyclist rides by a stationary truck just as the light turns green at t=0.  The truck's acceleration is given by a= 2 Exp(-t/10) while the velocity of the cyclist is given by v= 6 Exp(-(t^2)+t)+2.  All units are of the MKS system.

In this scenario, since all the functions given are explicit functions of time only, we can directly integrate to find displacement as a function of time.  Note that the initial position of each vehicles is zero, and so the displacement is equal to the position.   

Let's start with the bicycle.  Choose the best statement to determine the displacement as function of time.

db[t_]=(∫_0^t)(6Exp[-(k^2)+k]+2)dk
db[t_]=D[(6Exp[-(t^2)+t]+2),t]
db[t_]=∫(6Exp[-(t^2)+t]+2)dt

Remove["Global`*"]

Plot the displacement of the bicycle in blue for 5s.  Make sure to have appropriate units.  Make appropriate changes to the command below to do so.  At t=0, the displacement should be zero.  If not, you have likely made a mistake in the previous step.

p1=Plot[db[t], {t, 0, finaltime}, PlotStyle -> {Blue}, AxesLabel -> {"time [fortnights]", "displacement [furlongs]"}]

Instead of explicitly integrating the truck's acceleration twice to get its diplacement, let's use DSolve.  Pick the appropriate command.
xt[t_] = DSolve[{x''[t] == 2 Exp[-t/10], x[0] == 0, x'[0] == 0}, x[t], t];
xt[t_] = x[t] /. DSolve[{x''[t] == 2 Exp[-t/10], x[0] == 0, x'[0] == 0}, x[t], t][[1]]

Plot the truck's displacement in red for 5s.  Make sure to have appropriate units.  Make appropriate changes to the command below to do so.
p2=Plot[xt[t], {t, 0, finaltime}, PlotStyle -> {Red}, AxesLabel -> {"time [fortnights]", "displacement [furlongs]"}]

To show both displacement plots over top of one another, use
Show[p1, p2]

To find the time at which the truck overtakes the bicycle, we must use FindRoot as Solve won't work in this case.  Modify the following line appropriately
sol=FindRoot[xt[t] == db[t], {t, initialguess}]

We can find the velocity of the truck with the following replacement.
xt'[t] /. sol

Use a replacement involving “sol” to store the time in a variable called tovertake.

REMEMBER TO SAVE YOUR WORK FREQUENTLY!

Block through sticky stuff

Block 1 of mass m1=5kg lies on a table, and is connected by a non-elastic string running parallel to the table through a pulley to a second block of mass m2=1kg hanging vertically.  Block 1 is initially 1m from the edge when the blocks are released from rest.  The table is covered by sticky stuff which increases the coefficient as the block approaches the edge.  It is given by
μ(x)= (e^(-3 x))
The system with coordinates is shown below.

Remove["Global`*"]

In the following, choose the correct statements to carry out the task if more than one alternative is given.

Define the cofficient of friction
μ(x)=(e^(-3x))
μ[x_]:=Exp[-3 x]

Because of the geometrical setup of the system, the accelerations of the masses are equal in magnitude but point in different directions. Let's account for this formally by writing the length of the string in terms of x and y (x increases to the left and y increases upward, so y is negative for the hanging mass).  
L = x[t] - y[t]
L = x[t] + y[t]

To confirm the relationship between the accelerations of mass 1 and 2, we use the constraint that L does not change in time.  Indeed, its second derivative wrt t is also 0.  We need an equation that relates the accelerations
eqc = D[L, {t, 2}] == 0

I.e., if block 1 accelerates to the left (x'' positive), block 2 accelates up (y'' positive).  Here, instead of storing a number or an algebraic expression in a variable, we are storing an entire equation.

Forces on mass 1: the tension is pulling it to the right, decreasing x in our coordinate system, while friction opposes this.  Pick the appropriate equation.  Keep in mind that μ depends on x, which in turn depends on t.
eq1 = m1 x''[t] == -T + μ[x[t]] m1 g
eq1 = m1 x''[t] == -T + μ m1 g

Forces on mass 2 (pick the appropriate equation, keeping in mind the direction of the tension force)
eq2 = m2 y''[t] == -m2 g + T
eq2 = m2 y''[t] == -m2 g - T

At this point we have 3 equations and 3 unknown quantities, x(t), y(t) and T.  Now the tension is NOT constant, so perhaps we should have used T(t).  For this particular problem, the equations allow us to eliminate T fairly simply.  Also, y and x are simply related.  Therefore, let us solve for x''[t], eliminating T and y''[t] from the equations
sol = Solve[{eq1, eq2, eqc}, x''[t], {y''[t], T}] // Simplify // First

Notice that we have treated x''[t] and y''[t] as algebraic symbols, as is essentially done in first year constant acceleration physics problems.  Here, the acceleration in the x direction is given by the right hand side of the replacement rule.  To recast this as a differential equation for x(t), we'll use 

eqD = x''[t] == (x''[t] /. sol)

QUESTION: What would the equation be if there we no friction?

eqnNoFriction = x''[t] == FILL IN

SAVE YOUR WORK NOW

Let's try to solve the equation for our problem analytically.  If it seems to take too long, abort the evaluation by choosing "Abort Evaluation" from the Evaluation menu.
DSolve[{eqD, x[0] == 1, x'[0] == 0}, x[t], t]

We will have to solve this problem numerically, so we have to define our constants now.
g = 9.8;
m1 = 5;
m2 = 1;

And then use NDSolve to find our solution for 5 seconds
X[t] = x[t_] /. NDSolve[{eqD, x[0] == 1, x'[0] == 0}, x[t], {t, 0, 5}] // First
X[t_] = x[t] /. NDSolve[{eqD, x[0] == 1, x'[0] == 0}, x[t], {t, 0, 5}] // First

And plot our solution (it should look a little like a sin wave)
Plot[X[t], {t, 0, 5}, AxesLabel -> {"time [s]", "x [m]"}]

What does this mean?  It means that we haven't taken into account the fact that if Block 1 were to stop, our fricitonal force would still be pushing the block to the left, which is unphysical.  Our solution is only valid until either the block stops, or it reaches the edge.  In this case, it looks like it stops around 0.2 m away from the edge at around 1.5 s.  We can see this since the slope of the curve gives the velocity.

To more precisely determine when and where it stops, we must find the minimum in our X[t] curve, i.e. find the appropriate time when the derivative of X(t) is zero.

sol = FindRoot[X'[t], {t, 1.5}]
X[t] /. sol

Lab finished!  Include your name and student number at the top of the lab.  Save your work and submit via the P2820 DropBox on your desktop.