Problem Solving with Mathematica

Introduction

In the last three lessons we have looked at some of the numerical, symbolic,
and visual aspects of Mathematica.  In this lesson we will bring all of these tools
to bear upon solving two representative problems.  Along the way we will
explore a few new aspects of Mathematica.

Keep in mind as we go along that the point of learning Mathematica is  not so we
can ``do'' Mathematica; it is so we can use Mathematica to solve problems.  Solving a
problem using Mathematica requires, above anything else, understanding the underlying
mathematics of the problem.  Otherwise, we cannot pose sensible questions to
Mathematica and we cannot interpret its answers.

Time Payment of Loans

In this section we will study the use of recurrence relations to define
functions.  Along the way we'll learn two new aspects of Mathematica: RSolve [ ]
for solving recurrence relations and  ``abstracting'' an
expression into a function.

We'll begin by studying these two new facets of Mathematica, and then we'll apply
them to the problem of computing time payments for loans.

Recurrence Relations

According to legend, the 19th century mathematician Gauss, when he was a
schoolboy, was asked by his teacher to add up all of the integers from 0 to
100.  The idea was to keep Gauss busy for a while, but he almost immediately
gave the correct answer of 5050.  Gauss had solved the problem not by doing the
obvious arithmetic, but by taking advantage of a clever insight into the
problem.  This and many similar problems involving integers can be tackled by
setting up and solving recurrence relations.

In a recurrence relation, we express the solution to a problem involving a
large integer in terms of the solution to the same problem involving a smaller
integer.  For example, suppose that we'd like to have a formula for the sum of
the first n integers.  Gauss was using just such a formula to calculate that
the sum of the first 100 integers is 5050.

The key insight is this: the sum of the first n integers is just n plus the
sum of the first n-1 integers.  In other words, if you want to know the sum
of the first 100 integers, just add up the first 99 integers and then add 100.
If S(n) stands for the sum of the first n integers, then

(1)  S(n) = n + S(n-1)

If you think carefully about this, though, you'll realize that this isn't all
that we need to say about the function S.  What is missing?

Click here for the answer

It won't do to always define S(n) in terms of S(n-1).  We need to supply an
ending point for the recurrence by giving the actual value of S for some
small integer.  In this case, it will do to say that:

(2) S(0) = 0

In other words, the sum of the first 0 integers is 0.  This is called the 
base case of the recurrence relation.

These equations (1) and (2) are all that we need to figure out a formula for
calculating the sum of the first n integers.  We can ask Mathematica to solve this
recurrence relation by using RSolve[ ] which comes with the 
DiscreteMath Package.

Needs["DiscreteMath`RSolve`"]

Now used the on-line documentation (or the printed documentation on the Mathematica Packages) to learn about using the function RSolve [].  For the case of Gauss's little problem we have:

sol=RSolve[{ s[n] == n +s[n-1] , 
s[0] == 0},s[n], n ]

What Mathematica prints out is a formula into which we can plug a value for n to
obtain the sum of the first n integers.  Before we experiment with the
formula, let's simplify it.  First, we extract the solution (we give the extracted part a new name since we want to use s[n] again later)

s1[n]=s[n]/. sol[[1]]

And now we ask Mathematica to simplify the solution.

Simplify[s1[n]]

Play around with the formula a bit before you continue by typing it in using
different values in place of n.  You should be able to confirm Gauss' answer
to his teacher's question.

If you think about what we've just done, you'll realize that the creative part
of the problem solving process was setting up the recurrence relation.  Once
we'd done that, Mathematica was able to do the rest of the work.

Try to come up with some recurrence relations of your own and get Mathematica to
solve them.  Here are two examples to try out.

Define r to be the sum of the squares of the first n integers.

Click here for the answer

r[0] == 0

r[n] == n^2 +r[n-1]

Now define t to be the sum of the first n powers of two.

Click here for answer

t[0] == 1

t[n] = 2^n + t[n-1]

Abstracting an Expression

Let's return to the original problem that we solved when studying recurrence
relations.  We began by solving this recurrence relation:

