现在时间是:
当前位置:首 页 >> 数值分析(英)>> 教学区>> 文章列表

17074223-陈涛涛-作业九: 5.1 to 6.2 Exercises

作者:17074223   发布时间:2019-06-23 19:08:44   浏览次数:28

P252

5.1Exercises:

2. Use the three-point centered-difference formula to approximate f(0), where f(x)=e^x, for

(a) h=0.1 (b) h=0.01 (c) h=0.001.

Solution:

(a) Use the three-point centered-difference formula with h=0.1 to approximate the derivative of f(x)=e^x at x =0. The three-point centered-difference formula evaluates to f(x)(f(x + h) − f(x − h))/2h=(e^(0.1)-e^(-0.1))/0.21.0017. The error is 0.0017.

(b) Use the three-point centered-difference formula with h=0.01 to approximate the derivative of f(x)=e^x at x =0. The three-point centered-difference formula evaluates to f(x)(f(x + h) − f(x − h))/2h=(e^(0.01)-e^(-0.01))/0.021.000017. The error is 0.000017.

(c) Use the three-point centered-difference formula with h=0.1 to approximate the derivative of f(x)=e^x at x =0. The three-point centered-difference formula evaluates to f(x)(f(x + h) − f(x − h))/2h=(e^(0.001)-e^(-0.001))/0.0021.00000015. The error is 0.00000015.

5.1Computer Problems:

1. Make a table of the error of the three-point centered-difference formula for f(0), where f(x)=sinx − cosx, with h=10−1,...,10−12, as in the table in Section 5.1.2. Draw a plot of the results. Does the minimum error correspond to the theoretical expectation?

Code:

function f1=TCF(f,x0,h)

f2=f(x0+h);

f3=f(x0-h);

f1=(f2-f3)/(2*h);

Solution:

(1)>> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=0.1;

>> f1=TCF(f,x0,h)

f1 =

   0.9983

>> t=vpa(f1,14)

t =

0.99833416646828

>> t-1

ans =

-0.0016658335317178973866703017847613

(2)>> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-2;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99998333341667

>> t-1

ans =

-0.000016666583334767892665695399045944

(3)>> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-3;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999983333338

>> t-1

ans =

-0.00000016666662405739884889044333249331

(4) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-4;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999999833289

>> t-1

ans =

-0.0000000016671100055987153609748929738998

(5) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-5;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999999998435

>> t-1

ans =

-0.000000000015653367491097469610394909977913

(6) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-6;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999999997324

>> t-1

ans =

-0.000000000026755486715046572498977184295654

(7) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-7;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999999947364

>> t-1

ans =

-0.00000000052635584779636701568961143493652

(8) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-8;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

0.99999999947364

>> t-1

ans =

-0.00000000052635584779636701568961143493652

(9) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-9;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

1.0000000272292

>> t-1

ans =

0.000000027229219767832546494901180267334

(10) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-10;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

1.0000000827404

>> t-1

ans =

0.000000082740370999090373516082763671875

(11) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-11;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

1.0000000827404

>> t-1

ans =

0.000000082740370999090373516082763671875

(12) >> f=@(x) sin(x)-cos(x);

>> x0=0;

>> h=1e-12;

>> f1=TCF(f,x0,h)

f1 =

   1.0000

>> t=vpa(f1,14)

t =

1.0000333894311

>> t-1

ans =

0.000033389431109753786586225032806396

h

formula

error

1e-1

0.99833416646828

-0.0016658335317178973866703017847613

1e-2

0.99998333341667

-0.000016666583334767892665695399045944

1e-3

0.99999983333338

-0.00000016666662405739884889044333249331

1e-4

0.99999999833289

-0.0000000016671100055987153609748929738998

1e-5

0.99999999998435

-0.000000000015653367491097469610394909977913

1e-6

0.99999999997324

-0.000000000026755486715046572498977184295654

1e-7

0.99999999947364

-0.00000000052635584779636701568961143493652

1e-8

0.99999999947364

-0.00000000052635584779636701568961143493652

1e-9

1.0000000272292

0.000000027229219767832546494901180267334

1e-10

1.0000000827404

0.000000082740370999090373516082763671875

1e-11

1.0000000827404

0.000000082740370999090373516082763671875

1e-12

1.0000333894311

0.000033389431109753786586225032806396

P263

5.2Exercises:

1. Apply the composite Trapezoid Rule with m=1,2, and 4 panels to approximate the integral. Compute the error by comparing with the exact value from calculus.

(b)  π/2  0  cosx dx

