Slides 01 A
Slides 01 A
ME502
Applied Numerical Methods
20 2
1.5
1
y = f(x)
y = f(x)
10 0.5
0
-10 -5 -0.5 0 5 10
0
-1
-10 -8 -6 -4 -2 0 2 4 6 8 10 -1.5
-10 x -2
x
y = [0.1x4 + 0.04x3 – 1.296x2 – 0.36x + 3.564] × [5e–0.14(x – 0.2)^2] y = [a cos(bx) + c] × [Ae–B(x – C)^2] + D
3
Overview of Numerical Methods
4
Overview of Numerical Methods (2)
Roots of equation
y
x
5
Example: Roots of equation
QRadiation
QConvection
6
Overview of Numerical Methods (3)
x x
7
Example: Solution of linear equations
Wall
T(x) = ?
x
8
Overview of Numerical Methods (4)
x x
Optimization (max, min)
y
x
9
Example: Optimization (Max, Min)
Steel pipe Ambient
air
Hot
steam
Insulation
10
Overview of Numerical Methods (5)
y Integration
x
Example: Numerical 11
1 T rqrad T
kr c pU
r r r rr x
qrad I , d d
12
Overview of Numerical Methods (6)
y Integration y Curve Fitting
x x
13
Example: Curve Fitting
Integration
Given equation [y = f(x) = 0.5x2 – 0.32x – 4.04], find value of x such that
y=f(x)=0
Lets make 1st guess as x = 4, so we get: y = f(x) = 2.68
2nd guess x = 4.1 y = f(x) = 3.053
Now based on the above 2 results what can be inferred?
3rd guess x = 3.9 y = f(x) = 2.317
4th guess x = 3.5 y = f(x) = 0.965
. 3.1805 0.00003
19
y = f(x) = 0.5x2 – 0.32x – 4.04
x = 3.1805
x = -2.5405
Graphical
Method
20
y = f(x) = 0.1x2 – 0.01x + 1 y = f(x) = 0.1x2 – 0.4x + 0.4
For the above equation, we want to find that value of x at which y is equal to
a certain value (= 0).
Example2: Root-Finding (3) 24
Itr# x y=f(x)
1 3 0.1411
2 3.1 0.0416
3 3.2 -0.0584
4 3.15 -0.0084
. . .
Open source
software for
numerical
computation
Scilab – console screen 28
Scilab – Program 29
30
Microsoft
Excel
Python https://www.python.org/
31
Plot of 1st degree polynomial 32
6
4
y = f(x)
0
-6 -4 -2 0 2 4 6
-2
-4 x
y = 0.8x + 1.50 y = mx + c
y = 0.8 (x+1.88)
Plot of 2nd degree polynomial 33
6
4
y = f(x)
0
-6 -4 -2 0 2 4 6
-2
-4
-6
x
1
0
-6 -4 -2 -1 0 2 4 6
-2
-3
x
y = 0.1x3 + 0.124x2 – 0.991x – 1.51
y = 0.1 (x+3.21) (x+1.15) (x-3.12)
Plot of 4th degree polynomial 35
10
8
6
y = f(x)
4
2
0
-6 -4 -2 -2 0 2 4 6
-4
-6
x
y = 0.1x4 – 0.032x3 – 1.388x2 + 0.905x + 2.49
5
0
-6 -4 -2 -5 0 2 4 6
-10
-15
-20
x
20
10
0
-6 -4 -2 -10 0 2 4 6
-20
x
y = 0.1x6 – 0.018x5 – 2.171x4 + 0.514x3 + 11.886x2 – 2.773x – 9.710
40
20
0
-6 -4 -2 -20 0 2 4 6
-40
-60
-80
-100
x
y = 0.1 (x+3.71) (x+2.92) (x+1.23) (x+0.53)
(x-1.79) (x-2.76) (x-3.82)
Plot of product of polynomial with exponential 39
function
20
y = f(x)
15
10
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
-5
x
2.5
1.5
0.5
-4 -2 -0.5 0 2 4
-1.5
-2.5
x
y = 0.7 sin(1.79x) + 1.3 cos(5.32x) + 0.2
41
Practise Problem
Problem: Determine the roots of the 6th degree polynomial function given below.
It is also known that all the roots are real.
10
-10
42
Practise Problem (Contd.)
Step 2: From this graph we can obtain the approx Root# xlower xupper
lower and upper bounds within which the roots lie.
1 -4.3 -3.5
2 -3 -2
3 -1.5 -0.3
y = 0.01 × [ -80 - 26x + 145x2 + 28x3 - 26x4 - 2x5 + x6 ]
4 0.2 1
15 5 2.2 3.8
6 4.5 5.5
10
0
-6 -4 -2 0 2 4 6
-5
-10
43
Practise Problem (Contd.)
Step 3: By using the Bisection method code we Root xlower xupper xroot
can obtained each of the 6 roots. # (± 0.00001)
1 -4.3 -3.5 -3.97823
2 -3 -2 -2.16045
3 -1.5 -0.3 -0.73931
y = 0.01 × [ -80 - 26x + 145x2 + 28x3 -
26x4 - 2x5 + x6 ] 4 0.2 1 0.82275
15 5 2.2 3.8 3.06868
10 6 4.5 5.5 4.98656
5
0
-5 -5 0 5 10
-10
44
Overall Summary
Importance of numerical methods
Cubic curve:
y2 = x2(x + 1)
Ref: Julian Havil, "Curves for the Mathematically Curious", Princeton University Press, Princeton, USA, 2019.
Ref: https://mathshistory.st-andrews.ac.uk/Curves/ School of Mathematics and Statistics , University of St Andrews
Ref: https://en.wikipedia.org/wiki/List_of_curves
51
Interesting Curves (3)
Euler Spiral