sol=RSolve[{ s[n] == n +s[n-1] , 
s[0] == 0},s[n], n ]

We then simplified the result.  This time, let's name the result of the
simplification so that we can use it later:

s1[n]=s[n]/. sol[[1]]

answer = Simplify[s1[n]]

If what we want is a function that will compute the sum of the first n
integers, what is unsatisfactory about our answer?

Click here for the answer.

What we have is an expression, not a function.  If we want to use
this expression to solve a particular problem---such as finding the sum of the
first 100 integers---we have to type it back in, using 100 in place of n.
This isn't too bad in the present case since the expression is so simple, but
it would be a major pain with a complicated formula.

Fortunately, Mathematica makes it easy  to transform an
expression into a function.  For example, if we want a function called
``sumOfInts'' to compute the sum of the first n integers, we need only do

sumOfInts[n_]=answer

The idea  is this.  If we have an expression containing
some variables, we can tell Mathematica  to create a function in which the
expression is the body and one or more of the variables are the arguments.  You
will shortly see an example in which we give more than one
variable as an argument.

Of course, we could have done without a function in this instance.  Instead,
we could have simply typed the entire function definition into Mathematica by hand.
Even though making a function is only a convenience, it is a very useful
convenience when we are trying to convert very complicated expressions into
functions.

Study this carefully and be sure you understand what this section does before
you continue.  Use the methods here to create functions to compute R and T
that you defined earlier.

Loans

It is common to take out loans that are repaid on a fixed-rate, fixed-term
repayment schedule.  For example, home mortgages are often paid off with thirty
years of monthly payments, while car loans are paid off over three or four
years.  A feature of such repayment schedules is that the same amount is paid
each month.  At the beginning, most of the payment goes for interest; by the
end, most of the payment is going toward principal.

Suppose that you borrow $100,000 at an annual interest rate of 7%, and you
are wondering what your monthly payment should be.  All you know is that your
monthly payment should be the same throughout the life of the loan, and that
your loan should be paid back at the end of 30 years.  Let's see how you can
use what you've just learned to analyze this problem.

Since we are trying to figure out what your monthly payment should be, let's
use the variable p to stand for it for the time being.  At the end of each
month you must pay 7/12% of the current loan balance in interest.  Clearly,
you and the bank want your monthly payment to be sufficient to at least cover
the interest each month.  Can you calculate a lower bound on the monthly
payment?

Click here for the answer

The first month the loan balance will be $100,000, so we must pay 7/12% of
this, or $583.33, in interest.  If this were our entire monthly payment, we
would never make any progress at paying off the loan.  Our monthly payment,
then, must be larger than this.

We can approach this problem by setting up a recurrence relation.  Let's let
B(i) be the loan balance at the end of the ith month of the loan.  For
example, B(0) will be the beginning loan balance and B(12) will be the loan
balance after one year.  The base case of the recurrence is easy, since we know
that the initial loan balance is $100,000:

B(0) = 100000

The other half of the recurrence relation requires more thought.  When you make
a monthly payment, part of it will go to pay for interest and the remainder
will go to bring down the loan balance.  Thus, the balance at the end of each
month will be the difference between

(1) the previous month's balance and

(2) the amount of principal that is included in this month's payment.

The amount of principal that is included in this month's payment will be equal
to the difference between the monthly payment and the amount of interest due on
last month's interest.  This is all easier to understand in symbols:

B(i) = B(i-1) - ( p - (.07/12)*B(i-1) )

Be sure that you understand where this equation comes from before continuing.

The formula given above is a difference equation.  It gives a
relationship for the balance at two different times and the
payment.  Rather than using specific numbers, let's try to solve the problem entirely in symbols.  What we would like to know is what the payment  has to
be to retire the loan of initial balance B  taken out at annual rate r in a period of 
T years.

There are several different approaches whch can be taken to this problem, 
but perhaps the simples way to is to solve the difference equation backwards. 
At time T, the loan is paid off so the balance is 0.  This
means that the balance at time T-1 must satisfy

0 = B(T-1)*(1+r) - p

so 

B(T-1) = p/(1+r)
 
