In order to eventually calculate the power required for the destroyer to
traverse its trajectory, we must start by calculating its velocity at each
point along the trajectory curve. As you probably know from your physics
classes, we can obtain the velocity function by differentiating the position
function.
Before we do, let's see how differentiation works. To ask Mathematica to
differentiate an expression, we need only specify the expression and the
variable with respect to which the differentiation should be performed. For
example, we can differentiate a polynomial
D[2*x^3 - 3*x + 5, x]
2
-3 + 6 x
and we can differentiate trigonometric functions:
D[Cos[t]*Sin[t], t]
Now let's return to our destroyer problem. What we want is a function called
velocity that takes time as an argument and returns the velocity of the
destroyer at that time. Since we are describing the x and y coordinates of the
destroyer's position separately, what is the natural way to describe the
velocity of the destroyer?
Click here for the answer
We can obtain the x-velocity function by differentiating the x-position
function (which is just position[t] [[1]]), and the y-velocity function by
differentiating the y-position function (which is position[t] [[2]]). How
can we do these differentiations to obtain a list of the x-velocity and the
y-velocity?
Click here for the answer
We simply compose the two differentiations into a list:
D[{position[t] [[1]], position[t] [[2]]}, t ]
In fact, just like ParametricPlot, we can just pass the list itself (i.e. without specifying parts) straight to the differential function
D[position[t], t]
Now we have a list of the two derivatives. How can we turn this result into
the function velocity that we desire?
Click here for the answer
Just remember to set t to be the dependent variable in the assignment.
velocity[t_]= D[position[t], t];
Now you should be able to plot the velocity of the destroyer (in meters/sec) as
time ranges from 0 to 26. What you'll be seeing are how the x and y components
of the velocity vector vary with time, and you may not be used to that. You
might find it easier to interpret the speed, which is independent of the
direction of motion:
speed[t_]=Sqrt[ velocity[t][[1]]^2 + velocity[t][[2]]^2 ];
Try plotting speed as a function of time. Notice that this is not a
parametric plotting problem. Be sure that you understand why.