0% found this document useful (0 votes)
27 views64 pages

1 Introduction To Mathematical Modeling and Numerical Methods

The document provides an introduction to mathematical modeling and numerical methods, emphasizing their importance in science and engineering for describing physical phenomena. It discusses the components of mathematical models, the challenges of analytical solutions, and the advantages of numerical methods, including the use of computer programming for solving complex problems. Additionally, it addresses errors in mathematical modeling and numerical methods, including round-off and truncation errors, and emphasizes the need for accuracy and precision in scientific work.

Uploaded by

Yūji Terushima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views64 pages

1 Introduction To Mathematical Modeling and Numerical Methods

The document provides an introduction to mathematical modeling and numerical methods, emphasizing their importance in science and engineering for describing physical phenomena. It discusses the components of mathematical models, the challenges of analytical solutions, and the advantages of numerical methods, including the use of computer programming for solving complex problems. Additionally, it addresses errors in mathematical modeling and numerical methods, including round-off and truncation errors, and emphasizes the need for accuracy and precision in scientific work.

Uploaded by

Yūji Terushima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

INTRODUCTION TO

MATHEMATICAL MODELING CE 007 | Numerical


Solutions on CE Problems

AND NUMERICAL METHODS


TOPICS

Topics in this lecture include:


 introduction to mathematical modeling and numerical
methods;
 introduction to computer programming; and
 errors in mathematical modeling and numerical methods.
INTRODUCTION TO Introduction to

MATHEMATICAL MODELING
Mathematical Modeling
and Numerical Methods
INTRODUCTION TO
MATHEMATICAL MODELING
Science and engineering involves observation and
explanation of physical phenomena. These phenomena are
best described using mathematical models.
Mathematical models are equations that shows the
essential features of a physical system or process.
INTRODUCTION TO
MATHEMATICAL MODELING
Mathematical models consist of the following:
Dependent Variables (��): These are variables that reflect the
behavior or state of the system;
Independent Variables (���): These are variables along which the
behavior of the system is being determined;
Parameters (�): These reflect the properties and composition of the
system; and
Forcing Functions (��): These are external influences acting upon the
system.
INTRODUCTION TO
MATHEMATICAL MODELING
Mathematical models can be usually written in the form
�� = � ���, �, ��
These may be written from as simple as an algebraic
expression to as complicated as a set of differential
equations.
Some of these equations may be solved by hand
(analytically). However, some of these mathematical
models are too tedious to be solved analytically.
MATHEMATICAL MODEL
MATHEMATICAL MODEL
MATHEMATICAL MODEL
INTRODUCTION TO
MATHEMATICAL MODELING
Some of the issues in engineering which make analytical
methods harder to use are as follows:
Nonlinearity of the System
Some mathematical models are linear. These models can be
easily solved using analytical methods.
However, some mathematical models are nonlinear. Some
nonlinear models can be linearized. But then, some
nonlinear models can either be too tedious to solve
analytically or cannot be solved analytically.
INTRODUCTION TO
MATHEMATICAL MODELING
Some of the issues in engineering which make analytical methods
harder to use are as follows:
Size of the System
Some systems are too large to be solved analytically, especially
systems with more than three unknowns.
INTRODUCTION TO
MATHEMATICAL MODELING
Some of the issues in engineering which make analytical
methods harder to use are as follows:
Idealization of the System
Most of the mathematical models are written using known
basic principles of sciences.
Therefore, these models are said to be ideal. However,
physical experiments usually show discrepancies between
the conditions assumed by the mathematical model and the
actual conditions.
INTRODUCTION TO
MATHEMATICAL MODELING
Some of the issues in engineering which make analytical
methods harder to use are as follows:
Sensitivity Analysis
Some changes in independent variables may yield
drastic changes in the dependent variables of the system.
For this type of analysis to be done, the mathematical
model should be solved repeatedly for different values
of independent variables. However, for more
complicated mathematical models, sensitivity analysis is
too tedious to execute.
INTRODUCTION TO
MATHEMATICAL MODELING
Some of the issues in engineering which make analytical
methods harder to use are as follows:
Design of the System
Engineering design involves solving the parameters that
should be used on order to design the system that meet
specific requirements.
However, design is more tedious to execute due to
fulfillment of several required criteria for the system
(which are also expressed as mathematical models), as
well as the iterative nature of engineering design.
INTRODUCTION TO
MATHEMATICAL MODELING
These issues may be taken care of by using numerical
methods to solve these mathematical models.
Numerical methods are mathematical methods that
involve solutions of mathematical models by expressing
them using arithmetic and logical operations, therefore
making them easier to solve with the help of computer
tools and programming.
Numerical methods can be used to solve more types of
physical problems, which involve nonlinearity, large size,
non-ideal conditions, and engineering design.
WHY STUDY NUMERICAL SOLUTIONS?
NUMERICAL SOLUTION TOPICS
NUMERICAL SOLUTION TOPICS
NUMERICAL SOLUTION TOPICS
COMPUTER TOOLS AND Introduction to