Similarly, B(T-2) must satisfy

B(T-1)= p/(1+r) =B(T-2)*(1+r) - p

which means

B(T-2) = p/(1+r)*[ 1 + 1/(1+r) ] = p*[ 1/(1+r) +1/(1+r)^2 ] .

Continuing in this way,it is pretty easy to see the pattern
emering:

B(T-k) = p*Sum[  (1+r)^(-t), {t, 1, k} ]

Applying this formula to period 0 we have

B(0) = p* Sum[  (1+r)^(-t), {t, 1, T} ]
 
From this it follows immediately that the payment is 

p = B(0) / Sum[  (1+r)^(-t), {t, 1, T} ]
  
The sum in the denominator of this expression can be simplified.  It is an 
example of a ``geometric series'' and quite possibly you already know, say
from your calculus or precalculus classes, how it comes out.  But let's use 
another symbolic computation package from Mathematica's library to do the 
sum.

Needs["Algebra`SymbolicSum`"]

loads the needed package, and the command

SymbolicSum[(1+r)^(-t),{t,1,T}]

gives us the answer.  Thus, we are left with
 
p = B(0)*r/  ( 1 - (1+r)^(-T) )

That looks better.  Now what we really want is a function called 
payment that takes B, r, and T, as input and determines the payment for
us.  From the above this function is given by

payment[B_, r_, T_]:= B*r/  ( 1 - (1+r)^(-T) )

Let's check this function using an example (taken from a ``real life'' experience
of one of the authors).  You want to buy a house for $85,000 dollars, and will be putting
$9000 down.  You have negotiated with the bank for thirty year fixed rate mortgage
at an 8% annual rate.  What will your monthly payment be?  Click here for answer.

The initial balance is $85000 - $9000.  The interest rate r is the annual rate divided 
by the twelve months in a year, and the number of time periods T is given by 30 years 
times 12 months in a year, or 360 time periods.  Hence the monthly payment is

payment[85000-9000, .08/12, 360]

about $560.  You might want to play with this formula a bit more.  For 
example, using it you can see why people in the real estate industry worry about
rising interest rates affecting people's abilities to buy a home.  Recalcualte the payment 
above at annual interest rates of 9, 10, 11 and 12% and see how the payment changes. 

In the 80's there were times when  fixed rate mortgages hit as high as 18%.  See how much
bigger this makes the monthly payment!

Now that we have a function that determines the proper payment to retire a given
loan in a fixed period of time, we also want a function called balance 
that takes r and p as arguments  and computes monthly loan balances.  In the 
example above we found that

B(i) = B(i-1) - ( p - (.07/12)*B(i-1) ) 

and we can see how to generalize this pretty easily.  Each month the balance on the 
loan is equal to the old balance, plus the interest on the old balance, minus the payment
which has been made.

Using our rules of making Mathematica  functions and the equation above we can
write a general balance function for the ith loan period

balance[i_,p_,r_]:=(1+r)*balance[i-1,p,r] -  p

This function is somewhat unusual, in that it is defined in terms of itself, i.e., balance occurs on both sides of the definition. This is called a recursive function, and Mathematica will evaluate this function repeatedly (recursively) until it has a reason to stop. The only 
logical reason to stop is when you get to the initial balance, and so you must specify that 
as well.  For example, we could say

balance[0,p_,r_]:=1000

which says that the initial balance is $1000 regardless of what the interest rate or payment
is.  Let's return to our example above of a $100,000 loan at 7% annual interest.  That means
we set

balance[0 ,p_, r_]:= 100000

Now that we have our function we can do some interesting things with it.  But
first let's do some sanity checks to make sure that we haven't made a mistake
somewhere along the way.

For example, let's see what happens after one year if we make the
``break-even'' payment of $583.33 each month:

balance[12,583.33, .07/12]

The balance stays the same as we would expect.  

Here are some other checks that you should try.   What happens if we don't pay anything every month?  What about if we pay $2000 every month, how long does it take to pay the loan at $2000 per month?  

Click here for answer.

