Numerical analysis

Algebra gives us exact answers to many problems, but we won't always have a convenient formula for the quantity we want. An equation may be difficult to solve explicitly, and a differential equation may tell us how a quantity changes without giving us a formula for its value. In either case, we can use the information we have to calculate an approximation. Numerical methods are one of the ways we put calculus to work in practice, turning equations into predictions we can use.
The method we choose affects how much calculation we do and how we check the answer. Sometimes we narrow down where an answer lies; other times, we use tangent lines to build a sequence of estimates. As we work, we'll consider how much accuracy the problem requires and what supports our confidence in the result.
By the end of this lesson, you should be able to:
- Derive and use Newton's Method to approximate a root, and check the accuracy of the resulting estimate.
- Use Euler's Method to approximate the solution of an initial value problem and investigate the effect of step size.
- Connect numerical algorithms to tangent lines and accumulation, and distinguish evidence of accuracy from a justified error bound.
When we studied the motion of a basketball, we neglected air resistance. For a tiny water droplet, the surrounding air has a much greater effect on how it falls. Suppose a droplet about \( 26\,\mu\text{m} \) across is released from rest in still air. A micrometer is one millionth of a meter: \( 1\,\mu\text{m}=10^{-6}\,\text{m} \).
For a droplet this small, we can model air resistance as proportional to its speed. This gives the following formula for the distance it has fallen:
\[s(t)=20t-40\qty(1-\ee^{-t/2}),\]
where \( s(t) \) is measured in micrometers and \( t \) in milliseconds. How long does it take the droplet to fall \( 100\,\mu\text{m} \)?
The time we want satisfies . We have a formula for distance, but finding this time means solving an equation that contains \( t \) both outside and inside an exponential. Let's use the formula to narrow down where the answer lies.
After \( 6\,\text{ms} \), the droplet has fallen \( s(6)\approx \)\( \,\mu\text{m} \). After \( 8\,\text{ms} \), it has fallen \( s(8)\approx \)\( \,\mu\text{m} \). These distances put our target between the two values.
The distance function is continuous, so the guarantees that it takes the value \( 100 \) at some time in \( [6,8] \). The graph suggests a crossing; the theorem gives us a reason to be sure the model has one.
We can improve this interval by testing its midpoint, \( t= \)\( \,\text{ms} \). Here \( s(7)\approx101.21\,\mu\text{m} \), so the droplet has already passed our target distance. The endpoint values still lie on opposite sides of \( 100 \) if we keep . Continuity guarantees a target crossing in this smaller interval as well.
Now test the midpoint of that interval. At \( 6.5\,\text{ms} \), the distance is about \( 91.55\,\mu\text{m} \), so we keep .
The midpoint for our next test is \( \,\text{ms} \). The distance there is about \( 96.37\,\mu\text{m} \), which tells us to keep . Each calculation halves the interval while keeping a crossing inside it.
Continuing in the same way gives the intervals below. Each row records the interval we keep after that many midpoint tests; the calculations use the full values of \( s(t) \) rather than rounded distances.
| Tests completed | Time interval (\( \text{ms} \)) |
|---|---|
| \( 3 \) | \( [6.75,7] \) |
| \( 4 \) | \( [6.875,7] \) |
| \( 5 \) | \( [6.9375,7] \) |
| \( 6 \) | \( [6.9375,6.96875] \) |
| \( 7 \) | \( [6.9375,6.953125] \) |
| \( 8 \) | \( [6.9375,6.9453125] \) |
| \( 9 \) | \( [6.9375,6.94140625] \) |
The last interval has width \( \,\text{ms} \). If we use its midpoint, \( 6.939453125\,\text{ms} \), as our estimate, the error is at most half that width, or \( \,\text{ms} \).
Every time in this interval rounds to \( 6.94\,\text{ms} \), so that is a sensible answer to report. We obtained it by repeated calculations, and the interval tells us how closely we've located the arrival time predicted by the model. Predicting the motion of a real droplet also depends on how well its size, the surrounding air, and our resistance model describe the situation.
Numerical methods
An approximation can make a calculation fast enough to use while keeping its error small enough for the task. In our work with tangent lines, we saw how replacing a function locally with a line could save work, especially when a calculation had to be repeated many times. Numerical analysis develops systematic methods for computing useful approximations and judging their accuracy.
As models become more complicated, an exact formula may be cumbersome to find or use, and some equations cannot be solved by algebraic means at all. Numerical methods let us work with those equations to predict what happens in the real world. We choose how much calculation to do based on the accuracy the problem requires, then check what evidence supports the answer.
We'll develop two kinds of approximations. When solving an equation, we improve our estimate of one input. When following a differential equation, we move from one input to another and estimate the solution along the way. In both cases, we turn the information in the equation into a calculation we can repeat.
Repeating a calculation in this way is called iteration. We'll write successive estimates as \( x_0,x_1,x_2,\ldots \), where the subscript counts how many updates we've made. Thus \( x_0 \) is our starting estimate, \( x_1 \) is the result of the first update, and so on.
Root-finding
To solve an equation numerically, we first move everything to one side so that we're looking for a root, an input where a function equals zero. For example, the droplet's arrival-time equation \( s(t)=100 \) becomes \( f(t)=0 \) if we define
\[f(t)=20t-40\qty(1-\ee^{-t/2})-100.\]
Subtracting \( 100 \) shifts the distance graph down by \( 100\,\mu\text{m} \), putting the target crossing on the horizontal axis. Thus a negative value of \( f(t) \) means the droplet has fallen less than \( 100\,\mu\text{m} \), and a positive value means it has fallen farther. In Explore, we began with one time of each kind and repeatedly tested the midpoint. Continuity guaranteed a crossing in the half whose endpoint values remained on opposite sides of zero.
Each halving retains a root while narrowing down its location. Repeating the process gives us the bisection method.
That guarantee makes the bisection method a dependable choice. Each step uses the sign of the function to decide which half to keep, but we also know how to calculate slopes. Could that extra information help us reach a close estimate in fewer steps? Using a tangent line to improve our estimate is the idea behind Newton's Method.
Suppose our current estimate is \( x_n \). We can calculate both the function value \( f(x_n) \) and the slope \( f'(x_n) \), so the tangent line at that point has equation
\[y=f(x_n)+f'(x_n)(x-x_n).\]
The line is easier to work with than the curve. To find its horizontal-axis crossing, set \( y=0 \) and solve for \( x \):
\[\begin{aligned}0&=f(x_n)+f'(x_n)(x-x_n)\\ -f(x_n)&=f'(x_n)(x-x_n)\\ x&=x_n-\frac{f(x_n)}{f'(x_n)}.\end{aligned}\]
We use this crossing as our next estimate, then draw a fresh tangent at the new input. Repeating this procedure lets each new estimate guide the next calculation.
The fraction tells us how far to move along the input axis. For the same slope, a larger \( |f(x_n)| \) calls for a larger correction, while for the same function value, a steeper slope brings the tangent to zero with a smaller change in the input. After each update, we recalculate both the function value and the slope at the new input.
The update in this example has a familiar arithmetic form: divide \( 2 \) by the current estimate, then average the result with that estimate. To approximate \( \sqrt A \) for \( A>0 \), start with a positive estimate and use
\[x_{n+1}=\frac12\qty(x_n+\frac{A}{x_n}).\]
This square-root procedure is known as the Babylonian method, or Heron's method. The averaging procedure predates calculus; Newton's Method connects it to tangent lines and extends the idea to many other equations.
A useful starting estimate places the tangent near the root we're trying to find. A graph or a pair of inputs with opposite function signs can help us locate that region. The starting estimate can affect the whole sequence, as this example shows.
The bisection method gives us a way forward here. The midpoint of \( [-2,-1] \) is \( -1.5 \), where \( f(-1.5)=1.625 \). Since this is positive and \( f(-2) \) is negative, we keep \( [-2,-1.5] \) and continue halving. The sign-changing interval keeps a root within reach even though the Newton estimates cycled.
Checking accuracy
To check an estimate, we substitute it into the equation we set out to solve. Suppose we report \( 1.4142 \) as our approximation to \( \sqrt2 \). With \( f(x)=x^2-2 \), we get
\[\begin{aligned}f(1.4142)&=(1.4142)^2-2\\&=-0.00003836.\end{aligned}\]
We call this value the residual. It tells us how far the square of our estimate is below \( 2 \). To find out how close the estimate itself is to \( \sqrt2 \), we need to relate a change in the output to a change in the input.
The Mean Value Theorem gives us that relationship. Write \( r=\sqrt2 \), so \( f(r)=0 \). Somewhere between \( 1.4142 \) and \( r \), there is an input \( c \) for which
\[f(1.4142)-f(r)=f'(c)(1.4142-r).\]
Both \( 1.4142 \) and \( r \) lie in \( [1,2] \), where \( f'(x)=2x\ge2 \). Taking absolute values and dividing by \( |f'(c)| \) therefore gives
\[\begin{aligned}|1.4142-r|&=\frac{|f(1.4142)|}{|f'(c)|}\\&\le\frac{0.00003836}{2}\\&=0.00001918.\end{aligned}\]
Thus the reported estimate is within \( 0.00001918 \) of the true square root. The slope bound has turned a check on the square into a bound on the error in the square root.
The same argument works whenever the magnitude of the slope stays above a positive number between an estimate and a root.
We can now compare the two root-finding methods using the same accuracy target: an error below \( 0.000001 \) in our approximation to \( \sqrt2 \). Starting with \( [1,2] \), the bisection method needs \( 19 \) halvings for its midpoint bound to meet that target:
\[\text{midpoint error}\le\frac{1}{2^{20}}\approx0.000000954.\]
Newton's Method reaches that target after three updates from \( x_0=1.5 \). For the reported estimate \( 1.414213562 \), the residual has magnitude less than \( 0.000000001056 \). Dividing by our slope bound of \( 2 \) gives an error below \( 0.000000000528 \).
Here Newton's Method saves several steps, although each step requires a derivative as well as a function value. How much work that saves depends on the function and the starting estimate. The bisection method offers steady progress whenever we have a continuous function and a sign-changing interval; Newton's Method can be much quicker, while its cycling example shows why we still need to check its progress.
An error bound also gives us a stopping rule. Once the residual is small enough to guarantee our desired accuracy, we can report the estimate. Keep extra digits during the iterations, then check the rounded value you intend to report, as we did for the square root.
Approximating solutions to differential equations
A differential equation gives us a different kind of starting information: a rate of change and a value at a known input. In Section 4.2, we used a slope field to see how a solution follows those rates. We can turn that picture into a calculation by following one direction for a short distance, finding the rate at our new point, and repeating.
Consider the equation from that slope-field discussion, with the initial condition
\[y'=x-y+1,\qquad y(0)=1.\]
At \( (0,1) \), the slope is \( 0-1+1=0 \). If we move \( 0.5 \) unit to the right along that horizontal direction, we reach \( (0.5,1) \). The equation gives slope \( 0.5-1+1=0.5 \) there, so we use that direction for the next step.
The blue curve bends as its slope changes, while each orange segment follows one slope for a whole step. Once we've taken the first step, the next slope comes from our estimated point. This gives us a way to keep calculating even though we don't yet know the exact solution values.
Write \( y=f(x) \) for the solution we want to approximate, and let \( y_n\approx f(x_n) \) be our current estimate. Substituting \( x=x_n \) and \( y=y_n \) into the differential equation gives an estimated rate, which we write as \( y'_n \). Multiplying by a step length \( \Delta x \) predicts the change in \( y \):
\[\Delta y\approx y'_n\Delta x.\]
Adding this predicted change to the current estimate gives the next estimate. This is Euler's Method (pronounced “OY-ler”).
Both inputs in the rate formula come from the beginning of the step. Once we've calculated \( y_{n+1} \), we move to \( x_{n+1}=x_n+\Delta x \) and use the new pair to calculate the following rate. Choose a step length that reaches the desired final input exactly, or shorten the final step to reach it.
Euler's Method also connects to accumulation. If the exact solution has a continuous derivative, the Fundamental Theorem of Calculus gives the change over a step:
\[f(x_{n+1})-f(x_n)=\int_{x_n}^{x_{n+1}}f'(x)\dd{x}.\]
Euler estimates this change by multiplying the rate calculated at our starting point by the step length. Shortening the step lets us recalculate the rate sooner. Each estimate also becomes the starting value for the next calculation, so an error in one step can influence the steps that follow.
Comparing step sizes
With Euler's Method, choosing a step size also means choosing how much calculation to do. To see what we gain from that work, let's repeat the calculation for \( y'=x-y+1 \) using smaller steps, always ending at \( x=1.5 \).
| Step length | Steps | Estimate of \( f(1.5) \) |
|---|---|---|
| \( 0.5 \) | \( 3 \) | \( 1.625000 \) |
| \( 0.25 \) | \( 6 \) | \( 1.677979 \) |
| \( 0.125 \) | \( 12 \) | \( 1.701417 \) |
| \( 0.0625 \) | \( 24 \) | \( 1.712476 \) |
Each halving of the step doubles the number of updates. The estimates are changing by smaller amounts, which suggests that the extra work is bringing us closer to a particular value.
For this example, we can check them against an exact solution. The function \( f(x)=x+\ee^{-x} \) has \( f(0)=1 \) and \( f'(x)=1-\ee^{-x} \). Substituting it into the right side of our differential equation gives
\[\begin{aligned}x-f(x)+1&=x-\qty(x+\ee^{-x})+1\\&=1-\ee^{-x}\\&=f'(x).\end{aligned}\]
Thus the formula satisfies both the equation and the initial condition. At \( x=1.5 \), it gives \( f(1.5)=1.5+\ee^{-1.5}\approx1.723130 \). The errors in the four table entries are about \( 0.09813 \), \( 0.04515 \), \( 0.02171 \), and \( 0.01065 \). For the smaller steps, halving the step roughly halves the error in this calculation.
When an exact formula is available, we can use it to assess a numerical method this way. For other differential equations, comparing calculations with smaller steps can still give us evidence about accuracy. A guaranteed error bound takes additional reasoning, just as the Mean Value Theorem turned a residual into a bound for root-finding.
We can also check whether the estimates agree with the behavior predicted by the differential equation. If we take too large a step, our estimates can behave very differently from the solution.
Numerical methods are often how we use calculus in practice. For a complicated model, calculating a useful approximation may be far more practical than finding an exact formula. A computer can carry out thousands of steps like the ones we've done here, allowing us to solve equations and follow changing quantities in much more detail. We choose the method and the accuracy the problem calls for, then use what we know about the mathematics and the model to decide whether the result is reliable.
A continuous function has opposite signs at the ends of \( [1,3] \). We repeatedly bisect the interval, keeping the half whose endpoints have opposite signs, and none of the tested midpoints is an exact root.
After \( ${n} \) steps of the bisection method, the interval has width . If we report its midpoint as our estimate, its distance to a root is at most .
Solution
We begin with a width of \( 2 \) and halve it at every step, so after \( ${n} \) steps the width is \( \displaystyle \frac{2}{2^{${n}}}=${width} \). Every point in the interval is within half that width of its midpoint, so the error is at most \( \displaystyle ${bound} \).
Which theorem guarantees that a root remains in every interval we keep? Explain why the bisection method still works when one of the tangents is horizontal.
Solution
The Intermediate Value Theorem guarantees a root between endpoints where a continuous function has opposite signs. Each retained interval has those properties, so it continues to contain a root. The bisection method uses signs and interval widths, so a horizontal tangent does not interrupt its calculation.
Use Newton's Method to approximate \( \sqrt[3]{${k}} \), starting with \( x_0=2 \). Keep extra digits while calculating, and report your estimates to six decimal places.
What equation should we solve? Use it to write the formula for the next estimate.
Solution
The cube root is the positive solution of \( x^3=${k} \), so we use \( f(x)=x^3-${k} \). Since \( f'(x)=3x^2 \), Newton's formula becomes
\[x_{n+1}=x_n-\frac{x_n^3-${k}}{3x_n^2}.\]
The first two estimates are \( x_1\approx \) and \( x_2\approx \). Explain how we use the tangent line to choose each new estimate.
Solution
Starting at \( x_0=2 \) gives
\[\begin{aligned}x_1&=2-\frac{8-${k}}{12}\\&\approx${x1_display},\\x_2&\approx${x2_display}.\end{aligned}\]
For the second calculation, we substitute the unrounded first estimate into the same formula. At each step, we draw the tangent to \( y=x^3-${k} \) at our current input, then use the point where that tangent crosses the horizontal axis as our next input.
We want to use Newton's Method to approximate the positive root of \( x^2-2=0 \).
What happens if we start at \( x_0=0 \)? Explain using both the update formula and the tangent line.
Solution
Here \( f(0)=-2 \) and \( f'(0)=0 \), so the update would require dividing \( -2 \) by zero. The tangent is the horizontal line \( y=-2 \), which never reaches the horizontal axis. We need a different starting input.
The tangent at the marked point stays below the horizontal axis, so it has no intercept to use as the next estimate. Starting instead at \( x_0=-1.5 \) gives estimates approaching \( -\sqrt2 \). Is that a successful answer to our original question? What would you change?
Solution
The estimates approach a root of the equation, but our question asks for the positive root. Starting at a positive input, such as \( x_0=1.5 \), directs this calculation toward \( \sqrt2 \). We can also establish that the desired root lies between \( 1 \) and \( 2 \), since the continuous function \( x^2-2 \) has opposite signs at those inputs.
Suppose \( r \) is a root of \( f \) and \( a \) is an estimate. The function is continuous on the interval between them, and its derivative exists at every interior point with \( |f'(x)|\ge${m} \). The residual has magnitude \( |f(a)|=${residual} \).
Use the Mean Value Theorem to show that \( |a-r|\le \).
Solution
Because \( f(r)=0 \), the Mean Value Theorem gives \( f(a)=f'(c)(a-r) \) for some input \( c \) between the estimate and the root. Taking absolute values and using the bound on the derivative, we obtain
\[\begin{aligned}|a-r|&=\frac{|f(a)|}{|f'(c)|}\\&\le\frac{${residual}}{${m}}\\&=${bound}.\end{aligned}\]
Now consider \( g(x)=10^{-6}(x-100) \). At \( x=0 \), compare the magnitude of the residual with the distance to the root. What does this example tell us about judging an estimate from its residual alone?
Solution
The root is \( 100 \), so the estimate \( 0 \) is \( 100 \) units away. Nevertheless, the residual has magnitude only \( |g(0)|=0.0001 \). Since the graph has the very small slope \( 10^{-6} \), a large horizontal distance produces a small vertical change. To translate the residual into a bound on the distance to the root, we need information about the slope as well.
Apply Newton's Method to \( f(x)=x^2 \), starting at a nonzero input.
Simplify the update formula. What happens to the distance from the root after each step?
Solution
Since \( f'(x)=2x \), the update simplifies to
\[\begin{aligned}x_{n+1}&=x_n-\frac{x_n^2}{2x_n}\\&=\frac{x_n}{2}.\end{aligned}\]
The root is \( 0 \), so halving the estimate also halves its distance from the root. Since we started with a nonzero input, repeated halving always gives another nonzero input, and we can continue using the update formula.
Starting at \( x_0=1 \), how many steps are needed to get within \( 0.001 \) of the root? Compare this with the improvement you saw when approximating a square root in Learn.
Solution
After \( n \) steps, the distance is \( \displaystyle \frac1{2^n} \). After nine steps it is about \( 0.001953 \), while after ten it is about \( 0.000977 \), so ten steps suffice. Each step halves the error. The square-root example improved much more quickly once its estimates were near the root; these two examples show that Newton's Method can make progress at different rates.
A substance decays according to \( y'=-2y \), where \( y \) is its mass in grams and \( t \) is time in hours. Initially there are \( ${a}\,\text{g} \).
Use Euler's Method with steps of \( 0.25\,\text{h} \). The first two mass estimates are \( y_1= \)\( \,\text{g} \) and \( y_2= \)\( \,\text{g} \). At what time does the second estimate apply?
Solution
We multiply each starting rate by the step length to estimate the change in mass:
\[\begin{aligned}y_1&=${a}+0.25(-2\cdot${a})\\&=${y1},\\y_2&=${y1}+0.25(-2\cdot${y1})\\&=${y2}.\end{aligned}\]
Two steps take us to \( t=0.5\,\text{h} \), so the estimated mass then is \( ${y2}\,\text{g} \).
Find the exact solution and compare its mass at \( t=0.5 \) with your estimate. Use the way the decay rate changes to explain whether Euler's Method has overestimated or underestimated the mass.
Solution
The solutions of this decay equation have the form \( y(t)=C\ee^{-2t} \). Substituting the initial mass gives \( y(t)=${a}\ee^{-2t} \), so the exact mass at \( t=0.5 \) is \( \displaystyle \frac{${a}}{\ee}\approx${exact_display} \) grams. The Euler estimate is smaller. As the mass decreases, the rate \( -2y \) becomes less negative; during each step, using the starting rate for the whole interval removes more mass than the exact solution loses. Over each quarter-hour the exact mass is multiplied by \( \ee^{-0.5}\approx0.606531 \), while the Euler calculation halves it, so the underestimate persists through both steps.
The smooth curve gives the exact mass. The two straight segments show the Euler steps, each beginning with the rate calculated from the current estimate.
For \( y'=t-y \) with \( y(0)=2 \), use two Euler steps of length \( 0.5 \) to estimate \( y(1) \).
The first step ends at \( t_1=0.5 \) with \( y_1= \). The second gives \( y(1)\approx \).
Solution
At \( (t_0,y_0)=(0,2) \), the slope is \( 0-2=-2 \), giving \( y_1=2+0.5(-2)=1 \). We then use the new starting point \( (0.5,1) \):
\[\begin{aligned}y_2&=1+0.5(0.5-1)\\&=0.75.\end{aligned}\]
Thus our estimate at \( t=1 \) is \( y(1)\approx0.75 \).
A student uses \( 1-y_1 \) as the slope for the second step. Explain the mistake.
Solution
The second step begins at time \( 0.5 \) and ends at time \( 1 \). Euler's Method uses the slope at the beginning of the step, where the time is \( 0.5 \) and the estimated value is \( y_1 \). The student's expression combines the ending time with the starting value.
Let's recover the distance formula used in Explore and compare two ways of calculating with the droplet model. Write \( v(t) \) for downward velocity in \( \mu\text{m/ms} \), where \( t \) is measured in milliseconds. Gravity speeds up the droplet while air resistance slows it down, giving the model
\[v'=10-0.5v,\qquad v(0)=0.\]
Use a calculator for the numerical work, retaining extra digits between steps.
Let \( w=20-v \). Show that \( w'=-0.5w \), then use the starting value to find \( w(t) \) and hence \( v(t) \). Antidifferentiate the velocity and use \( s(0)=0 \) to find the distance fallen.
Solution
Differentiating \( w=20-v \) gives
\[\begin{aligned}w'&=-v'\\&=-(10-0.5v)\\&=-0.5(20-v)\\&=-0.5w.\end{aligned}\]
This is the exponential-decay equation. Since the droplet starts at rest, \( w(0)=20 \), so \( w(t)=20\ee^{-t/2} \). Substituting into \( v=20-w \) gives
\[v(t)=20\qty(1-\ee^{-t/2}).\]
Since velocity is the derivative of distance, we can antidifferentiate to get
\[s(t)=20t+40\ee^{-t/2}+C.\]
At release, \( s(0)=40+C=0 \), so \( C=-40 \). Therefore
\[s(t)=20t-40\qty(1-\ee^{-t/2}),\]
which is the distance formula from Explore, in micrometers.
Use two Newton updates, starting at \( t_0=7 \), to estimate when the droplet has fallen \( 100\,\mu\text{m} \). Report the time to two decimal places. Use the bracket \( [6,8] \) and the bound \( s'(t)>19 \) on that interval to show that your reported time is within \( 0.01\,\text{ms} \) of the model's exact arrival time.
Solution
We solve \( f(t)=s(t)-100=0 \). Since \( f'(t)=v(t) \), Newton's update is
\[t_{n+1}=t_n-\frac{20t_n-40\qty(1-\ee^{-t_n/2})-100}{20\qty(1-\ee^{-t_n/2})}.\]
Starting at \( 7 \) gives \( t_1\approx6.937724681 \) and \( t_2\approx6.937694146 \), so we report \( 6.94\,\text{ms} \).
To check that reported value, we substitute it into the distance formula. The residual is \( f(6.94)\approx0.044681226\,\mu\text{m} \). Both our estimate and the arrival time \( r \) lie in \( [6,8] \), where the slope is greater than \( 19\,\mu\text{m/ms} \). The Mean Value Theorem bound therefore gives
\[\begin{aligned}|6.94-r|&\le\frac{|f(6.94)|}{19}\\&\lt0.002352\,\text{ms}.\end{aligned}\]
Our reported time therefore meets the requested accuracy of \( 0.01\,\text{ms} \): we used the velocity bound to turn the error in distance into a bound on the error in time.
Now use the velocity equation directly. Write its Euler update and calculate the first two estimates with \( \Delta t=0.5\,\text{ms} \). The table shows what we get by continuing to \( t=2\,\text{ms} \) with three different step sizes; velocities are in \( \mu\text{m/ms} \). Compare these estimates with the exact value from your formula. Which listed step size uses the fewest calculations while keeping the velocity error below \( 0.25\,\mu\text{m/ms} \)?
Step (\( \text{ms} \)) Steps \( v(2) \) \( 0.5 \) \( 4 \) \( 13.671875 \) \( 0.25 \) \( 8 \) \( 13.127822 \) \( 0.125 \) \( 16 \) \( 12.878517 \) Solution
At each step, we calculate the acceleration from our current velocity estimate. Multiplying by the time step estimates the change in velocity, which we add to the current estimate:
\[v_{n+1}=v_n+(10-0.5v_n)\Delta t.\]
With \( v_0=0 \) and \( \Delta t=0.5 \), the first two estimates are
\[\begin{aligned}v_1&=0+(10-0.5\cdot0)(0.5)\\&=5,\\v_2&=5+(10-0.5\cdot5)(0.5)\\&=8.75.\end{aligned}\]
These apply at \( 0.5\,\text{ms} \) and \( 1\,\text{ms} \), respectively. The exact velocity at \( 2\,\text{ms} \) is
\[v(2)=20\qty(1-\ee^{-1})\approx12.642411\,\mu\text{m/ms}.\]
The three table estimates have errors of about \( 1.029464 \), \( 0.485411 \), and \( 0.236106\,\mu\text{m/ms} \). Of the listed choices, only \( \Delta t=0.125\,\text{ms} \) meets the target, requiring \( 16 \) steps. Each halving of the step size doubles the number of calculations, while bringing the estimate closer to the exact value in this example.
The orange segments use steps of \( 0.5\,\text{ms} \); the blue curve gives the exact velocity. Both begin at rest, and the numerical estimate is above the exact value at the end of each step. Suppose an experiment needs the time when the droplet first falls \( 100\,\mu\text{m} \). Which numerical method would you use, and what accuracy check would you report? What would you want to measure about the actual droplet and its surroundings before claiming the same accuracy for the experiment?
Solution
With the distance formula available, Newton's Method finds the time quickly, and the residual bound checks the reported answer. The bisection method is also a reasonable choice: it keeps the arrival time inside an interval whose width gives us an error bound. We would report the chosen method, the time estimate, and the corresponding bound.
The physical prediction also depends on the droplet's size, whether it begins at rest, and the surrounding air, including any air motion. Measurements of those features help us judge how closely the model describes the experiment and how many reported digits are useful.