NUMERICAL METHODS: GEC320
NUMERICAL METHODS These are methods used to develop accurate and fast approximations to problems whose exact solutions are difficult to find because of their complexity. The use of these methods is sometimes referred to “numerical integration”. Area of application Civil engineering: structural analysis, traffic simulations, environmental simulations, geographic information systems and GPS Mechanical & aerospace engineering: heat flow, fluid dynamics, structural optimiza
Numerical Methods-GEC320
Areas of application of numerical methods include: Civil engineering: structural analysis, traffic simulations, environmental simulations, geographic information systems and GPS Mechanical & aerospace engineering: heat flow, fluid dynamics, structural optimization Electrical & computer engineering: network analysis, signal processing, electromagnetic fields Chemical & pharmaceutical engineering: molecular modelling, system simulation, biomechanical & biomedical engineering
FINITE DIFFERENCE Is a difference between the value of a function evaluated at a number, and the value of the same function evaluated at a different number, a fixed distance from the first.
Three forms are commonly considered: Forward finite difference Backward finite difference and central finite difference
Numerical Methods-GEC320
dx
Common definitions of the derivative of f(x):
Numerical Methods-GEC320
f ( x dx ) f ( x) x f lim dx 0 dx f ( x ) f ( x dx ) x f lim dx 0 dx f ( x dx) f ( x dx ) x f lim dx 0 2dx These are all correct definitions in the limit dx->0. But we want dx to remain FINITE
Numerical Methods-GEC320
The equivalent approximations of the derivatives are:
f ( x dx ) f ( x) x f dx f ( x) f ( x dx ) x f dx
f ( x dx) f ( x dx ) x f 2dx
forward difference backward difference
central difference
Example 1: Approximate the derivative of at x=3 using the forward, backward and central difference method and step size 1.
Example 2: use finite difference method to determine the equation for the polynomial corresponding to the given table of values below
Numerical Methods-GEC320
x -3 -2 -1 0 1 2 3
y 0 -4 0 6 8 0 -24
Numerical Methods-GEC320
INTERPOLATION If a function is defined by the following set of data, intermediate values can be estimated by a process called interpolation.
For instance, the value of f(2.5) will be between 14 and 40 i.e the function values of x=2 and x=3
Numerical Methods-GEC320
If the value of f(2.5) is given as 27 i.e (14+40)/2, the process is called linear interpolation. This result is unreliable since there is no proof of linear relationship between x and f(x)
Numerical Methods-GEC320
Consider the set of values again. the value of f(2.5) can be estimated by plotting f(x) against x
Numerical Methods-GEC320
This method is better if the values of x are equally spaced. Considering the set of values again,
Forward difference can be obtained as shown in the table
To find f(2.5), we have
where
Numerical Methods-GEC320
Substituting the values gives
Numerical Methods-GEC320
CAN YOU? Determine the determine the value of f(-1)from the set of function of values
Numerical Methods-GEC320
Numerical solution of ordinary differential equations
Analytical methods have limitation in providing solution to differential equations. Consider this graph.
The Maclaurin’s series of the function f(x) at the point K is
and at point P is
Numerical Methods-GEC320
If the origin O is moved a units along y-axis as shown below, which is a common form of Taylor’s series
Numerical Methods-GEC320
Numerical Methods-GEC320
If the curve below is described by the function y=f(x), the function value at point B can be determined by applying Taylor’s series as
Numerical Methods-GEC320
To determine the function value of a point in the neighbourhood of another point whose function value is know, Taylor’s series can be shortened to include the first two terms only i.e Which is comparable to from the graph
Example 1: find the approximate value of y at x=2.2, if initial condition that y=5 and x=2
Numerical Methods-GEC320
with the
Can you? Find the approximate value of y at x=1.0, if with the initial condition that y=2 and x=1 for the range x=1.0(0.2)3.0
Numerical Methods-GEC320
Numerical solution of ODE: Runge-Kutta method
Given the initial condition x=x0, y=y0, an ordinary differential equation can be evaluated. To obtain y1 i.e y0+1, we have y1= y0+h(x0, y0) i.e Where h= and
but
Example 1: find the numerical solution of with y=2, x=1.2 and h=0.2
Can you? find y(3) if y(0)=5, and h=1.5
Numerical Methods-GEC320
using the Runge-Kutta method
using the Runge-Kutta method with