Sol:(1)For the composite Trapezoid Rule on[0, π/2], 1 panel means that h=π/2. Theapproximation isπ/2 0 cosx dx π/2/2y0 + y1]= π/4 [cos0+cosπ/2] =π/40.78540. The error is at most (b − a)h^2 /12 |f′′(c)|= π^3/96|-cosc|π^3/96 0.32298.

(2)For the composite Trapezoid Rule on[0, π/2], 2 panel means that h=π/4. Theapproximation isπ/2 0 cosx dx π/4/2y0 + y2+2Σi=1 1yi]= π/8 [cos0+cosπ/2+2cosπ/4] =π/8(1+2)0.94806. The error is at most (b − a)h^2 /12 |f′′(c)|= π^3/384|-cosc|π^3/3840.08074.

(3)For the composite Trapezoid Rule on[0, π/2], 4 panel means that h=π/8. Theapproximation isπ/2 0 cosx dx π/8/2y0 + y1+2Σi=1 3yi]= π/16 [cos0+cosπ/2+2(cosπ/8+cos2π/8+cos3π/8)] 1.37432. The error is at most (b − a)h^2 /12 |f′′(c)|= π^3/1536|-cosc|π^3/15360.02019.

2. Apply the Composite Midpoint Rule with m=1,2, and 4 panels to approximate the integrals in Exercise 1, and report the errors.

Sol:(1)The Composite Midpoint Rule deliversπ/2 0 cosx dxπ/2 *π/4 =π^2/8.

(2) The Composite Midpoint Rule deliversπ/2 0 cosx dxπ/4 *(π/8+3π/8) =π^2/8.

(3) The Composite Midpoint Rule deliversπ/2 0 cosx dxπ/8 *(π/16+3π/16+5π/16+7π/16) =π^2/8.

3. Apply the composite Simpson’s Rule with m=1,2, and 4 panels to the integrals in Exercise 1, and report the errors.

Sol:(1) A one-panel Simpson’s Rule sets h=π/4. The approximation isπ/2  0  cosx dx π/4/3 y0 + y2+4y1]= π/12[cos0+cosπ/2+4cosπ/4]1.0023. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|= π^5/92160|cosc|π^5/921600.00332.

(2) A two-panel Simpson’s Rule sets h=π/8. The approximation isπ/2  0  cosx dx π/8/3 y0 + y2 + 4 Σi=1 2 y2i−1+2Σi=1 y2i]= π/24[cos0+cosπ/2+4(cosπ/8+cos3π/8)+2cosπ/4]1.0001. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|= π^5/1474560|cosc|π^5/14745600.00021.

(3) A four-panel Simpson’s Rule sets h=π/16. The approximation isπ/2  0  cosx dx π/16/3 y0+y8+4Σi=1 8 y2i−1+2Σi=1 7 y2i]= π/48[cos0+cosπ/2+4(cosπ/16+cos3π/16+cos5π/16+cos7π/16)+2(cosπ/8+cosπ/4+cos3π/8)]1.50517. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|= π^5/23592960|cosc|π^5/235929601.2*10^(-5).

4. Apply the composite Simpson’s Rule with m=1,2, and 4 panels to the integrals, and report the errors.

(b) 1 0 dx/1+x^2

Sol: (1) A one-panel Simpson’s Rule sets h=1/2. The approximation is1 0 dx/1+x^2 1/3[y0+y2+4y1]=1/2/3[1+1/2+4*4/5]0.78333. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|0.00034.

(2) A two-panel Simpson’s Rule sets h=1/4. The approximation is1 0 dx/1+x^2 1/4/3[y0+y4+4(y1+y3)+2y2]=1/4/3[1+1/2+4*(1/4+3/4)+2*(1/2)]0.54167. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|2.17*10(-5).

(3) A four-panel Simpson’s Rule sets h=1/8. The approximation is1 0 dx/1+x^2 1/8/3[y0+y8+4(y1+y3+y5+y7)+2(y2+y4+y6)]=1/8/3[1+1/2+4*(1/8+3/8+5/8+7/8)+2(2/8+4/8+6/8)]0.52083. The error cannot be more than (b − a)h^4/180 |f (iv)(c)|1.36*10(-6).

5.2Computer Problems:

1. Use the composite Trapezoid Rule with m=16 and 32 panels to approximate the definite integral. Compare with the correct integral and report the two errors.

(d) 3 1 x^2lnx dx

(h) 1 0 x dx /x^4 + 1

Code:

function t=cTrapezoid(a,b,m,f)

format long;

h=(b-a)/m;

d=f(a);

for i=a+h:h:b-h

   d=d+(2*f(i));

end

d=d+f(b);

t=d*(h/2);

(d) >> f=@(x) x^2*log(x);

