You are on page 1of 11

Problem 1

a. Write a MATLAB programs to find a real root of the


following equation: f(x) = x3 + 10x2 − 2x – 10
by using the both False Position method and Newton
Raphson method (initial gauss = 2). Use an accuracy
level to 10 decimal place and iteration value to 80.
Show the number of iterations to achieve this accuracy
for both methods and answer which method is better.
b. Plot the values of x calculated in each iteration
from the False Position Method’s equation. (For this
problem, you should store the calculated value of x in
an array, then use that array to plot the curve)
c. Take an array of tolerance level
c = [10−2 10−6 10−12 10−15]
Now find the solution of each tolerance value using
loop and discuss those results for both methods.

Solution:
a)
By Newton-Raphson method:
the number of iteration and final answer is
By False position method:
No of iteration and answer is:

In newton Raphson method it takes only 6 iterations to


reach the result, while in false position method 19
iterations are needed. So newton Raphson method is
better in terms of fast operation.
b) Code for plotting:
The plot is:

c)
Taking tolerance array [10−2 10−6 10−12 10−15],the code
for false position is:
The solutions are:
the code for Newton-Raphson method is:

The solutions are:


Newton Raphson method gives accurate value even if the
tolerance is high. While, false position method gives
less accurate answer for higher values of tolerance.

solution:
finding out the transfer function:
z= R || sL

=( 1
𝑅 𝑠𝐿
+
1
)-1
=( 𝑠𝐿+𝑅
𝑅𝑠𝐿
)-1
𝑅𝑠𝐿
=
𝑅+𝑠𝐿

𝑉𝑜𝑢𝑡 𝑧
So, = 1
𝑉𝑖𝑛 𝑧+
𝑠𝐶
𝑅𝑠𝐿
𝑅+𝑠𝐿
= 𝑅𝑠𝐿 1
+
𝑅+𝑠𝐿 𝑠𝐶

𝑅𝑠𝐿
𝑅+𝑠𝐿
= 𝑅𝐿𝐶𝑠2 +𝑅+𝑠𝐿
𝑠𝐶(𝑅+𝑠𝐿)

𝑅𝐿𝐶𝑠 2
=
𝑅𝐿𝐶𝑠 2 +𝑅+𝑠𝐿
10𝑘×5×1.12×10−6 𝑠 2
=
10𝑘×5×1.12×10−6 𝑠 2 +10𝑘+5𝑠
0.056𝑠 2
=
0.056𝑠 2 +10𝑘+5𝑠
𝑉𝑜𝑢𝑡 1
Now, =
𝑉𝑖𝑛 √2

0.056𝑠 2 1
or, =
0.056𝑠 2 +10𝑘+5𝑠 √2

or, 0.07919s2=0.056s 2 + 10k + 5s


or, 0.02319s2-5s-10k=0,which is the transfer function.
Solving it using false position method:
The solution is:

You might also like