This is our first example of a root search problem.  Normally, Mathematica is very good
at solving such problems using its FindRoot function.  But the special nature of the balance function, which is a recursive function defined only for an integer number of months, makes this problem somewhat harder.  We will address this question in greater detail later in the course.

Instead, let's solve it graphically.  Start by making a table of the balance on the loan for 75 months, and then plot it using the ListPlot command.

That is

bal=Table[balance[i, 2000, .07/12],{i, 0, 75}];

ListPlot[bal];

We see that the graph crosses zero right at about 60 months, so at $2000 per month it takes almost exactly five years to pay off the loan.  Making a big table like this is somewhat inconvenient, if we make the payment just a little over the ``break even'' amount of 
$583.33 the table would have to be very large.

You'll be experimenting with the ideas in this section further in the homework
for this lesson.  If you are currently paying off a loan, it might be amusing
(and enlightening) to do some experimenting of your own right now!

Battleships

During the Battle of Leyte Gulf during World War II, the U.S. invaded the
Philippines, forcing a Japanese response.  Knowing that the U.S. had superior
naval power in the theater, the Japanese employed a series of decoys hoping to
draw the main U.S. force out of position.  Near the end of the third day of the
battle this strategy worked, and the U.S. Third Fleet was drawn nearly 100
miles out of position.

The Japanese fleet then launched an attack directly on the American invasion
force, which was protected by the U.S. Seventh Fleet.  The Seventh Fleet was
equipped to support a marine landing, not to engage in a heavy sea battle.  The
commander of the Seventh Fleet realized that his only chance to save the
invasion force was to delay the Japanese several hours until the Third Fleet
could return.  Lacking air support and heavy guns, he decided that his only
hope was to sacrifice his destroyers.

An order was given: ``Attack overwhelming forces with little probability of
survival.''

The guns of the U.S. destroyers were not powerful enough to be of any use
against the armor of the Japanese battleships.  Further, the destroyers could
withstand only one direct hit from the battleships' main guns, which fired
salvos of 3000-pound shells.  The only effective weapon that the destroyers had
were torpedos, but they could only be used an extremely close range.

By zigzagging erratically, the destroyers were able to close to within torpedo
range and fire all of their torpedos.  Although three out of the four
destroyers were sunk while retreating, the damage to the Japanese fleet was so
great that it was forced to withdraw.

The fact that speed and maneuverability could be so effectively utilized was
somewhat contrary to the conventional wisdom of the day.  It caused naval
architects to focus on these features for decades to come.

Parametric Curves

Our goal is to use Mathematica to help determine the amount of power required to
propel a highly-maneuverable, 5000-ton destroyer.  The question that we, and
any designer, must ask is ``how maneuverable?''  We will answer this question
by specifying a tight trajectory that we would like the destroyer to be able to
follow in the water, and then analyzing the amount of power required to follow
it.  We will specify this trajectory as a  parametric curve.

All of the plots that we have considered to this point have been alike in one
important respect.  In each of them, we have let some variable x range along
the horizontal axis, and some function f(x) range along the vertical axis.
The resulting curve has shown us how f(x) changes as  x varies within some
range.  This is probably the most familiar kind of two-dimensional plot.

In a parametric plot, we let some function f(t) range along the horizontal
axis, and we let some other function $g(t) range along the vertical axis.  We
the graph all of the x-y coordinates of the form (f(t), g(t)) as t ranges
through some set of values.  For example

ParametricPlot[ {Sin[t], Cos[t]} ,{t, -Pi, Pi}, 
AspectRatio-> 1];