PROGRAMMING
Mathematical Modeling
and Numerical Methods
COMPUTER TOOLS AND PROGRAMMING

Numerical methods involve use of computers in order to analyze


a particular system. These may be done by computer
programming.
Computer programming is the process of creating a set of
instructions that tell the computer how to execute a particular
task.
Programming allows for easier implementation of solutions since
changes in inputs (independent variables, parameters, forcing
functions) may be done automatically. It also allows for easier
modification of solutions, whenever different conditions have to
be applied.
PROGRAMMING
PROGRAMMING
ALGORITHM

This is an ordered list of logical steps required to perform a certain


task.
PSEUDOCODE
This is a worded
description of a computer
program.
-Artificial and informal
language that helps
programmers develop
algorithms
PSEUDOCODE
This is a worded
description of a computer
program.
FLOWCHART
This is a diagram showing how the developed computer program works.
FLOWCHART
OPERATOR PRECEDENCE (BASED ON
PYTHON)
CONDITIONAL STATEMENTS
LOOPING STATEMENT
LOOP CONTROL STATEMENTS
TOOLS FOR COMPUTER PROGRAMMING

Nowadays, there are also a lot of references and


resources for learning the use of these tools. Thus, it is
recommended for students to:
Refresh their introductory computer programming
knowledge;
Learn to use the said tools through available books and
other resources; and
Practice computer programming.
ERRORS IN MATHEMATICAL
MODELING AND NUMERICAL
Introduction to
Mathematical Modeling

METHODS and Numerical Methods


ERRORS IN MATHEMATICAL MODELING
AND NUMERICAL METHODS
Scientific and engineering work always involve
uncertainties, which are attributable to factors that are
outside of the assumptions in which the mathematical
models are derived from.
Additionally, numerical methods are approximate solutions
of these mathematical models; therefore, results derived
from these methods are expected to differ from exact or
analytical results.
These discrepancies are collectively known as errors.
ACCURACY AND PRECISION

Errors that come from calculations and measurements may


be characterized in terms of either accuracy or precision.
Accuracy refers to the closeness of a certain measurement
to its true value, while precision refers to the closeness of
certain measurement data to each other.
Inaccuracy (also called bias) is defined as systematic
deviation from the truth. Imprecision (also called
uncertainty), on the other hand, refers to the magnitude of
the scatter.
ACCURACY AND PRECISION
ERROR DEFINITIONS

The relationship between the approximation (calculated or


measured value), true value, and error is given by

���� ����� = ������������� + �����

Thus, error is defined as the difference between the true


value and the approximation.
TRUE ERROR

True error is defined as the exact or absolute value of the


error since it is calculated with a known true value.
True error (�� ) may be expressed in terms of the true value
(��) and approximation (�), given by

�� = �� − �
TRUE ERROR

True error, as it is, does not consider order of magnitude of the


true value and the approximation. Thus, other forms of true error
may be used, such as:
Fractional Relative True Error

�� − �
�� =
��
Percentage Relative True Error

�� − �
�� = × 100%
��
APPROXIMATE ERROR

True value is rarely available. Because of this, true error may


not be calculated.
Instead, approximate error may be calculated, which are error
estimates making use of several approximations.
Approximate error (�� ) may be expressed as

��
�� =

where �� is the approximate deviation.


APPROXIMATE ERROR

Approximate error may also be determined as follows:


Fractional Relative Approximate Error

�������� − ���������
�� =
��������

Percentage Relative Approximate Error

�������� − ���������
�� = × 100%
��������
ROUND-OFF ERRORS

Round-off error occur because computers cannot represent


some quantities exactly.
The numbers as we know it are part of the decimal number
system (or base-10 system). Computers operate using the
binary number system (or base-2 system). Therefore,
computers must be able to convert base-10 numbers to
base-2 numbers.
However, this conversion presents some problems when it
comes to operating numbers.
ROUND-OFF ERRORS

Precision: Some numbers cannot be represented using a


finite number of significant figures. Examples of these are
numbers such as �, �, or 1 3. Computers can represent
numbers in two ways:
Single Precision: Numbers can be expressed up to 7
significant figures.
Double Precision: Numbers can be expressed up to 15
significant figures.
ROUND-OFF ERRORS

