Mock Quiz#7 With Solution

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Mock Quiz #7

Q1: Show first two steps of Newton- Raphson method to compute the solution of 𝑥𝑒 𝑥 − 2 = 0. Use x =1 as initial guess.

/Step 1: Evaluate fix) and f(x) initial


at guess,2o=1
2
f(x) xe- 2 f(x) e 0.71
-

=
=
=>
=

f(x) (1 + x)
=
en => f(x) 2e
=

5.43
=

compute next given


value, U1
= No-f()
f(x0)
x1 1
=0.87
= -

Checkif is
f(x1) sufficiently close to zero,

if If(x1)) < tolerance

quit
de we go to next step.
0.87-*2)
tion/Step x1
-f
2:
x = =

e0.87
( 0.87)
+

0.87-0.017=
= >

0.852
Checkif f(xz) is
sufficiently close to
zero, (f(x2)) < tolerance -
quit.
Q2: Show first two steps of Secant method to compute the solution of 𝑥𝑒 𝑥 − 2 = 0. Use 𝑥1 = 0.5 and 𝑥2 = 1 as initial guesses.

Secant method approximate derivate,f(x) in Abe(x1)


2 -

x,

named and
Sep1: We have two guesses in rz.

we find the Newton-Raphson step,


next
guess is using the

the
only difference we use the approximation of fic).

xs =

xz -

1)-(2-xi)
(f(x2) f(x)) -

x3 1
=

2-(-0.5) =
1 -

-
C 2.
=

0.5
0.5 0.8104
=>

0.5
( -

2) -

0.5 -
2) 2 -
0.52

CheckifIf(23)) < tolerance.

Iteration
fess
#2: NextInitial que, an xo- =

a

compute it -
Q3. Use the Newton-Raphson method to find the solution to the following nonlinear system of equations,
𝑓1 (𝑥1 , 𝑥2 ): 𝑥12 + 𝑥1 𝑥2 − 10 = 0
𝑓2 (𝑥1 , 𝑥2 ): 3𝑥1 + 3𝑥1 𝑥22 − 2 = 0
We can also write the above set of equation in a form of vector as,

I
x x,xz 10
L
0
-

𝐹(𝑋) = [ ]
0 F(x) =

𝑓1 (𝑥1 , 𝑥2 ) 𝑥12 + 𝑥1 𝑥2 − 10 3x, 3x,x2-2 +

where 𝐹(𝑋) = [
-
M

], 𝐹(𝑋) = [ 2 ]
𝑓2 (𝑥1 , 𝑥2 ) @
-𝑥1 + 𝑥1 𝑥2 − 2
=>

&F(x) contain two equations fo 4tz

a. Write the expression of Jacobian of 𝐹(𝑋).

Vector F(X) is a function of X. Where


X=(*is]

(t eI (axter i
x1

Ex) =
-

and
COL CO)
b. Starting with the initial guess of 𝑥1 = 1 and 𝑥2 =2. Compute the first two steps of Newton-Raphson.

[]=(2]
We initial X*
are
given gun,

Jacobian atX .
Compute
JIY)
a*/x
=

x
=

J(x10) =

Iarctice ! In s
-

(i) (e]

L isin]
J(x(0) =
Evaluate F(X) X"
(s]
at -> FIx*

(Il!]
F(x)
( "):()
=> =

Similar to unidimensional Newton-Raptson.


(* -7

F(X*
x=X -

(xx)
↑ ↑ I
Next-quen Currentques Inverse of Jacobian Vector ofnonlinea equations
matrixevaluated evalent at
current-guess
& X
=
Let y J(x(x)
=

F(X,0))

-> 5 (X) y F(X1")


=

fnon-lineal equations.
e

Jacobian Matrix Vector

-
this is linear system of equations, for y we can solve

by first decomposing J(X) using LV decomposition


then
and
using Forward 4 Backward Substitutions.
For this J(x) MUSTbe non-singular.!!!
Y. compute X"
computing,
After We can as

X=X- Y

this for variables 2,


gives us a
new-guns 4 U2.

After
obtaining x
"
We check if I/F(X") Is is

sufficiently close to zero. If IIF(X)He is not

very
small then we
proceed and compute next
step literation and use XC as initial
guns.
X" initial find X.
():Using
-
as goes,

x( x"
=
-
5(y() F(X)

y 5(x )F(xx")
=

5(x) y F(xc)
=> =

↑ ↑
Jcx) is jacobian FCX) is F(x)
evalated & XC, evaluated at X".

You might also like