1.01: Introduction to Numerical Methods
- Page ID
- 126380
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Lesson 1: Why Numerical Methods?
Learning Objectives
After successful completion of this lesson, you should be able to:
1) Enumerate the need for numerical methods.
Introduction
Numerical methods are techniques to approximate mathematical processes (examples of mathematical processes are integrals, differential equations, nonlinear equations).
Approximations are needed because
1) we cannot solve the procedure analytically, such as the standard normal cumulative distribution function
\[\Phi(x) = \frac{1}{\sqrt{2\pi}}\int_{- \infty}^{x}e^{- t^{2}/2}{dt} \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.1}) \nonumber\]
or
2) the analytical method is intractable, such as solving a set of a thousand simultaneous linear equations for a thousand unknowns for finding forces in a truss (Figure \(\PageIndex{1.1}\)).
In the case of Equation (1), an exact solution is not available for \(\Phi(x)\) other than for \(x = 0\) and \(x \rightarrow \infty\). For other values of \(x\) where an exact solution is not available, one may solve the problem by using approximate techniques such as the left-hand Reimann sum you were introduced to in the Integral Calculus course.
In the truss problem, one can solve \(1000\) simultaneous linear equations for \(1000\) unknowns without using a calculator. One can use fractions, long divisions, and long multiplications to get the exact answer. But just the thought of such a task is laborious. The task may seem less laborious if we are allowed to use a calculator, but it would still fall under the category of an intractable, if not an impossible, problem. So, we need to find a numerical technique and convert it into a computer program that solves a set of \(n\) equations and \(n\) unknowns.
Again, what are numerical methods? They are techniques to solve a mathematical problem approximately. As we go through the course, you will see that numerical methods let us find solutions close to the exact one, and we can quantify the approximate error associated with the answer. After all, what good is an approximation without quantifying how good the approximation is?
Audiovisual Lecture
Title: Why Do We Need Numerical Methods
Summary: This video is an introduction to why we need numerical methods.
Lesson 2: Steps of Solving an Engineering Problem
Learning Objectives
After successful completion of this lesson, you should be able to:
1) go through the stages (problem description, mathematical modeling, solving and implementation) of solving a particular physical problem.
Introduction
Numerical methods are used by engineers and scientists to solve problems. However, numerical methods are just one step in solving an engineering problem. There are four steps for solving an engineering problem, as shown in Figure \(\PageIndex{2.1}\).
The first step is to describe the problem. The description would involve writing the background of the problem and the need for its solution. The second step is developing a mathematical model for the problem, and this could include the use of experiments or/and theory. The third step involves solving the mathematical model. The solution may consist of analytical or/and numerical means. The fourth step is implementing the solution to see if the problem is solved.
Let us see through an example of these four steps of solving an engineering problem.
Problem Description
To make the fulcrum (Figure \(\PageIndex{2.2}\)) of a bascule bridge, a long hollow steel shaft called the trunnion is shrunk-fit into a steel hub. The resulting steel trunnion-hub assembly is then shrunk-fit into the girder of the bridge.
The shrink-fitting is done by first immersing the trunnion in a cold medium such as a dry-ice/alcohol mixture. After the trunnion reaches the steady-state temperature, that is, the temperature of the cold medium, the outer diameter of the trunnion contracts. The trunnion is taken out of the medium and slid through the hole of the hub (Figure \(\PageIndex{2.3}\)).
When the trunnion heats up, it expands and creates an interference fit with the hub. In 1995, on one of the bridges in Florida, this assembly procedure did not work as designed. Before the trunnion could be inserted fully into the hub, the trunnion got stuck. Luckily, the trunnion was taken out before it got stuck permanently. Otherwise, a new trunnion and hub would need to be ordered at the cost of \(\$50,000\). Coupled with construction delays, the total loss could have been more than a hundred thousand dollars.
Why did the trunnion get stuck? Because the trunnion had not contracted enough to slide through the hole. Can you find out why this happened?
Simple Mathematical Model
A hollow trunnion of an outside diameter \(12.363^{\prime\prime}\) is to be fitted in a hub of inner diameter \(12.358^{\prime\prime}\). The trunnion was put in a dry ice/alcohol mixture (temperature of the fluid - dry-ice/alcohol mixture is \(- 108{^\circ}\text{F}\)) to contract the trunnion so that it can be slid through the hole of the hub. To slide the trunnion without sticking, a diametrical clearance of at least \(0.01^{\prime\prime}\) is required between the trunnion and the hub. Assuming the room temperature is \(80{^\circ}\text{F}\), is immersing the trunnion in a dry-ice/alcohol mixture a correct decision?
To calculate the contraction in the diameter of the trunnion, the thermal expansion coefficient at room temperature is used. In that case, the reduction \(\Delta D\) in the outer diameter of the trunnion is
\[\displaystyle\Delta D = D\alpha\Delta T \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.1}) \nonumber\]
where
\[D = \text{ outer diameter of the trunnion,} \nonumber\]
\[\alpha = \text{ coefficient of thermal expansion coefficient at room temperature, and} \nonumber\]
\[\Delta T = \text{change in temperature.} \nonumber\]
Solution to Simple Mathematical Model
Given
\[D = 12.363^{\prime\prime} \nonumber\]
\[\alpha = 6.47 \times 10^{-6}\ \text{in/in/}^{\circ}\text{F} \text{ at } 80{^\circ}\text{F} \nonumber\]
\[\displaystyle \begin{split} \Delta T&= T_{\text{fluid}} - T_{\text{room}}\\ &= - 108 - 80\\ &= - 188{^\circ}\ \text{F}\end{split} \nonumber\]
where
\[T_{\text{fluid}}= \text{ temperature of dry-ice/alcohol mixture} \nonumber\]
\[T_{\text{room}}= \text{ room temperature} \nonumber\]
the reduction in the outer diameter of the trunnion from Equation \((\PageIndex{2.1})\) hence is given by
\[\begin{split} \Delta D &= (12.363)\left( 6.47 \times 10^{- 6} \right)\left( - 188 \right)\\ &=- 0.01504^{\prime\prime} \end{split} \nonumber\]
So the trunnion is predicted to reduce in diameter by \(0.01504^{\prime\prime}\). But is this enough reduction in diameter? As per specifications, the trunnion diameter needs to change by
\[\begin{split} \Delta D &= -\text{trunnion outside diameter} + \text{hub inner diameter} - \text{diametric clearance}\\ &= -12.363 +12.358 - 0.01\\ &= - 0.015^{\prime\prime} \end{split} \nonumber\]
So, according to this calculation, immersing the steel trunnion in dry-ice/alcohol mixture gives the desired contraction of greater than \(0.015^{\prime\prime}\) as the predicted contraction is \(0.01504^{\prime\prime}\). But, when the steel trunnion was put in the hub, it got stuck. Why did this happen? Was our mathematical model adequate for this problem, or did we create a mathematical error?
Accurate Mathematical Model
As shown in Figure \(\PageIndex{2.4}\) and Table 1, the thermal expansion coefficient of steel decreases with temperature and is not constant over the range of temperature the trunnion goes through. Hence, Equation \((\PageIndex{2.1})\) would overestimate the thermal contraction.
he contraction in the diameter of the trunnion for which the thermal expansion coefficient varies as a function of temperature is given by
\[ \Delta D = D\int_{T_{\text{room}}}^{T_{\text{fluid}}} \alpha dT \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.2}) \nonumber\]
Solution to More Accurate Mathematical Model
So, one needs to curve fit the data to find the coefficient of thermal expansion as a function of temperature. This curve is found by regression where we best fit a function to the data given in Table 1. In this case, we may fit a second-order polynomial
\[\displaystyle\alpha = a_{0} + a_{1} T + a_{2} T^{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.3}) \nonumber\]
Temperature | Instantaneous Thermal Expansion |
---|---|
\({^\circ}\text{F}\) | \(\mu \text{in/in/}^{\circ}\text{F}\) |
\(80\) | \(6.47\) |
\(60\) | \(6.36\) |
\(40\) | \(6.24\) |
\(20\) | \(6.12\) |
\(0\) | \(6.00\) |
\(-20\) | \(5.86\) |
\(-40\) | \(5.72\) |
\(-60\) | \(5.58\) |
\(-80\) | \(5.43\) |
\(-100\) | \(5.28\) |
\(-120\) | \(5.09\) |
\(-140\) | \(4.91\) |
\(-160\) | \(4.72\) |
\(-180\) | \(4.52\) |
\(-200\) | \(4.30\) |
\(-220\) | \(4.08\) |
\(-240\) | \(3.83\) |
\(-260\) | \(3.58\) |
\(-280\) | \(3.33\) |
\(-300\) | \(3.07\) |
\(-320\) | \(2.76\) |
\(-340\) | \(2.45\) |
The values of the coefficients in the above Equation \((\PageIndex{2.3})\) will be found by polynomial regression (we will learn how to do this later in the chapter on Nonlinear Regression). At this point, we are just going to give you these values, and they are
\[\begin{bmatrix} a_{0} \\ a_{1} \\ a_{2} \\ \end{bmatrix} = \begin{bmatrix} 6.0150 \times 10^{- 6} \\ 6.1946 \times 10^{- 9} \\ - 1.2278 \times 10^{- 11} \\ \end{bmatrix} \nonumber\]
to give the polynomial regression model (Figure \(\PageIndex{2.5}\)) as
\[\displaystyle \begin{split} \alpha &= a_{0} + a_{1}T + a_{2}T^{2}\\ &= {6.0150} \times {1}{0}^{- 6} + {6.1946} \times {10}^{- 9}T - {1.2278} \times {10}^{- {11}}T^{2} \end{split} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.4}) \nonumber\]
Knowing the values of \(a_{0}\), \(a_{1}\), and \(a_{2}\), we can then find the contraction in the trunnion diameter from Equations \((\PageIndex{2.2})\) and \((\PageIndex{2.3})\) as
\[\begin{split} \displaystyle\Delta D &= D\int_{T_{\text{room}}}^{T_{\text{fluid}}}{(a_{0} + a_{1}T + a_{2}T^{2}}){dT}\\ &= D\left\lbrack a_{0}T + a_{1}\frac{T^{2}}{2} + a_{2}\frac{T^{3}}{3} \right\rbrack\begin{matrix} T_{\text{fluid}} \\ \\ T_{\text{room}} \\ \end{matrix}\\ &= D\lbrack a_{0}(T_{\text{fluid}} - T_{\text{room}}) + a_{1}\frac{({T_{\text{fluid}}}^{2} - {T_{\text{room}}}^{2})}{2}\\ & \ \ \ \ \ + a_{2}\frac{({T_{\text{fluid}}}^{3} - {T_{\text{room}}}^{3})}{3}\rbrack\;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{2.5}) \end{split} \nonumber\]
Substituting the values of the variables gives
\[\displaystyle \begin{split} \Delta D &= 12.363\begin{bmatrix} 6.0150 \times 10^{- 6} \times ( - 108 - 80) \\ + 6.1946 \times 10^{- 9}\displaystyle \frac{\left( ( - 108)^{2} - (80)^{2} \right)}{2} \\ - 1.2278 \times 10^{- 11}\displaystyle \frac{(( - 108)^{3} - (80)^{3})}{3} \\ \end{bmatrix}\\ &= - 0.013689^{\prime\prime}\end{split} \nonumber\]
What do we find here? The contraction in the trunnion is not enough to meet the required specification of \(0.015^{\prime\prime}\).
Implementing the Solution
Although we were able to find out why the trunnion got stuck in the hub, we still need to find and implement a solution. What if the trunnion were immersed in a medium that was cooler than the dry-ice/alcohol mixture of \(- 108{^\circ}F\) , say liquid nitrogen, which has a boiling temperature of \(- 321{^\circ}F\)? Will that be enough for the specified contraction in the trunnion?
As given in Equation \((\PageIndex{2.5})\)
\[\displaystyle \begin{split} \Delta D &= D\int_{T_{\text{room}}}^{T_{\text{fluid}}}{(a_{0} + a_{1}T + a_{2}T^{2}}){dT}\\ &= D\left\lbrack a_{0}T + a_{1}\frac{T^{2}}{2} + a_{2}\frac{T^{3}}{3} \right\rbrack\begin{matrix} T_{\text{fluid}} \\ \\ T_{\text{room}} \\ \end{matrix}\\ &= D\lbrack a_{0}(T_{\text{fluid}} - T_{\text{room}}) + a_{1}\frac{({T_{\text{fluid}}}^{2} - {T_{\text{room}}}^{2})}{2}\\ & \ \ \ \ \ + a_{2}\frac{({T_{\text{fluid}}}^{3} - {T_{\text{room}}}^{3})}{3}\rbrack\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.5}-repeated) \end{split} \nonumber\]
which gives
\[\displaystyle \begin{split} \Delta D &= 12.363\begin{bmatrix} 6.0150 \times 10^{- 6} \times ( - 321 - 80) \\ + 6.1946 \times 10^{- 9} \displaystyle\frac{\left( ( - 321)^{2} - (80)^{2} \right)}{2} \\ \ - 1.2278 \times 10^{- 11} \displaystyle\frac{(( - 321)^{3} - (80)^{3})}{3} \\ \end{bmatrix}\\ & \\ &= - 0.024420^{\prime\prime} \end{split} \nonumber\]
The magnitude of this contraction is larger than the specified value of \(0.015^{\prime\prime}\).
So here are some questions that you may want to ask yourself later in the course.
1) What if the trunnion were immersed in liquid nitrogen (boiling temperature\(= - 321{^\circ}\text{F}\))? Will that cause enough contraction in the trunnion?
2) Rather than regressing the thermal expansion coefficient data to a second-order polynomial so that one can find the contraction in the trunnion OD, how would you use the trapezoidal rule of integration for unequal segments?
3) What is the relative difference between the two results?
4) We chose a second-order polynomial for regression. Would a different order polynomial be a better choice for regression? Is there an optimum order of polynomial we could use?
Audiovisual Lecture
Title: Steps of Solving Engineering Problems
Summary: This video teaches you the steps of solving an engineering problem- define the problem, model the problem, solve, and implementation of the solution.
Lesson 3: Overview of Mathematical Processes Covered in This Course
Learning Objectives
After successful completion of this lesson, you should be able to:
1) enumerate the seven mathematical processes for which numerical methods are used.
Introduction
Numerical methods are techniques to approximate mathematical processes. This introductory numerical methods course will develop and apply numerical techniques for the following mathematical processes:
1) Roots of Nonlinear Equations
2) Simultaneous Linear Equations
3) Curve Fitting via Interpolation
4) Differentiation
5) Curve Fitting via Regression
6) Numerical Integration
7) Ordinary Differential Equations.
Some undergraduate courses in numerical methods may include topics of partial differential equations, optimization, and fast Fourier transforms as well.
Roots of a Nonlinear Equation
The ubiquitous formula
\[ x = \frac{- b \pm \sqrt{b^2 - 4ac}}{2a} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.1}) \nonumber\]
of finding the roots of a quadratic equation \(\displaystyle ax^{2} + bx + c = 0\) goes back to the ancient world. But in the real world, we get equations that are not just the quadratic ones. They can be polynomial equations of a higher order and transcendental equations.
Take an example of a floating ball shown in Figure \(\PageIndex{3.1}\), where you are asked to find the depth to which the ball will get submerged when floating in the water.
Assume that the ball has a density of \(600\ \text{kg}/\text{m}^{3}\) and has a radius of \(0.055\ \text{m}\). On applying the Newtons laws of motion and hence equating the weight of the ball to the buoyancy force, one finds that the depth, \(x\) in meters, to which the ball is underwater and is given by
\[\displaystyle 3.993 \times 10^{- 4} - 0.165x^{2} + x^{3} = 0 \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2}) \nonumber\]
Equation \((\PageIndex{3.2})\) is a cubic equation that you will need to solve. The equation will have three roots, and the root that is between \(0\ \text{m}\) (just touching the water surface) and \(0.11\ \text{m}\) (almost submerged) would be the depth to which the ball is submerged. The two other roots would be physically unacceptable. Note that a cubic equation with real coefficients can have a set of one real root and two complex roots or a set of three real roots. You may wonder, why could such an application be important? Let’s suppose you are filling in this tank with water, and you are using this ball as a control so that when the ball goes all the way to the top that the flow of the water stops – say in a fish tank that needs replenishing while the owner is away for a few weeks. So, we do need to figure out how much of the ball is submerged underwater.
A cubic equation can be solved exactly by radicals, but it is a tedious process. The same is true but even more complicated for a general fourth-order polynomial equation as well. However, there is no closed-form solution available for a general polynomial equation of fifth-order or more. So, one has to resort to numerical techniques to solve polynomial and other transcendental nonlinear equations (e.g., finding the nonzero roots of \(\tan x = x\)).
Simultaneous Linear Equations
Ever since you were exposed to algebra, you have been solving simultaneous linear equations.
Take this problem statement as an example. Suppose the upward velocity of a rocket (Figure \(\PageIndex{3.2}\)) is given at three different times (Table \(\PageIndex{3.1}\)).
Time, \(t\) \((\text{s})\) |
Velocity, \(v\) \((\text{m}/\text{s})\) |
---|---|
\(5\) | \(106.8\) |
\(8\) | \(177.2\) |
\(12\) | \(600.0\) |
The velocity data is approximated by a polynomial as
\[\displaystyle v\left( t \right) = at^{2} + {bt} + c\ {, 5} \leq t \leq {12}.\;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{3.3}) \nonumber\]
To estimate the velocity at a time that is not given to us, we can set up the equations to find the coefficients \(a,b,c\) of the velocity profile.
The polynomial in Equation (3) is going through three data points \(\left( t_{1},v_{1} \right),\left( t_{2},v_{2} \right),\) and \(\left( t_{3},v_{3} \right)\) where from Table 1.1.3.1
\[\begin{split} t_{1} &= 5,v_{1} = 106.8\\ t_{2} &= 8,v_{2} = 177.2\\ t_{3} &= 12,v_{3} = 600.0 \end{split} \nonumber\]
Requiring that \(v\left( t \right) = at^{2} + bt + c\) passes through the three data points, gives
\[\begin{split} v\left( t_{1} \right) &= v_{1} = at_{1}^{2} + bt_{1} + c\\ v\left( t_{2} \right) &= v_{2} = at_{2}^{2} + bt_{2} + c\\ v\left( t_{3} \right) &= v_{3} = at_{3}^{2} + bt_{3} + c \end{split} \nonumber\]
Substituting the data \(\left( t_{1},\ v_{1} \right),\ \left( t_{2},\ v_{2} \right),\) and \(\left( t_{3},\ v_{3} \right)\) gives
\[\begin{split} a\left( 5^{2} \right) + b\left( 5 \right) + c = 106.8 \\ a\left( 8^{2} \right) + b\left( 8 \right) + c = 177.2 \\ a\left( 12^{2} \right) + b\left( 12 \right) + c = 600.0 \end{split} \nonumber\]
Or
\[\begin{split} 25a + 5b + c = 106.8 \\ 64a + 8b + c = 177.2 \\ 144a + 12b + c = 600.0 \end{split} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.4}) \nonumber\]
Solving a few simultaneous linear equations such as the above set can be done without the knowledge of numerical techniques. However, imagine that instead of three given points, you were given 10 data points. Now the setting up as well as solving the set of 10 simultaneous linear equations without numerical techniques becomes laborious, if not impossible.
Curve Fitting by Interpolation
Interpolation involves that given a function as a set of data points. How does one find the value of the function at points that are not given?. For this, we choose a function, called an interpolant, and make it pass through all the points involved.
You may think that you have already used interpolation in courses such as Thermodynamics and Statistics. After all, it was just taking two points from a table at the back of the textbook or online and finding the value of the function at a point in between by using a straight line.
Take this problem statement as an example. Let’s suppose the upward velocity of a rocket is given at three different times (Table 1.1.3.1).
If one asked you to estimate the velocity at \(7\ \text{s}\), one might simply use the straight-line formula you are most accustomed to as given below.
Given (\(t_{1},\ v_{1}\)) and (\(t_{2},\ v_{2}\)), the value of the function \(v\) at \(t\) is given by
\[\displaystyle v = v_{1} + \frac{v_{2} - v_{1}}{t_{2} - t_{1}}(t - t_{1}) \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.5}) \nonumber\]
Although this is possibly enough for courses such as Thermodynamics and Statistics, there are two questions to ask. Is the value calculated accurately, and how accurate is it? To know that, one needs to calculate at least more than one value. In the above example of a rocket velocity vs. time, one can instead use a second-order polynomial interpolant and set up the three equations and three unknowns to find the unknown coefficients, \(a\), \(b\), and \(c\) as given in the previous section.
\[v\left( t \right) = at^{2} + {bt} + c{ ,\ 5} \leq t \leq {12}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.6}) \nonumber\]
Then, the resulting second-order polynomial can be used to find the velocity at \(t = 7\ \text{s}\).
The value obtained from the second-order polynomial (Equation \((\PageIndex{3.6})\)) can be considered to be a new measure of the value of \(v( 7)\), and the first-order polynomial (Equation \((\PageIndex{3.5})\)) result can be used to determine the accuracy of the results.
Numerical Differentiation
You have taken a semester-long course in Differential Calculus, where you found derivatives of continuous functions. So let’s suppose somebody gives you the velocity of a rocket as a continuous and at least once differentiable function of time and wants you to find acceleration. Indeed for this particular problem, you can use your differential calculus knowledge to differentiate the velocity function to get the acceleration and put in the value of time, \(t = 7\ \text{s}\). What if the velocity vs. time is not given as a continuous and at least once differentiable function? Instead, let’s say the function is given at discrete data points (Table 1.1.3.1). How are you then going to find out what the acceleration at \(t = 7\ \text{s}\)? Do we draw a straight line from \((5,106.8)\) to \((8,177.2)\) and use the straight-line slope as the estimate of acceleration? How do we know that this is adequate? We could incorporate all three points and find a second-order polynomial as given by Equation \((\PageIndex{3.6})\). This polynomial can now be differentiated to estimate the acceleration at \(t = 7\ \text{s}\). Now the two values can be used to evaluate the accuracy of the calculated acceleration.
Curve Fitting by Regression
When we talked about curve fitting by interpolation, the chosen interpolant needs to go through all the points considered. What happens when we are given many data points, and we instead want a simplified formula to explain the relationship between two variables. See, for example, in Figure \(\PageIndex{3.4a}\), we are given the coefficient of linear thermal expansion data for cast steel as a function of temperature. Looking at the data, one may proclaim that a straight line could explain the data, and that is drawn in Figure \(\PageIndex{3.4b}\). How we draw this straight line is what is called regression. It would be based on minimizing some form of the residuals between what is observed (given data points) and what is predicted (straight line). It does not mean that every time you have data given to you, you draw a straight line. It is possible that a second-order polynomial or a transcendental function other than the first-order polynomial will be a better representation of this particular data. So these are the questions that we will answer when we discuss regression. We will also discuss the adequacy of linear regression models.
Numerical Integration
You have taken a whole course on integral calculus. Now, why would we need to make numerical approximations of integrals? Just like the standard normal cumulative distribution function
\[\displaystyle\Phi(x) = \frac{1}{\sqrt{2\pi}}\int_{- \infty}^{x}e^{- t^{2}/2}{dt} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.7}) \nonumber\]
cannot be solved exactly, or when the integrand values are given at discrete data points, we need to use numerical methods of integration.
In the previous lesson, we looked at the example of contracting the diameter of a trunnion for a bascule bridge fulcrum assembly by dipping it in a mixture of dry ice and alcohol. The contraction is given by
\[\Delta D = D\int_{T_{\text{room}}}^{T_{\text{fluid}}}{\alpha\ dT} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.8}) \nonumber\]
where
\[D = \text{outer diameter of the trunnion,} \nonumber\]
\[\alpha = \text{coefficient of linear thermal expansion that is varying with temperature} \nonumber\]
\[T_{\text{room}}= \text{room temperature} \nonumber\]
\[T_{\text{fluid}}= \text{temperature of dry-ice alcohol mixture.} \nonumber\]
From Figure \(\PageIndex{3.4a}\), one can note that the coefficient of thermal expansion is only given at discrete temperatures and not as a known continuous function that could be integrated exactly. So we have to resort to numerical methods by approximating the data, say, by a second-order polynomial obtained via regression.
In Figure \(\PageIndex{3.6}\), the thermal expansion coefficient of typical cast steel is approximated by a second-order regression polynomial as given by Equation \((\PageIndex{3.9}\)) (how we get this is a later lesson in regression) as
\[\displaystyle\alpha = - 1.2278 \times 10^{- 11}T^{2} + 6.1946 \times 10^{- 9}T + 6.0150 \times 10^{- 6} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.9}) \nonumber\]
The contraction of the diameter then is given by
\[\displaystyle\Delta D = D\int_{T_{\text{room}}}^{T_{\text{fluid}}}{\left( - 1.2278 \times 10^{- 11}T^{2} + 6.1946 \times 10^{- 9}T + 6.015 \times 10^{- 6} \right){dT}} \;\;\;\;\;\;\;\; (\PageIndex{3.10}) \nonumber\]
and can now be calculated using integral calculus.
Numerical Solution of Ordinary Differential Equations
Taking the same example of the trunnion being dipped in a dry-ice/alcohol mixture, one could ask the question - What would the temperature of the trunnion be after dipping it in the mixture for 30 minutes? The model is given by an ordinary differential equation for the temperature \(\theta\) as a function of time, \({t.}\)
\[\displaystyle -{hA} \left(\theta - \theta_{a} \right) = {mC} \frac{d \theta}{dt}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.11}) \nonumber\]
where
\[h= \text{the convective cooling coefficient,}\ \text{W/m}^{2} \cdot \text{K} \nonumber\]
\[A = \text{surface area},\ \text{m}^2 \nonumber\]
\[\theta_{a} = \text{ambient temperature of dry-ice/alcohol mixture},\ \text{K} \nonumber\]
\[m = \text{mass of the trunnion, kg} \nonumber\]
\[C = \text{specific heat of the trunnion,}\ \text{J/(kg} \cdot \text{K)} \nonumber\]
The differential Equation \((\PageIndex{3.11})\) can be solved exactly by using the classical solution, Laplace transform, or separation of variables techniques. So, where do numerical methods enter into the picture for this problem? For the temperature range of room temperatures to cold media such as dry-ice/alcohol, several of the variables in Equation \((\PageIndex{3.11})\) are not constant but change with the temperature. These include the convection coefficient \(h\) as well as the specific heat \(C\). Now, this differential equation has turned nonlinear as follows.
\[\displaystyle -h(\theta)A\left( \theta - \theta_{a} \right) = mC(\theta)\frac{d \theta}{dt} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.12}) \nonumber\]
The ordinary differential Equation \((\PageIndex{3.12})\) cannot be solved by exact methods and would need to be solved by a numerical method.
In the above discussion, we have illustrated the need for numerical methods for each of the seven mathematical processes in the course. In the lessons to follow, we will be developing various numerical techniques to approximate the mathematical processes to calculate acceptable accurate values while calculating associated errors.
Audiovisual Lecture
Title: Overview of Mathematical Processes Covered in This Course
Summary: This lecture shows you four mathematical procedures that need numerical methods - namely, nonlinear equations, differentiation, simultaneous linear equations, and interpolation.
Multiple Choice Test
(1). Solving an engineering problem requires four steps. In order of sequence, the four steps are
(A) formulate, model, solve, implement
(B) formulate, solve, model, implement
(C) formulate, model, implement, solve
(D) model, formulate, implement, solve
(2). One of the roots of the equation \(x^{3} - 3x^{2} + x - 3 = 0\) is
(A) \(-1\)
(B) \(1\)
(C) \(\sqrt{3}\)
(D) \(3\)
(3). The solution to the set of equations
\[\begin{split} 25a + b + c &= 25 \\ 64a + 8b + c &= 71\\ 144a + 12b + c &= 155 \end{split} \nonumber\]
most nearly is \(\left( a,b,c \right) =\)
(A) \((1,1,1)\)
(B) \((1,-1,1)\)
(C) \((1,1,-1)\)
(D) does not have a unique solution.
(4). The exact integral of \(\displaystyle \int_{0}^{\frac{\pi}{4}} 2 \cos 2x \ dx\) is most nearly
(A) \(-1.000\)
(B) \(1.000\)
(C) \(0.000\)
(D) \(2.000\)
(5). The value of \(\displaystyle \frac{dy}{dx}\left( 1.0 \right)\), given \(y = 2\sin\left( 3x \right)\), is most nearly
(A) \(-5.9399\)
(B) \(-1.980\)
(C) \(0.31402\)
(D) \(5.9918\)
(6). The form of the exact solution of the ordinary differential equation \(\displaystyle 2\frac{dy}{dx} + 3y = 5e^{- x},\ y\left( 0 \right) = 5\) is
(A) \(Ae^{- 1.5x} + Be^{x}\)
(B) \(Ae^{- 1.5x} + Be^{- x}\)
(C) \(Ae^{1.5x} + Be^{- x}\)
(D) \(Ae^{- 1.5x} + Bxe^{- x}\)
For complete solution, go to
http://nm.mathforcollege.com/mcquizzes/01aae/quiz_01aae_introduction_answers.pdf
Problem Set
(1). Give one example of an engineering problem where each of the following mathematical procedures is used. If possible, draw from your experience in other classes or from any professional experience you have gathered to date.
a) Differentiation
b) Nonlinear equations
c) Simultaneous linear equations
d) Regression
e) Interpolation
f) Integration
g) Ordinary differential equations
(2). Only using your nonprogrammable calculator, find the root of
\[x^{3} - 0.165x^{2} + 3.993 \times 10^{- 4} = 0 \nonumber\]
by any method. Hint: Find one root by hit and trial, and use long division for factoring the polynomial.
- Answer
-
\(0.06237758151,\ 0.1463595047,\ -0.04373708621\)
(3). Solve the following system of simultaneous linear equations by any method
\[\begin{split} 25a + 5b + c &= 106.8\\ 64a + 8b + c &= 177.2\\ 144a + 12b + c &= 279.2 \end{split} \nonumber\]
- Answer
-
\(a = 0.2904761905,\ b = 19.69047619,\ c = 1.085714286\)
(4). You are given data for the upward velocity of a rocket as a function of time in the table below. Find the velocity at \(t = 16 \ \text{s}\).
\(t\) \(\text{s}\) | \(v(t)\) \(\text{m/s}\) |
---|---|
\(10\) | \(305.31\) |
\(20\) | \(701.53\) |
- Answer
-
\(543.0420000\ \text{m/s}\)
(5). Integrate exactly.
\[\int_{0}^{\pi/2}\sin2x \ dx \nonumber\]
- Answer
-
\(1\)
(6). Find
\[\frac{dy}{dx}(x = 1.4) \nonumber\]
given
\[y = e^{x} + \sin(x) \nonumber\]
- Answer
-
\(4.225167110\)
(7). Solve the following ordinary differential equation exactly.
\[\frac{dy}{dx} + y = e^{- x}, \ y(0) = 5 \nonumber\]
Also find \(y(0),\ \displaystyle \frac{dy}{dx}\ (0),\ y(2.5),\ \displaystyle\frac{dy}{dx}\ (2.5)\)
- Answer
-
\(\displaystyle y(0)=5,\ \frac{dy}{dx}(0)=-4,\ y(2.5)=0.61563,\ \frac{dy}{dx}(2.5)=-0.53355\)