Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Assignment 2

This document contains the solutions to 4 assignment problems: 1) It calculates partial derivatives and percent error for a multivariable function. 2) It again calculates partial derivatives, the function value, and percent error for another multivariable function. 3) It uses bisection method to find the root of a single-variable function to within 0.06% error over 17 iterations. 4) It again uses bisection method, this time finding the root within 0.05% error in 4 iterations for another single-variable function.

Uploaded by

nourhandardeer3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Assignment 2

This document contains the solutions to 4 assignment problems: 1) It calculates partial derivatives and percent error for a multivariable function. 2) It again calculates partial derivatives, the function value, and percent error for another multivariable function. 3) It uses bisection method to find the root of a single-variable function to within 0.06% error over 17 iterations. 4) It again uses bisection method, this time finding the root within 0.05% error in 4 iterations for another single-variable function.

Uploaded by

nourhandardeer3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Assignment (2)

Name: Nourhan Dardeer


Code: 2127030

u−vw
1) f(u,v,w)= v
2 –w
¿
∂f
∂u
∨¿ = v1 = 0.25
2

¿
∂f
∂v
∨¿ = vw – 2u
2
v
= 1.125
3

¿
∂f
∂u
∨¿ = −1
v
– 1 = 0.5

f = -1.125
∆f = (0.25 x 0.1) + (1.125 x 0.06) + (0.5 x 0.02) = 0.1025
0.1025
Percent relative error = | −1.125 | x 100 = 9.11%

3 4 3
x y +z y
2) f(x,y,z)= z
2 4
∂f
¿
∂x
∨¿ = 3 xz y = 48
3 3 3
∂f
¿
∂y
∨¿ = 4x y +z
z
= 33
3 3 4 3
∂f 3 z y−( x y + z y )
¿ ∨¿
∂u = z2
=12

f = 18
∆f = (48 x 0) + (33 x 0.2) + (12 x 0.3) = 10.2
10.2
Percent relative error = | 18 | x 100 = 56.66%

3) xL = -1 , xu = 0 , ɛs = 0.06%
−1+ 0
Xr = 2 = - 0.5
f(xL) = x2 - sin(x) =(-1)2 – sin(-1) = 1.017
f(xr) = x2 - sin(x) = (-0.5)2 - sin(-0.5) = 0.241
f(xL) f(xr) > 0 then , xL = xr = -0.5
2nd iteration:
xL = -0.5 f(xL) =0.241
−0.5+0
Xr = 2 = - 0.25
−0.25−(−0.5)
|ɛa|= ¿ −0.25 | x 100 =100%
f(xr) = x2 - sin(x) = (-0.25)2 - sin(-0.25) = 0.0668
f(xL) f(xr) > 0 then , xL = xr = -0.25
3rd iteration:
xL = -0.25 f(xL) =0.0668
−0.25+0
Xr = 2 = - 0.125
−0.125−(−0.25)
|ɛa|= ¿ −0.125 | x 100 =100%

f(xr) = x2 - sin(x) = (-0.125)2 - sin(-0.125) = 0.0178