Range: Computers can represent numbers within a certain


range.
Integers: from -32,768 to 32,767 (single precision); from -
2,147,483,648 to 2,147,483,647 (double precision)
Floating Point Numbers: from 10-38 to 1039 (single
precision); from 10-308 to 10308 (double precision)
ROUND-OFF ERRORS
Round-off errors usually occur during the following operations:
Subtractive Cancellation: Subtracting two nearly equal
numbers
Large Computations: Computations are interdependent for
programs with a large number of arithmetic calculations,
which causes cumulative errors
Adding a Large and a Small Number: Usually occur in
computation of an infinite series; mitigated by summing the
series in reverse order
Smearing: Occurs whenever the individual terms in a
summation are larger than the summation itself, usually
happening on series of mixed signs
TRUNCATION ERRORS

Truncation errors occur as a result of an approximation in


place of an exact mathematical procedure.
An example of this is calculation of a function in terms of its
infinite series.
ILLUSTRATIVE EXAMPLE

The sine of a number � in radians has an infinite series equivalent of


∞ −1 � �2�+1
sin � =
�=0 2� + 1 !

� sin

1 0.8558008
2 0.8662953
3 0.8660213
4 0.8660254
5 0.8660254
Exact Solution 0.8660254
TRUNCATION ERRORS

Taylor series can be used to estimate truncation errors. This series


expresses a function � � at a certain value � in terms of its
derivatives, given by

∞ � � �� ��+1 − �� �
� ��+1 = � �� +
�=1 �!

where � � �� is the nth derivative of � � at �� .


TAYLOR SERIES EXPANSION
TAYLOR SERIES – OTH ORDER
TAYLOR SERIES – 1ST ORDER
OVERVIEW OF TAYLOR SERIES
TRUNCATION ERRORS

Normally, only few derivatives (say, first � derivatives only) are


necessary to get an acceptable approximation of the solution. Thus,
� � may be rewritten as
� � � � �
� ��+1 − ��
� ��+1 = � �� + + ��
�=1 �!
where �� is the truncation error, given by

∞ � � �� ��+1 − �� �
� �+1 � ℎ�+1
�� = =
�=�+1 �! �+1 !
�� < � < ��+1
TRUNCATION ERRORS

The truncation error may be expressed in terms of big-O


notation, which is useful in judging the comparative error of
numerical methods, that is,

�+1
� � ℎ�+1
�� = = � ℎ�+1
�+1 !
EXAMPLE 1.1
Consider � � =− 0.1�4 − 0.15�3 − 0.5�2 − 0.25� + 1.2. Using
the given function, � 0 = 1.2, approximate � 1 by making use
of the first four terms of Taylor series expansion of � � .
SOLUTION
∞ � � �� ��+1 − �� �
� ��+1 = � �� +
�=1 �!
��+1 = 1
�� = 0 ��+1 − �� = 1 − 0 = 1

� � =− 0.1�4 − 0.15�3 − 0.5�2 − 0.25� + 1.2


�′ � =− 0.4�3 − 0.45�2 − � − 0.25
�′ 0 =− 0.25
SOLUTION
∞ � � �� ��+1 − �� �
� ��+1 = � �� +
�=1 �!
�′′ � =− 1.2�2 − 0.9� − 1
�′′ 0 =− 1

�′′′ � =− 2.4� − 0.9


�′′′ 0 =− 0.9

��� � =− 2.4
��� 0 =− 2.4
SOLUTION
∞ � � �� ��+1 − �� �
� ��+1 = � �� +
�=1 �!

1 2 3 4
−0.25 1 −1 1 −0.9 1 −2.4 1
� 1 = 1.2 + + + +
1! 2! 3! 4!
� � = �. �

Note that �4 = � ℎ5 = 0.
TOTAL NUMERICAL ERROR

The total numerical error is the sum of the round-off error and the
truncation error.
However, minimizing error of one type will lead to increasing error of
the other type.
Thus, it is recommended to determine the balance between round-off
and truncation errors, and this can be attained by performing multiple
iterations of numerical solutions.
BLUNDERS, MODEL ERROR, AND DATA
UNCERTAINTY
Other errors that should be taken account in mathematical modeling
are as follows:
Blunders: Blunders are largely attributable to human imperfection.
These can be minimized by checking proper derivation of
mathematical models as well as proper execution of algorithm to solve
these models.
Model Errors: Some models do not take account other factors,
especially those that are hard to quantify or express in mathematical
terms.
Data Uncertainty: These are due to limitations on measurement
methods, which may cause imprecision or inaccuracy.

You might also like