0% found this document useful (0 votes)
8 views

Day 1 - 2024

Uploaded by

Mani Kanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Day 1 - 2024

Uploaded by

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

CE 509

Computational Methods
in Civil Engineering

Introduction,
Mathematical Modeling,
Errors
Day 1 1/23/2024
NOTE: These notes are for CE 509 students’ personal use only.
Do not copy or distribute
Numerical Methods
Formulate an engineering or real-world problem as a
mathematical model and solve the model with
arithmetic operations. The mathematical tool to do
this is broadly referred as a numerical method.
• Noncomputer methods: analytical (using
variables), graphical, and calculators.
• Computer methods: numerical methods that
include finite difference and finite element
methods. Commercial software is typically used
for numerical solutions.
Analysis of a Truss
Optimal Design of Tank or Pipe
Cross-Sectional Area of Stream
by Numerical Integration
Optimization (Saturation-Growth
Model for Microbial Kinetics)
Mathematical Modeling and
Engineering Problem solving
Chapter 1
• Requires understanding of engineering systems
–By observation and experiment
–Theoretical analysis and generalization
• Computers are great tools, however, without
fundamental understanding of engineering problems,
they will be useless.
Fig. 1.1
• A mathematical model is represented as a functional
relationship of the form

Dependent independent forcing


Variable = f variables, parameters, functions

• Dependent variable: Characteristic that usually reflects the


state of the system
• Independent variables: Dimensions such as time and space
along which the systems behavior is being determined
• Parameters: reflect the system’s properties or composition
• Forcing functions: external influences acting upon the
system
dv c
g v
dt m
• This is a differential equation and is written in
terms of the differential rate of change dv/dt of the
variable that we are interested in predicting.
• If the parachutist is initially at rest (v=0 at t=0),
using calculus
Independent
gm
 
variable
( c / m )t
v(t )  1 e
c
Dependent
Forcing Parameters
variable
function
Programming and Software
Chapter 2

• Objective is how to use the computer as a


tool to obtain numerical solutions for a
given engineering model. There are two
ways in using computers:
– Use available software
– Or, write computer programs to extend the
capabilities of available software, such as
Excel and Matlab.
• Engineers should not be tool limited, it is
important that they can do both!
Solution of Mathematical Models

Solution of mathematical models (e.g.


Heat or Diffusion, wave equation) can be
achieved using two approaches:

-analytical: find the exact solution of the


model by integrating the differential
equation. Many mathematical models
cannot be solved analytically.

-numerical: find an approximate solution


of the model by using a numerical scheme.
Errors

Numerical methods provide approximate


solutions to mathematical models.
Because the solution is not exact, there
will always be errors associated with a
numerical solution.

Whenever we employ a number we need to


consider its reliability.

Significant digits of a number: number of


reliable digits plus an estimated digit.
Errors

Accuracy: how closely a computed or


measured value agrees with the true value
Precision: how closely individual computed
or measured values agree with each other
Inaccuracy (bias): systematic deviation
from the true value
Imprecision (uncertainty): magnitude of
the scatter.

Numerical methods must be both accurate


and precise.
Fig. 3.2
Errors

We have two types of errors:

Truncation errors: result when


approximations are used to represent
exact mathematical procedures. Errors
associated with numerical schemes.
Round-off errors: result when numbers
having limited significant figures are used
to represent exact numbers. Errors
associated with computation.
Error Definitions

True value = approximation+error

True error:
Et = true value – approximation

True Fractional Relative Error:


true error/true value

True Percent Relative Error


t = (true error/true value) ×100%
Error Definitions

In numerical methods we usually do not


know the exact solution of a value, but
only its estimate. The error is then
computed using the best estimate.

a = (approx. error/approximation)×100%
Error Definitions

If the numerical solution is obtained using


an iterative scheme then the error is
estimated as the difference between
previous and current approximations:
The signs of the errors maybe positive or
negative.

curr . approx .  prev . approx .


a  100%
curr . approx .
Error Definitions
Prespecified error:

a  s

Correct up to at least n significant digits


if:
2 n
 s  (0.5  10 )%