>> t=cTrapezoid(f,1,3,16)

t =

  7.009809235924680

>> t=cTrapezoid(f,1,3,32)

t =

  7.001418506166504

>> syms x;

>> f=x^2*log(x);

>> y=int(f)

y =

(x^3*(log(x) - 1/3))/3

>> q=(3^3*(log(3) - 1/3))/3-(1^3*(log(1) - 1/3))/3

q =

   6.9986

>> vpa(q,15)

ans =

6.9986217091241

>> r1=6.9986217091241-7.009809235924680

r1 =

  -0.0112

>> vpa(r1,15)

ans =

-0.0111875268005805

>> r2=6.9986217091241-7.001418506166504

r2 =

  -0.0028

>> vpa(r2,15)

ans =

-0.00279679704240454

(h) >> f=@(x) x/sqrt(x^4+1);

>> t=cTrapezoid(f,0,1,16)

t =

  0.440361182629694

>> t=cTrapezoid(f,0,1,32)

t =

  0.440605407679783

>> syms x;

>> f=x/sqrt(x^4+1);

>> y=int(f)

y =

asinh(x^2)/2

>> q=asinh(1^2)/2-asinh(0^2)/2

q =

   0.4407

>> vpa(q,15)

ans =

0.440686793509772

>> r1=0.440686793509772-0.440361182629694

r1 =

  3.2561e-04

>> r2=0.440686793509772-0.440605407679783

r2 =

  8.1386e-05

2. Apply the composite Simpson’s Rule to the integrals in Computer Problem 1. Use m=16 and 32, and report errors.

Code: function s=cSimpson(f,a,b,m)

format long;

h=(b-a)/m;

d=f(a);

for i=a+h:h:b-h

   d=d+(2*f(i));

end

for i=a+h/2:h:b-h/2

   d=d+(4*f(i));

end

d=d+f(b);

s=d*(h/6);

(d) >> f=@(x) x^2*log(x);

>> s=cSimpson(f,1,3,16)

s =

  6.998621596247109

>> s=cSimpson(f,1,3,32)

s =

  6.998621702062214

>> syms x;

>> f=x^2*log(x);

>> y=int(f)

y =

(x^3*(log(x) - 1/3))/3

>> q=(3^3*(log(3) - 1/3))/3-(1^3*(log(1) - 1/3))/3

q =

   6.9986

>> vpa(q,15)

ans =

6.9986217091241

>> r1=6.9986217091241-6.998621596247109

r1 =

  1.1288e-07

>> r2=6.9986217091241-6.998621702062214

r2 =

  7.0619e-09

(h) >> f=@(x) x/sqrt(x^4+1);

>> s=cSimpson(f,0,1,16)

s =

  0.440686816029813

>> s=cSimpson(f,0,1,32)

s =

  0.440686794915315

>> syms x;

>> f=x/sqrt(x^4+1);

>> y=int(f)

y =

asinh(x^2)/2

>> q=asinh(1^2)/2-asinh(0^2)/2

q =

   0.4407

>> vpa(q,15)

ans =

0.440686793509772

>> r1=0.440686793509772-0.440686816029813

r1 =

 -2.2520e-08

>> r2=0.440686793509772-0.440686794915315

r2 =

 -1.4055e-09

3. Use the composite Trapezoid Rule with m=16 and 32 panels to approximate the definite integral.

(a) 1 0 e^x^2 dx

(f) π 0 cose^x dx

Code: function t=cTrapezoid(f,a,b,m)

format long;

h=(b-a)/m;

d=f(a);

for i=a+h:h:b-h

   d=d+(2*f(i));

end

d=d+f(b);

t=d*(h/2);

(a) >> f=@(x) exp(x^2);

>> t=cTrapezoid(f,0,1,16)

t =

  1.464420310149482

>> t=cTrapezoid(f,0,1,32)

t =

  1.463094102606428

>> syms x;

>> f=exp(x^2);

>> y=int(f)

y =

(pi^(1/2)*erfi(x))/2

>> q=(pi^(1/2)*erfi(1))/2-(pi^(1/2)*erfi(0))/2

q =

   1.4627

>> vpa(q,15)

ans =

1.46265174590718

>> r1=1.46265174590718-1.464420310149482

r1 =

  -0.0018

>> vpa(r1,15)

ans =

-0.00176856424230198

>> r2=1.46265174590718-1.463094102606428

r2 =

 -4.4236e-04

(f) >> f=@(x) cos(exp(x));

>> t=cTrapezoid(f,0,pi,16)

t =

 -0.278012950965426

>> t=cTrapezoid(f,0,pi,32)