is a parametric plot that produces a circle (without setting the Aspect Ratio to 1 it would have looked like an ellipse because of Mathematica's drawing conventions).  
What the graph tells us is that
as t ranges from -Pi to Pi, the points (sin(t), cos(t)) trace a unit
circle in the plane.  This, of course, is a consequence of a familiar
trigonometric identity.  Notice one key aspect of a parametric plot: the
parameter (in this case t) does not appear anywhere in the graph.

Look carefully at the Mathematica command that produces the parametric plot.  How
do the arguments to this Mathematica differ from a regular x-y plot?

Click here for the answer

To obtain a parametric plot, we must give Mathematica two functions and the range of
their parameter.  The functions  are enclosed in curly brackets, denoting an ordered pair.

Suppose that we want our destroyer to be able to start 100 meters to the right
of the origin and then trace the following parametrically-defined trajectory as
t ranges from 0 to 26.  We are measuring t in seconds and the x-y
coordinates in meters.  The x-coordinate of the destroyer's position at any
time tis given by the following function xpos.

xpos [ t_] := 
100.0467117 - 1.008227556*t - .0590081133*t^2 - .3203907381*t^3 +
.04967665410*t^4 - .003241565724*t^5 + .00009872376372*t^6 -
.000001144069263*t^7

The y-coordinate of the destroyer's position at any time t is given by the
following function ypos.

ypos[t_] :=  
.6252845748 + 26.50816256*t + 1.661930048*t^2 -
.5439457873*t^3 + .04827296491*t^4 - .002227053810*t^5 +
.00005087332227*t^6 - .0000004456469107*t^7

Let's begin by looking at the x and y positions of the destroyer individually,
which doesn't require a parametric plot.  First we'll look at how the y
position varies with time:

Plot[ypos[t], {t, 0, 26} , 
PlotLabel -> "Destroyer Vertical Trajectory"];

Now let's look at how the xpos position varies with time.  You'll need to
mentally turn this plot sideways, since the x position will be displayed on the
vertical axis!

Plot[xpos[t], {t, 0, 26} , 
PlotLabel -> "Destroyer Horizontal Trajectory"];

If we want to see the overall path of the destroyer through the x-y plane, we
need to use a parametric plot:

Click here for the answer

ParametricPlot[ {xpos[t], ypos[t] }, {t, 0, 26}, 
PlotLabel -> "Destroyer Trajectory"];

Although you can't tell this from the position plot, at time 0 the destroyer is
moving north at around 27 meters/second (60 miles/hour), and at time 26 it is
moving in the opposite direction at around 25 meters/second (56 miles/hour).
It manages to reverse course in a space of 200 meters.  This wouldn't be a very
fancy maneuver for an automobile, but for a 5000 ton destroyer it is quite a
feat!

Be sure that you understand the correlation between the three plots position
before continuing.

Lists

We now have functions {\tt xpos} and {\tt ypos} that parametrically specify the
x-y coordinates of our destroyer as a function of time.  If we want to know the
coordinates of the destroyer at some particular time, say $t = 5$, what do we
need to do?

Click here for the answer

We simply use Mathematica to calculate the values of xpos[5] and ypos[5].

It'd be convenient, though, to have a single function that would return
both parts of the coordinates of the destroyer at a particular time t.
This is easily accomplished in Mathematica by using a list.

In Mathematica, we can create a list of one or more values simply by enclosing them
in curly brackets and separating them with commas.  Once created, a list can
be treated as a single entity or can be decomposed into its individual
components.  For example, here is the list {20,30,40}.

{20,30,40}

We can name a list just like any other value:

numbers = {20,30,40}

Having done that, we can examine all three numbers in the list at once with

numbers

We can also access any of the members of the list by using subscripting.  For
example, let's extract the second element of the list:

numbers[[2]]

By taking advantage of lists, we can define a single function called 
position that takes a time t as an argument and returns the x-y position of
the destroyer at that time.

position [t_]:= {xpos[t], ypos[t]}

Look carefully at the function definition.  We have constructed the body so that
it returns a list of values.  The body of the function consists of two
expressions, separated by a comma and enclosed in square brackets.

Now if we want to know the position of the destroyer at time t=5, we simply
do:

position[5]

Since position[t] is a pair of expressions involving t (try it and
see), we can easily use position to produce a parametric plot:

ParametricPlot[position[t], {t, 0, 26}];

Not surprisingly, this is exactly what we obtained with our earlier parametric
plot of the destroyer's trajectory.

Differentiation

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]

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 describe the velocity of the destroyer by giving its velocity in the x
direction and its velocity in the y direction.  (In other words, since we are
giving the position of the destroyer as a vector, we can naturally give its
velocity as a vector as well.)

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.