Truncation Errors

Truncation errors are those arising from


using an approximation in place of an exact
mathematical procedure.

An example of a widely used approximation


for mathematical derivatives is Taylor
series expansion.
Taylor Series

Taylor’s Theorem: if a function f and its


n+1 derivatives are continuous on an
interval containing a and x, then the value
of the function at x is given by:

f (x )  f (a )  f '(a )(x  a ) 
f ''(a ) f (n )
(a )
(x  a )  ... 
2
(x  a )  Rn
n

2! n!
Taylor Series

Rn is called the remainder and is given by:

f (n 1) ( ) n 1
Rn  h h  x a
(n  1)!

Where  (‘xi’) is a point between a and x.


If Rn is omitted then we have a polynomial
approximation of the function.
Taylor Series

x is not known exactly, so the error in the


approximation (the truncation error) is
not known exactly.
However we can extract some information
about the order of magnitude for the
(x-a)n+1 term.
Taylor Series

We say that the error is of order of


magnitude n+1 if the remainder is:

f (n 1) ( ) n 1
Rn  h
(n  1)!
And we write: Rn = O(hn+1)

To reduce the truncation error we


decrease the step size h.
Taylor Series
f (x )  25x 3  6x 2  7 x  88 Use a=1, find f(3) = 554.

554  (62)
f (3)  f (1)  62 t   100%  111 .191%
554

f (3)  62  f ' (1)(3  1)  62  70(2)  78  t  85.921%

f " (1) 138


f (3)  78  2
(3  1)  78  4  354  t  36.101%
2 2
( 3)
f (1) 150
f (3)  354  3
(3  1)  354  8  554  t  0%
6 6
Approximate exp(-x) with a=0
Error Propagation

Consider a function f(w) with a single


independent variable w. What is the
effect of an error in w? Assume an
approximation ŵ of w. The error is:

f (wˆ)  f (w )  f (wˆ)

The problem is that f(w) is unknown


because w is unknown.
Error Propagation

We can use a Taylor series expansion


if ŵ is close to w. Dropping the
second-and higher-order terms, we
get:
f (w )  f (wˆ)  f '(wˆ)(w  wˆ)

Or:
f (wˆ)  f '(wˆ) wˆ
Error Propagation

Where:
f (wˆ)  f (w )  f (wˆ)
is an estimate of the error of f(w) and
wˆ  w  wˆ is an estimate of the error
of w.
For a function of n independent
variables, we have the error
estimate:
f f f
f (wˆ1 ,wˆ2 ,...,wˆn )  ˆ
w 1  ˆ
w 2  ...  wˆn
w1 w 2 wn
Error Propagation

Error propagation in common


operations for approximate variables
error
estimate:(uˆ  vˆ) uˆ  vˆ
Addition: (uˆ  vˆ) uˆ  vˆ
Subtraction: (uˆxvˆ) uˆ vˆ  vˆ uˆ
Multiplication:
 uˆ  uˆ vˆ  vˆ uˆ
 
Division:  vˆ  vˆ
2
Stability and Condition

The condition of a mathematical


problem relates to its sensitivity to
changes in its input values.

A computational method is numerically


unstable if the uncertainty of the
input values is grossly magnified by
the numerical method.
Stability and Condition

Relative error of f(w):

Relative error of w:

w  wˆ

Stability and Condition

Condition Number is ratio of these two


relative errors:
ˆ '(wˆ)
wf
f (wˆ)

The condition number provides a


measure of the extent to which an
uncertainty in w is magnified by f(w).
Stability and Condition

Condition number = 1: the error in f(w) is the


same as the error in w.
Condition number > 1, the error in f(w) is
magnified
Condition number < 1, the error in f(w) is
attenuated

Functions with very large condition numbers


are said to be ill-conditioned.
Total Numerical Error

Sum of the roud-off and the truncation error.

Minimize round-off error by increasing number of


significant digits.
Reduce truncation error by decreasing step size.

The decrease in step size may lead to an


increase in computations, so while the truncation
error may decrease, the round-off error may
increase.
Find a trade-off.

You might also like