t =

 -0.356789537332443

>> syms x;

>> f=cos(exp(x));

>> y=int(f)

y =

cosint(exp(x))

>> q=cosint(exp(pi))-cosint(exp(0))

q =

  -0.3759

>> vpa(q,15)

ans =

-0.37594047455878

>> r1=(-0.37594047455878)-(-0.278012950965426)

r1 =

  -0.0979

>> vpa(r1,15)

ans =

-0.097927523593354

>> r2=(-0.37594047455878)-(-0.356789537332443)

r2 =

  -0.0192

>> vpa(r2,15)

ans =

-0.019150937226337

4. Apply the composite Simpson’s Rule to the integrals of Computer Problem 3, using m=16 and 32.

Code: function s=cSimpson(f,a,b,m)

format long;

h=(b-a)/m;

d=f(a);

for i=a+h:h:b-h

   d=d+(2*f(i));

end

for i=a+h/2:h:b-h/2

   d=d+(4*f(i));

end

d=d+f(b);

s=d*(h/6);

(a) >> f=@(x) exp(x^2);

>> s=cSimpson(f,0,1,16)

s =

  1.462652033425411

>> s=cSimpson(f,0,1,32)

s =

  1.462651763901493

>> syms x;

>> f=exp(x^2);

>> y=int(f)

y =

(pi^(1/2)*erfi(x))/2

>> q=(pi^(1/2)*erfi(1))/2-(pi^(1/2)*erfi(0))/2

q =

   1.4627

>> vpa(q,15)

ans =

1.46265174590718

>> r1=1.46265174590718-1.462652033425411

r1 =

 -2.8752e-07

>> r2=1.46265174590718-1.462651763901493

r2 =

 -1.7994e-08

(f) >> f=@(x) cos(exp(x));

>> s=cSimpson(f,0,pi,16)

s =

 -0.383048399454782

>> s=cSimpson(f,0,pi,32)

s =

 -0.376327835672487

>> syms x;

>> f=cos(exp(x));

>> y=int(f)

y =

cosint(exp(x))

>> q=cosint(exp(pi))-cosint(exp(0))

q =

  -0.3759

>> vpa(q,15)

ans =

-0.37594047455878

>> r1=(-0.37594047455878)-(-0.383048399454782)

r1 =

   0.0071

>> vpa(r1,15)

ans =

0.00710792489600198

>> r2=(-0.37594047455878)-(-0.376327835672487)

r2 =

  3.8736e-04

P268

5.3Exercises:

1. Apply Romberg Integration to find R33 for the integrals.

(c) 1 0 e^x dx

Solution:

h1=1-0=1

h2=1/2

h3=1/4

R11=h1/2(f(a)+f(b))=1/2(1+e)

R21 =h2 /2 (f(a) + f(b) + 2f((a + b)/ 2 ))=1/ 2R11 + h2f((a + b)/ 2 )=1/4(1+e)+1/2e^1/2

R22 =(2^2R21 − R11)/3=1/6(1+e)+2/3e^1/2

R31=1/2R21+h3(f(a+h3)+f(a+3h3))=1/8(1+e)+1/4e^1/2+1/4e^1/4+1/4e^3/4

R32 =(2^2R31 − R21)/3=1/12(1+e)+1/6e^1/2+1/3e^1/4+1/3e^3/4

R33 =(4^2R32 − R22)/4^2-1=7/90(1+e)+2/15e^1/2+16/45e^1/4+16/45e^3/4

P291

6.1Exercises:

3. Use separation of variables to find solutions of the IVP given by y(0)=1 and the following differential equations: (a) y=t (b) y=t2y (c) y=2(t + 1)y (d) y=5t4y (e) y=1/y2 (f) y=t3/y2.

Sol:

(a)

y'=t,dy/dt=t,y=t^2/2+c;

y(0)=1,c=1;

So y=t^2/2+1.

(b)

y’=t^2*y

dy/dt=t^2*y

dy/y=t^2*dt

ln|y|=1/3t^3+c

Since y(0)=1ln|y|=c, so c=0

So,y=e^(1/3)t^3

(c)

y’=2(t+1)y

dy/dt=2y(t+1)

dy/2y=(t+1)dt

(1/2)ln|y|=(1/2)t^2+t+c

Since y(0)=1,c=0

So,y=e^(t^2+2t)

(d)

dy/dt=5t^4y

dy/y=5t^4dt

ln|y|=t^5+c

Since y(0)=1,c=0

So ,y=e^(t^5)

(e)

dy/dt=1/y^2

1/3y^3=t+c

Since y(0)=1,c=1/3

So,y^3=3*t+1

(f)

