Solution of Equations & Differentiation(Numerical Method)

Bisection Method

ex=x

Use bisection method to find a root on the interval [0,1]

Solution:

Let f(x)=exx,x[0,1]

f is continuos and since f(0)=1 and f(1)=0.6321, by the Intermediate Value Theorem, there exists a root in [0,1]

Let a(0)=0 and b(0)=1

ka(k)f(a(k))b(k)f(b(k))a(k)+b(k)2f(a(k)+b(k)2)00110.63210.50.1065

Compare f(a(k))|f(a(k)+b(k)2)|f(b(k)) and choose the two value with opposite sign and insert into the next row

1|0.1065|0.6321 opposite sign 

Let a(1)=0.5 and b(1)=1

ka(k)f(a(k))b(k)f(b(k))a(k)+b(k)2f(a(k)+b(k)2)10.50.106510.63210.750.2776

Compare f(a(k))|f(a(k)+b(k)2)|f(b(k))
0.1065|0.2776opposite sign|0.6321

Let a(2)=0.5 and b(2)=0.75

ka(k)f(a(k))b(k)f(b(k))a(k)+b(k)2f(a(k)+b(k)2)20.50.10650.750.27760.6250.0897

Compare f(a(k))|f(a(k)+b(k)2)|f(b(k))
0.1065|0.0897opposite sign|0.2776

Let a(3)=0.5 and b(3)=0.625

ka(k)f(a(k))b(k)f(b(k))a(k)+b(k)2f(a(k)+b(k)2)30.50.10650.6250.0897

**To approximate how many iterations will bisection method get to a certain accuracy**
 Use the formula :ba2n>ε(accuracy) 

Assume ε=104,x[0,1], a=0,b=1

By applying the formula:

102n>104nlog2>log1104n>13.2877n14

Approximately, 14 iterations will get an accuracy of 104


Newton's Method

f(x)=x3cosx

Use Newton's method to find x2, with x0=1

Solution:

General Formula: xk+1=xkf(xk)f(xk)

Step 1: Find the derivative of f(x)

f(x)=3x2+sinx

Step 2: Apply the general formula with k=0,1,2,3,...

When k=0,

x1=x0(x0)3cos(x0)3(x0)2+sin(x0)=(1)(1)3cos(1)3(1)2+sin(1)=0.88033290

When k=1,

x2=x1(x1)3cos(x1)3(x1)2+sin(x1)=(0.88033290)(0.88033290)3cos(0.88033290)3(0.88033290)2+sin(0.88033290)=0.865684


Secant Method

f(x)=x26,x0=3,x1=2

Use Secant method to find x3

Solution:

General Formula: xk+1=xkxkxk1f(xk)f(xk1)f(xk)

Apply the general formula with k=1,2,3,...

When k=1,

x2=x1x1x0f(x1)f(x0)f(x1)=2232(3)(2)=2.4

When k=2,

x3=x2x2x1f(x2)f(x1)f(x2)=2.42.420.24(2)(0.24)=2.454545



Richardson's Extrapolation

f(x)=x2cosx

Find an approximation to f(1.0) with Richardson's extrapolation with h=0.1 to an order O(h8)

Solution:

hN1(h)=f(1.0+h)f(1.0h)2h,O(h2)N2(h)=22N1(h2)N1(h)221,O(h4)N3(h)=24N2(h2)N2(h)241,O(h6)N4(h)=26N3(h2)N3(h)261,O(h8)0.1N1(0.1)=f(1.0+0.1)f(1.00.1)2(0.1)0.05N1(0.05)=f(1.0+0.05)f(1.00.05)2(0.05)N2(0.1)=22(N1(0.05))(N1(0.1))2210.025N1(0.025)=f(1.0+0.025)f(1.00.025)2(0.025)N2(0.05)=22(N1(0.025))N1(0.05)221N3(0.1)=24(N2(0.05))N2(0.1)2410.0125N1(0.0125)=f(1.0+0.0125)f(1.00.0125)2(0.0125)N2(0.025)=22(N1(0.0125))N1(0.025)221N3(0.05)=24(N2(0.025))N2(0.05)241N4(0.1)=26(N3(0.05))N3(0.1)261


hN1(h)=f(1.0+h)f(1.0h)2h,O(h2)N2(h)=22N1(h2)N1(h)221,O(h4)N3(h)=24N2(h2)N2(h)241,O(h6)N4(h)=26N3(h2)N3(h)261,O(h8)0.1N1(0.1)=0.2267360.05N1(0.05)=0.236031N2(0.1)=0.2391290.025N1(0.025)=0.238358N2(0.05)=0.239134N3(0.1)=0.2391340.0125N1(0.0125)=0.238940N2(0.025)=0.239134N3(0.05)=0.239134N4(0.1)=0.239134


f(1.0)0.239134



Comments

Popular Posts