0% found this document useful (0 votes)
9 views22 pages

Module 3

Module 3 covers optimization techniques in computational engineering, focusing on the Newton-Raphson method for root-finding and determining optimum points for functions. It includes examples of manual calculations and Matlab coding for both root determination and optimization. Additionally, it introduces the Perturb-and-Observe algorithm for maximizing points and discusses its weaknesses and modifications for different applications.

Uploaded by

Stacey Leen
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)
9 views22 pages

Module 3

Module 3 covers optimization techniques in computational engineering, focusing on the Newton-Raphson method for root-finding and determining optimum points for functions. It includes examples of manual calculations and Matlab coding for both root determination and optimization. Additionally, it introduces the Perturb-and-Observe algorithm for maximizing points and discusses its weaknesses and modifications for different applications.

Uploaded by

Stacey Leen
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/ 22

Module 3

Optimisation
KE27003 Computational Engineering
Topic
Optimisation

1 2

Newton- Perturb-and-
Raphson Observe
Newton-Raphson (NR)
Is an iterative root-finding method, which is used to find the roots of
equations through a repetitive process.
It involves refining initial guesses to approximate the roots of functions, often
used in numerical analysis.
This iterative approach is crucial for solving complex equations where exact
solutions are difficult to obtain.
Concept
Derivation
Given: function

Methodology:
Determine the derivative of function , or called as
 gradient / slope of the curve at

Refer the graph,

re-arrange the equation:


{}

Re-arrange the equation:


Example: Roots Determination
(Manual)
Determine the roots for the function, .
Function f(x) = x 3 - 4x 2 + 5x - 2
4
Given:
3

2
(may use calculator)

f(x)
1

-1

-2
0 0.5 1 1.5 2 2.5 3
x
Example: Root Determination (NR)
Determine the roots for the function, using Newton-Raphson method.
Function f(x) = x 3 - 4x 2 + 5x - 2
4

3
First guess :
1st iteration : 2

2nd iteration :

f(x)
1
3rd iteration : 43
4th iteration : 00 0

-1
Root:
-2
0 0.5 1 1.5 2 2.5 3
x
What is the difference between manual calculation
and Newton-Raphson method?
Example: Matlab Coding (Root)
Determine the roots for the function, using Newton-Raphson method.
Function f(x) = x 3 - 4x 2 + 5x - 2
4

f(x)
1

-1

-2
0 0.5 1 1.5 2 2.5 3
x

Can modify Newton-Raphson to determine ?


Determine Optimum Point using NR
Determine the optimum points for the function, .
Function f(x) = x 3 - 4x 2 + 5x - 2
4
Given:
3

1st Derivation:
2
Optimum point occurred at , thus
or

f(x)
1

0
2nd
Derivation:
If , , : maximum point @ -1

If , , : minimum point @
-2
0 0.5 1 1.5 2 2.5 3
x
Example: Optimum Point (NR)
Determine the optimum points for the function, using Newton-Raphson method.
Function f(x) = x 3 - 4x 2 + 5x - 2
𝒇 ′ ( 𝒙 𝒏) 4
𝒙 𝒏+𝟏 = 𝒙 𝒏 − ′′
𝒇 ( 𝒙 𝒏)
3
First guess :
1st iteration : 2

2nd iteration :

f(x)
1
3rd iteration :
4th iteration : 0

-1
Optimum point:
-2
0 0.5 1 1.5 2 2.5 3
x
Example: Matlab Code (Optimum
Point)
Determine the optimum points for the function, using Newton-Raphson method.
Function f(x) = x 3 - 4x 2 + 5x - 2
4

f(x)
1

-1

-2
0 0.5 1 1.5 2 2.5 3
x
Example (Diode Current)
Determine the voltage across a diode at which the current flow through it is . Given that
, and

Current flow through diode


Reverse saturation current of a diode
Voltage across a diode
Ideality factor of a diode
Thermal voltage
Example (Diode Current)
Determine the voltage across a diode at which the current flow through it is . Given that
, and

Re-arrange the equation:


Summary (Newton-Raphson)

Pros Cons
• Efficient in finding the root of an • Sensitive to the choice of initial guess.
equation.
• May diverge if the derivative is close to
• Converges rapidly if the initial guess is zero.
close to the root.
• Not suitable for all types of functions.
• Requires less memory and
computational effort.
Exercise 1 (Nodal Analysis)
Determine the voltage, .
Steps to simulate the voltage, :
𝑉a
0 1. Derive the equation for based on Kirchhoff’s law.
+ 𝑅1 s
2. Rearrange the equation in the form as .
𝑅2 𝑅3
3. Determine the equation for .
a
0 4. Guess the initial value of .
s
5. Use Newton-Raphson method to determine the value
of .

6. Validate the answer in (5) using Matlab and Simulink.


Exercise 2 (Pendulum Motion)
Applied Mechanics:
Simulate a pendulum motion and determine Derive the motion using
the angle at which the pendulum will come to
rest. Motion:

1. Describe and justify your methodology.


2. Manually determine the angle.
3. Code in Matlab to validate the answer in Displacement:
(2).

Motion:

Source: Wikipedia
Perturb-and-Observe
Algorithm
Perturb and Observe (P&O)
Algorithm
An algorithm used to determine the maximum point.

90

Case 3:
80
If AND
70
Then
60
Case 1:
50
If AND
Output

40 −∆𝑥 Case 4:
Then
30 If AND
Case 2: 20
Then
If AND +∆ 𝑥
𝑥∆𝑥
10
− ∆+
Then 0
0 5 10 15 20 25
Current Input Current
Flowchart Start

Yes No
Is ?

Yes No Yes No
Is ? Is ?

Case 1 Case 3 Case 4 Case 2

End
Weakness of P&O Algorithm
Exercise
1. What are the impacts of high ?

2. What are the impacts of low ?

3. Can the P&O algorithm use to track global optimum point?

4. How to modify P&O algorithm so that it can be used to determine minimum point?
Exercise

12
where
10

0
-3 -2 -1 0 1 2 3

You might also like