Академический Документы
Профессиональный Документы
Культура Документы
Numerical Analysis-3
Prepared by Eng. Maged Kamel
Prepared By Eng Maged kamel
What a difficult
equation! ,unable to
solve what can I do?
Give me a point,
with known both
y value and its
derivative value
as well
What is that called grand Father ?
That is called
linear
approximation.
You treat the function as linear one for any point
needed get , the y value from that line.
Linear Approximation.
Linear approximation is the y value on a point b
k n o w i n g t h e v a l u e x o f a n o t h e r p o i n t c a l l e d a a n d i t ’s
y value.
L(x=xb)=f(a)+f’(a)(xb -xa)
Application of the linear approximation.
Solution
f’(x=2)= 2*(2)=4
L(x=2.50)=4+(4)*(2.50-2.00)=4+4*0.50=6
Solution
L(x) =f (a)+f’ (a)(xb -xa)
3
The f(x)= 𝑋 =𝑋1/3 put x=8
1 1
f’(x)=( . 1. 3 )
3 𝑥2
1
(1−3) 3
f’(x)=(1/3)*(X)^(1/3-1)=(1/3) ∗ 𝑋 =f (x=8)= 8⋅ =2.
1
f’(8)=(1/3)*(1/(8*8)^1/3) =
12
1
L(x=8)=2+( )*(8.00-8.00)=2
12
using the formula for x=8.20
1
f(x=8)=2.00 ,f’(8.00)=
12
1 1
L(x=8.20)=2+( )*(8.20-8.00)=2+( )*0.20= 2.0166
12 12
3
Comparing with true value of 8.20 =6.2.0165 Error =0
As for x b=25
L(x)=f(x= 8)+f ’(8)*(28-8)
1
L(x=25)= 2+(1/12)*(25 -8)=2+ .17= 3.41666
12
3
Comparing with true value of 25.0 = 2.924240 Error =2.924-
3.41666=-0.49266
Example #4
Use linear approximation method to find the value of
Π
f(x ) =cos x at 𝑎𝑡 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑝𝑜𝑖𝑛𝑡 at
3
Π
x= 𝑎𝑛𝑑 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒 𝑡ℎ𝑒 𝑟𝑒𝑙𝑎𝑡𝑖𝑣𝑒 𝑒𝑟𝑟𝑜𝑟 %
4
Solution
f(x)= cos (x) f’(x)=d cos(x)/dx =-sin(x)
Π Π Π Π Π
L(x) =f(x= ) =f(x= )+f’(x= )*( - )
3 4) 4 3 4
Π Π Π 𝜋
f(x= ) =cos (x= )+(-sin(x= )*( )
3 4 4 12
=0.707+ (-0.707*0.5555)=0.7070.1851666=0.5128
Π
Actual value of f(x= )=0.50
3
Step -1 choose x1 and get f(x1) value and f’(x1)-Then for y =0 which is y value for point
x2 on the line - 0=f(x1)+f’(x1)(x2-x1) then X2=X1+f(x1)/f’(x1) point 2 obtained if close to
real root point then f(x2) is close to zero.
Else repeat by putting x2 value in lieu of x1 in the previous expression and get X3
continue the process .
Newton- Raphson expression for Root finding
Solution
f(x)=X^3-3x-5
f’(x)=3x^2-3
Use x1=2.4583 from 1st iteration result
f(2.4583)=2.4583^3-3*2.4583-5 =2.48119
f’(2.4583) = 3(2.4583)^2-3 =15.1297
X2=2.4583-(2.48119/15.1297)=2.2943
4rth iteration
f’(1.034936)=(1.034936+1). 𝑒 1.03496=5.7282
5th iteration
x4=+1.034936-(0.9133/5.7282)=0.875502
New x value x4=+0.875502 f(0.875502)=0.875502. 𝑒 0.875502 -2
=0.1013
x5=+0.875502-(0.1013/4.5014)=0.853003
which is giving f(x)=0.0017 close to zero
Modified Newton Raphson Method
A simple modification to the standard Newton method for approximating the root of a Multiple
root function is described and analyzed. For the same number of function and derivative
evaluations, the modified method converges faster,
Example # 7 let f(x) =𝑒 𝑥 -3𝑥 2 to an accuracy of 3 digits , root is between 0.50 &1
.
Solution
f(x) = 𝑒 𝑥 -3𝑥 2
f’(x)= 𝑒 𝑥 -6 x.
f’’(x )= 𝑒 𝑥 -6
Solution:
By analytical method (x-1)*(x-1)*(x-3)=0 is a solution for that equation
Using x0=0 for both Newton and Modified Newton method , The
Convergence using the modified equation occurs after 4 iterations
For x0=4 as a trial for other
root