f(xL) f(xr) > 0 then , xL = xr = -0.125
4th iteration:
xL = -0.125 f(xL) =0.0178
−0.125+0
Xr = 2 = - 0.0625
f(xr) = x2 - sin(x) = (- 0.0625)2 – sin(- 0.0625) = 0.00499
−0.0625−(−0.125)
|ɛa|= ¿ −0.0625 | x 100 =100%
f(xL) f(xr) > 0 then , xL = xr = -0.0625
5th iteration:
xL = -0.0625 f(xL) =0.00499
−0.0625+0
Xr = 2 = - 0.03125
−0.03125−(−0.0625)
|ɛa|= ¿ −0.03125 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.03125)2 – sin(- 0.03125) = 0.00152
f(xL) f(xr) > 0 then , xL = xr = -0.03125
6th iteration:
xL = -0.03125 f(xL) = 0.00152
−0.03125+0
Xr = 2 = - 0.015625
−0.015625−(−0.03125)
|ɛa|= ¿ −0.015625 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.015625)2 – sin( - 0.015625) =
0.000516
f(xL) f(xr) > 0 then , xL = xr = - 0.015625
7th iteration :
xL = - 0.015625 f(xL) = 0.000516
−0.015625+0
Xr = 2 = - 0.0078125
−0.0078125−(−0.015625)
|ɛa|= ¿ −0.0078125 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.0078125)2 – sin( - 0.0078125) =
0.000197
f(xL) f(xr) > 0 then , xL = xr = - 0.0078125
8th iteration :
xL = - 0.0078125 f(xL) = 0.000197
−0.0078125+0
Xr = 2 = - 0.003906
−0.003906−(−0.0078125)
|ɛa|= ¿ −0.003906 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.003906)2 – sin( - 0.003906) =
0.000083
f(xL) f(xr) > 0 then , xL = xr = - 0.003906
9th iteration:
xL = - 0.0078125 f(xL) = 0.000197
−0.0078125+0
Xr = 2 = - 0.003906
−0.003906−(−0.0078125)
|ɛa|= ¿ −0.003906 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.003906)2 – sin( - 0.003906) =
0.000083
f(xL) f(xr) > 0 then , xL = xr = - 0.003906
10th iteration:
xL = - 0.003906 f(xL) = 0.000083
−0.003906+0
Xr = 2 = - 0.001953
−0.001953−(−0.003906)
|ɛa|= ¿ −0.001953 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.001953)2 – sin( - 0.001953) =
0.0000379
f(xL) f(xr) > 0 then , xL = xr = - 0.001953
11th iteration:
xL = - 0.001953 f(xL) = 0.0000379
−0.001953+0
Xr = 2 = - 0.0009765
−0.0009765−(−0.001953)
|ɛa|= ¿ −0.0009765 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.0009765)2 – sin( - 0.0009765) =
0.00001799
f(xL) f(xr) > 0 then , xL = xr = - 0.0009765
12th iteration:
xL = - 0.0009765 f(xL) = 0.00001799
−0.0009765+0
Xr = 2 = - 0.00048825
−0.00048825−(−0.0009765)
|ɛa|= ¿ −0.00048825 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.00048825)2 – sin( - 0.00048825) =
0.000008759
f(xL) f(xr) > 0 then , xL = xr = - 0.00048825
13th iteration:
xL = - 0.00048825 f(xL) = 0.000008759
−0.00048825+0
Xr = 2 = - 0.0002441
−0.0002441−(−0.00048825)
|ɛa|= ¿ −0.0002441 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.0002441)2 – sin(- 0.0002441) =
0.0000043
f(xL) f(xr) > 0 then , xL = xr = - 0.0002441
14th iteration:
xL = - 0.0002441 f(xL) = 0.0000043
−0.0002441+0
Xr = 2 = - 0.000122
−0.000122−(−0.0002441)
|ɛa|= ¿ −0.000122 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.000122)2 – sin(- 0.000122) =
0.00000214
f(xL) f(xr) > 0 then , xL = xr = - 0.000122
15th iteration:
xL = - 0.000122 f(xL) = 0.00000214
−0.000122+0
Xr = 2 = - 0.000061
−0.000061−(−0.000122)
|ɛa|= ¿ −0.000061 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.000061)2 – sin(- 0.000061) =
0.00000106
f(xL) f(xr) > 0 then , xL = xr = - 0.000061
16th iteration:
xL = - 0.000061 f(xL) = 0.00000106
−0.000061+0
Xr = 2 = - 0.0000305
−0.0000305−(−0.000061)
|ɛa|= ¿ −0.0000305 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.0000305)2 – sin(- 0.0000305) =
0.000000533
f(xL) f(xr) > 0 then , xL = xr = - 0.0000305
17th iteration:
xL = - 0.0000305 f(xL) = 0.000000533
−0.0000305+0
Xr = 2 = - 0.00001525
−0.00001525−(−0.0000305)
|ɛa|= ¿ −0.00001525 | x 100 =100%
f(xr) = x2 - sin(x) = (- 0.00001525)2 – sin(- 0.00001525) =
0.000000266
f(xL) f(xr) = 0 then , root = xr = - 0.00001525

4) let xL = 2 , xu = 3 , ɛs = 0.05%
2+ 3
Xr = 2 = 2.5
|3 - 2|= 1 > 0.05
(xr)2 = 6.25 > 5
Then xL = 2 , xu = 2.5
2nd iteration:
2+ 2.5
Xr = 2 = 2.25
|2.5 - 2|= 0.5 > 0.05
(xr)2 = 5.0625 > 5
Then xL = 2.25 , xu = 2.5
3rd iteration:
2.25+2.5
Xr = 2 = 2.375
|2.5 – 2.25|= 0.25 > 0.05
(xr)2 = 5.640625 > 5
Then xL = 2.375 , xu = 2.5
4th iteration:
2.375+2.5
Xr = 2 = 2.4375
|2.5 – 2.375|= 0.125 > 0.05
Approximate root = Xr = 2.4375

You might also like