CH-4, Math-5 - Lecture - Note
CH-4, Math-5 - Lecture - Note
CH-4, Math-5 - Lecture - Note
Recall that the Newton-Raphson formula to find the root of the equation f ( x )=0 can be
written as
−1
x n+1=x n −[ f ' ( x n ) ] f ( x n ) .
For a system of nonlinear equations, the Newton-Raphson formula in matrix form can be
expressed as
−1
X n+1=X n−[ J ( X ❑n ) ] F ( X n ) .
where X is a variables matrix, F(X) is a function matrix and J(X) is a Jacobian matrix.
The variable, function and Jacobian matrices for a system of two variables can be written
as
( )
∂f1 ∂f1
() (
y
f (x, y) (
X = x , F= 1
f 2( x , y ) )
, J x , y )= ∂ x
∂f2
∂y .
∂f2
∂x ∂y
Solution:
(a) The function matrix and Jacobian matrix are
1
Spring 2023-2024
( ) ( )
2
x + y−1 2x 1
F ( x , y )= 3 , J ( x , y )= 2
y −2 x+ 4 −2 3 y
(b)
and
[ J ( 1.4 ,−1 ) ]
−1
= ( 0.2885
0.1923
−0.0962
0.2692 )
(c) The iterative formula is
−1
X n+1=X n−[ J ( X ❑n ) ] F ( X n ) .
where
( )
X n= x n .
yn
(d) Using n=0, we have
−1
X 1 =X 0−[ J ( X 0 ) ] F (X 0 )
where
( )
X 0= 1.4 , F ( X 0 )=F ( 1.4 ,−1 )=
−1
−0.04
0.2
, ( )
and
−1
[ J ( X 0)] =[ J ( 1.4 ,−1 ) ] =
−1
(0.2885
0.1923
−0.0962
0.2692 )
Thus
( )( )(
x1
y1
= 1.4 − 0.2885 −0.0962 −0.04 = 1.4308
−1 0.1923 0.2692 0.2 −1.0462 )( )( )
root to 2 d.p. is
x 1=1.43∧ y 1=−1.05 .
Further iterations can be done by updating X 0 by X 1.
2
Spring 2023-2024
[ ]
2
(e) Define the functions as F= x3 + y −1
y −2 x +4
>> Roots=[x',y']
Roots =
1.4000 -1.0000
1.4308 -1.0462
1.4299 -1.0447
1.4299 -1.0447
1.4299 -1.0447
x=
1.4299
-1.0447
3
Spring 2023-2024
wheren=0 , 1, 2 , 3 ,∙ ∙∙ .
Without further details it may be mentioned that if ( x 0 , y 0 ) is close to the fixed point
( p , q) and if
| ∂
∂x ||
g1 (x 0 , y 0 ) +
∂
|
g ( x , y ) <1(4 a)
∂y 1 0 0
and
| ∂
∂x ||
g2 (x 0 , y 0 ) +
∂
|
g ( x , y ) <1(4 b)
∂y 2 0 0
then the iterative formula (3) will converge to the fixed point ( p , q).
If the conditions (4) are not satisfied, the iterative process might diverge.
The above method can be extended for more than two variables.
Seidel Iteration
>> clear
>> figure
>> hold on
>> ezplot('y-x.^2+5*x-3')
>> ezplot('x.^2+4*y.^2-4')
>> hold off
From graph it can be seen that the system has two real roots near (0.4 ,1.0)and
(0.9 ,−0.9).
4
Spring 2023-2024
| || | ∂ g1 ∂ g1
∂x
+
∂y
=|0.16|+|−0.2|=0.36 <1
and
| || |
∂ g2 ∂ g2
∂x
+
∂y |
=|−0.08|+ |
−8 ( 1 ) +10
10
= 0.28<1
The partial derivative tests are satisfied and hence the iterations converges to the root
near (0.4 ,1.0).
We can use iterative formulas for the root near (0.4 ,1.0) as
1 2
x n+1= ( x n− y n +3)
5
1
y n +1= ( 4− xn −4 y n+10 y n )
2 2
10
In Seidel iteration the second iterative equation will be of the form
1
y n +1= ( 4− xn +1−4 y n +10 y n )
2 2
10
Calculations with the above iterative formulas with x 0=0.4∧ y 0=1.0 are given below:
| || |
∂ g1 ∂ g1
∂x
+
∂y
=|0.36|+|−0.2|=0.56 <1
g1 (x , y ) satisfy the partial derivative test.
But | || |
∂ g2 ∂ g2
∂x
+
∂y
=|−0.18|+ |
−8 (−1 ) +10
10 |
=1.98>1
Test fails and the convergence is not guaranteed.
5
Spring 2023-2024
2 2
x + 4 y −4+ 10 y=10 y
we have
1 2
y= ( x + 4 y 2−4+10 y ) .
10
Corresponding iterative function can be of the form
1 2
g3 (x , y)= ( x + 4 y −4+10 y ) .
2
10
and
∂ 2x ∂ 1
g 3 ( x , y )= , g3 ( x , y )= (8 y+ 10)
∂x 10 ∂ y 10
At (0.9 ,−1),
| || | | ||
∂ g3 ∂ g3 1.8 8 (−1 ) +10
∂x
+
∂y
=
10
+ | 10
= 0.38<1
g1 x , y ¿ satisfies the partial derivative test.
Thus a fixed point iterative formula which converge to root near (0.9 ,−1) is
1 2
x n+1= ( x n− y n +3)
5
1 2
y n +1= ( x n +4 y n−4 +10 y n )
2
10
Iterative_Roots =
0.9000 -1.0000
0.9620 -0.9190
0.9689 -0.8886
0.9655 -0.8789
0.9622 -0.8767
0.9605 -0.8767
6
Spring 2023-2024
Exercise 4
Now using Newton-Raphson method answer the following questions. For each of the
above nonlinear system of equations:
(i) Find the Jacobian matrix J (x , y) for the above system.
(ii)Evaluate the inverse of the Jacobian matrix at the given point.
(iii) Write down the iterative formula for Newton-Raphson method.
(iv) Estimate the root to 2 d.p. using the using the above iterative formula once starting
with the given point.
(v)Write down MATLAB commands to execute the iteration four times.
(vi) Use MATLAB function “fsolve (fun,x0)” to find the root.
.
2. Sketch the curves represented by the following non-linear equations,
x
2 e + y=0 ,
2 2
3 x + 4 y =8.
a) Solve using Newton’s method with initial estimate (−1 ,−2 ) .
b) Repeat (a) but with an initial estimate (−2 , 0 ) .
c) Use graphical approach to validate the results in (a) and (b).
3. Sketch the curves represented by the following non-linear equations,
2 2
x − y =4 ,
2 2
x + y =16.
a) Solve using Newton’s method with initial estimate ( 3.0 , 2.5 ) .
b) Repeat (a) but with an initial estimate (−3 ,−2.5 ) .
c) Use graphical approach to validate the results in (a) and (b).
7
Spring 2023-2024
Estimate the root correct to 3 decimal places using fixed point iterative method.
8
Spring 2023-2024
7. A planar, two-link robot arm is shown in the figure. The coordinate system xy is the
tool frame and attached to the end-effector. The coordinates of the end-effector relative
to the base frame are expressed as
x=L1 cos θ1 + L2 cos ( θ1 +θ2 )
y=L1 sin θ1 + L2 sin ( θ 1+θ 2 )
Suppose the lengths, in consistent physical units, of the two links are L1=1 and L2=2 ,
and that x=2.5 , y=1.4 . Find the joint angles θ1 and θ2 (in radians) using Newton’s
method with initial estimate of (0.8,0.9)