0% found this document useful (0 votes)
15 views8 pages

Assignment Numerical

Uploaded by

Yem Sophearith
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)
15 views8 pages

Assignment Numerical

Uploaded by

Yem Sophearith
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

INSTITUTE OF TECHNOLOGY OF CAMBODIA

DEPARTMENT OF INDUSTRIAL AND MECHANICA ENGINEERING

Numerical Method for Engineering

LECTURER: Mr. KEO Chivorn

GROUP: I4-GIM-B

Student’s name: YEM Sophearith

ID: E20200527

MATLAB

Academic year: 2023-2024


INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

Solution:

(a) Graphically f(x) = 2𝑥 3 − 11.7𝑥 2 + 17.7x − 5

1|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

MATLAB Code:

Flowchart:

2|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

(b) Fixed-point iteration method (three iterations, x0 = 3). Note: Make certain
that you develop a solution that converges on the root.

The root of the given function satisfies the equation:


−2𝑥 3 +11.7𝑥 2 +5
We have :𝑥 = Given 𝑥0 = 3
17.7

Iteration:
−2𝑥03 +11.7𝑥02 +5
First iteration 𝑥1 = = 3.180791
17.7
−2𝑥13 +11.7𝑥12 +5
Second iteration 𝑥2 = = 3.333959
17.7
−2𝑥23 +11.7𝑥22 +5
Third iteration 𝑥3 = =3.442543
17.7

Approximate percent relative error after 3 iterations

𝑥3 −𝜘2 3.442543−3.333959
𝜀=| |= =0.0315418
𝑥3 3.442543

MatLab Code: The fixed-point iteration method can be implemented in MATLAB


as follows:

3|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

Results:

Flowchart:

4|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

(c) Newton-Raphson method (three iterations, 𝑥0 = 3)

𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥𝑛 )

f(x)=2𝑥 3 − 11.7𝑥 2 + 17.7𝑥 − 5

𝑓 ′ = 6𝑥 2 − 23.4 + 17.7

MatLab Code: The Newton-Raphson method can be implemented in MATLAB as


follows:

5|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

Results:

Flowchart:

6|P A G E
INSTITUTE OF TECHNOLOGY OF CAMBODIA I4-GIM-B

7|P A G E

You might also like