dy/dt=t^3/y^2

y^2dy=t^3dt

1/3y^3=1/4t^4+c

Since y(0)=1,c=1/3

So 4y^3=3t^4+4

5. Apply Euler’s Method with step size h=1/4 to the IVPs in Exercise 3 on the interval [0,1]. List the wi,i =0,...,4, and find the error at t =1 by comparing with the correct solution.

Sol:

t0=0,t1=0.25,t2=0.5,t3=0.75,t4=1

(a)

w0=y0=1

w1=w0+1/4f(t0,w0)=1+1/4f(0,1)=1

w2=w1+1/4f(t1,w1)=1+1/4f(0.25,1)=17/16

w3= w2+1/4f(t2,w2)=17/16+1/4f(0.5,17/16)=19/16

w4= w3+1/4f(t3,w3)=19/16+1/4f(0.75,19/16)=11/8

e=|y-w4|=|3/2-11/8|=1/8

(b)

w0=y0=1

w1=w0+0.25f(t0,w0)=1

w2= w1+1/4f(t1,w1)=65/64

w3= w2+1/4f(t2,w2)=1105/1024

w4= w3+1/4f(t3,w3)=80665/75536

e=|y-w4|=|e^(1/3)-w4|= 0.327711027077193

(c)

w0=y0=1

w1=w0+0.25f(t0,w0)=3/2

w2= w1+1/4f(t1,w1)=39/16

w3= w2+1/4f(t2,w2)=273/64

w4= w3+1/4f(t3,w3)=4095/512

e=|y-w4|=|e^3-w4|= 12.087490048187668

(d)

w0=y0=1

w1=w0+0.25f(t0,w0)=1

w2= w1+1/4f(t1,w1)=1029/1024

w3= w2+1/4f(t2,w2)= 71001/65536

w4= w3+1/4f(t3,w3)= 101460429/67108864

e=|y-w4|=|e-w4|= 1.206403621133110

(e)

w0=y0=1

w1=w0+0.25f(t0,w0)=5/4

w2= w1+1/4f(t1,w1)=141/100

w3= w2+1/4f(t2,w2)= 3053221/1988100

w4= w3+1/4f(t3,w3)= 1.641746764812362

e=|y-w4|=|4^(1/3)|= 0.054345712844163

(f)

w0=y0=1

w1=w0+0.25f(t0,w0)=1

w2= w1+1/4f(t1,w1)= 257/256

w3= w2+1/4f(t2,w2)= 1.034913532472104

w4= w3+1/4f(t3,w3)= 1.133386191966365

e=|y-w4|=0.071684940121250

P301

6.2Exercises:

1. Using initial condition y(0)=1 and step size h=1/4, calculate the Trapezoid Method approximation w0,...,w4 on the interval[0,1]. Find the error at t =1 by comparing with the correct solution found in Exercise 6.1.3. (a) y=t (b) y=t2y (c) y=2(t + 1)y (d) y=5t4y (e) y=1/y2 (f) y=t3/y2

Solution:

w0=y0;

wi+1=wi+h/2(f(ti,wi)+f(ti+h,wi+hf(ti,wi)))

(a)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=33/32

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=9/8

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=41/32

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=3/2

e=|y-w4|=0

(b)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=129/128

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=274641/262144

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=622061865/536870912

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=1.405352734454937

e=|y-w4|=0.009740309368848

(c)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=1.718750000000000

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=3.303222656250000

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=7.070960998535156

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=16.793532371520996

e=|y-w4|=3.292004551666672

(d)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=1.002441406250000

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=1.044237840920687

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=1.307663471185293

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=2.706793149522585

e= |y-w4|=0.011488678936460

(e)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=1.205000000000000

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=1.356993862239376

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=1.480971731811849

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=1.587101493145249

e=|y-w4|=2.995588229504076e-04

(f)

w0=1

w1= w0+h/2(f(t0,w0)+f(t0+h,w0+hf(t0,w0)))=1.001953125000000

w2= w1+h/2(f(t1,w1)+f(t1+h,w1+hf(t1,w1)))=1.019342601468375

w3= w2+h/2(f(t2,w2)+f(t2+h,w2+hf(t2,w2)))=1.082264953617726

w4= w3+h/2(f(t3,w3)+f(t3+h,w3+hf(t3,w3)))=1.218241931698513

e=|y-w4|=0.013170799610898







上一篇:没有了    下一篇:没有了

Copyright ©2019    计算数学达人 All Right Reserved.

技术支持:自助建站 | 领地网站建设 |短信接口 |燕窝 版权所有 © 2005-2019 lingw.net.粤ICP备16125321号 -5