Mathematica Summary

In this section we will summarize the new Mathematica commands that you've
encountered in this lesson.

RSolve is another of Mathematica's equation solving commands---this one will
solve recurrence relations.

ParametricPlot is a way of describing by curve by specifying the x
and y coordinates using separate functions of the same parameter.

Lists are a way of gluing several values into a single compound value.
Lists are handy, for example, when you'd like a function to return more than
one value, such as a pair of coordinates.

Homework

The following problems deal with the function payment that we derived
earlier in this lesson for computing time payments on a loan financed
at some annual interest.  For the sake of argument, let's assume the loan is
for $100,000 and that the annual interest rate is 7%.

(1) What should your monthly payment be if you want to pay off the loan in 30
years?

(2) What is the total amount of interest that you pay over the life of the loan
if you use the monthly payment calculated in part (1)?

(3) How long will it take to pay off the loan if you double the monthly payment
that you calculated in part (1)?  How much interest will you save this way?

(4) Prepare a graph showing how the loan balance declines over 30 years if you
choose either the monthly payment calculated in part (1) or used in part (3).
Put both curves on the same plot.  Use what you've learned about plotting to
label the plot sensibly.

The next two problems deal with a generalization of the loan problem.

(5) Derive a function called ``principal'' that takes four arguments: a
month number i, a starting loan amount P, an interest rate R, and a
monthly payment M.  principal[i, P, R, M] should give the outstanding
balance of a $P loan after i months, where the interest rate is R and
the monthly payment is M.  You'll need to repeat many of the steps of the
original derivation, using symbols instead of numbers.

(6) If you can get a loan at 6.5% interest, and you want to make monthly
payments of $800, what is the largest loan that you can pay off in 30 years?

We'll now return to the destroyer example by finishing up the calculation to
determine the power required for the destroyer to traverse the course that
we specified.  Here are the steps.

(7) Derive a function ``acceleration'' that takes time as an argument and
returns the x and y components of the destroyer's acceleration.  It will give
acceleration in meters/sec/sec.  Acceleration is the derivative of velocity in
the same way that velocity is the derivative of position.

(8) Derive a function ``force'' that takes time as an argument and returns
the x and y components of the force that must be placed upon the destroyer (by
its engines and by the water's drag) in order to produce the desired
acceleration.  To obtain the force function, you must multiply each component
of the acceleration by the mass of the destroyer, much as you took the
derivative of each component of the velocity.  The mass of the destroyer is
5000 tons, which you should convert to kilograms so that your resulting
function will express force in newtons.  (There are 2000 pounds in a ton, and
there are 2.2 pounds in a kilogram.)

(9) Once you have a force function, the following ``power'' function will
compute the power required to move the destroyer along the prescribed
trajectory.

power[t_]:=
Abs[(force[t] + velocity[t]*1100*speed[t]).velocity[t]]

(The number 1100. that appears in the formula is the destroyer's drag
coefficient, which is a measure of how the drag of the water affects the
destroyer's motion.)

The ``power'' function will return the power requirements in units of watts,
and will be a scalar function of t.  (It'll also be quite a forbidding
looking function---don't let it scare you!)  Plot the function to help find the
peak power required during the maneuver.  You don't need to hand in the plot,
but be sure to explain how you used to plot to find the peak power requirement.

(If you've done everything right, you'll find that the power at time t=2 is
approximately .955*10^8 watts, and the power at time t=20 is approximately
.161*10^9 watts.  It turns out that we're asking too much of our destroyer.  A
modern destroyer can generate a peak power of around 10^7 watts.)

(10) How many 6-cylinder Toyota pickup engines would be required to produce the
peak power?  (Each engine can produce 140 horsepower, and one horsepower equals
about 745.7 watts.)

Prepare a report giving the answers to these ten questions.  Be sure that your
report includes the question, your answer, and relevant portions of a Mathematica
transcript that supports your answers.  Please prepare a neat report---a
sloppy one won't impress anyone, least of all your TA.