Jump to content

University of Florida/Egm6341/s10.team2.niki/HW3

From Wikiversity

Problem Statement

[edit | edit source]

Pg. 17-2

See also HW1-problem 8[[1]] Using the error estimates of

  • Taylor Series
  • Composite Trapezoidal rule
  • Composite Simpson's rule

estimate such that

Problem Solution

[edit | edit source]
Solution: Taylor series
[edit | edit source]

Error is defined as

For the Taylor series, from the discussion on p6-4, we know that the error is nothing but the remainder of the Taylor series integrated over the given interval i.e

where

(1 p2-3)

For the given function the error is

(2)

Using the Integral Mean Value Theorem, we have

(3)

integrating we get,

(4)

This function has a minimum when and maximum when thus we have

(5)

Setting the upper bound of the error to we have

(6)

Solving this equation for n we get

(A)

Solution:Composite Trapezoidal rule
[edit | edit source]

From the discussion on page 16-3 we have

(1)

where  for 

For the given function , we have

(2)

Evaluating over the given interval it is seen that the function has maximum value at

(3)

Setting the error to the and solving for we get

(B)

Solution :Composite Simpson's Rule
[edit | edit source]

We have from p 17-2, the error estimate of the Composite Simpson's rule as

(1)

where  for 

For the given function , we have

(2)

Evaluating over the given interval it is seen that the function has maximum value at

(3)

Setting the error to the and solving for we get

(c)

Part 2:Numerical determination of power of h

[edit | edit source]

In order to verify the power of in the error, data from Problem 8 of HW1 is used.

In the case of a Semilog plot (log(y) vs x), an equation of the form


such that

From the above equation it is seen that if the plot on a semilog graph is a straight line then the relationship between the two variables is exponential.

A log-log plot(log(y) vs log(x)) is a similar plot, for which the equation is of the form


such that,

This discussion is used in the interpretation of the graphs given below.

It is readily seen that the slope of the line in the log-log graph is the power of the x variable.

Composite trapezoidal Rule

[edit | edit source]

Given below is the data from the numerical evaluation of the given function using Composite Trapezoidal Rule.

Composite Trapezoidal Rule

No. of terms

Absolute Error

2

1.3282917278

0.5

4

1.3205046195

0.25

8

1.3185530869

0.125

16

1.3180649052

0.0625

32

1.3179428411

0.03125

64

1.3179123240

0.015625

128

1.3179046946

0.0078125

256

1.3179027872

0.00390625

512

1.3179023104

0.001953125

1024

1.3179021912

0.000976563

First we plot a semilog graph for the data. The graph is shown below:

The graph is not a straight line which implies that the relationship between and is not exponential. Hence we plot a log-log graph as below:

This is seen to be linear. A straight line if fitted to the data the equation of which is given above. From the discussion above, we see that the slope of line is 2.1447 which is very close to the analytical value of 2.

Composite Simpson's Rule

[edit | edit source]

Given below is the data obtained from HW1 for the COmposite Simpsons Rule.

Composite Simpson's Rule

No. of terms

Absolute Error

2

1.318008666

0.5

4

1.317908917

0.25

8

1.317902576

0.125

16

1.317902178

0.0625

Plotting a semilog graph of against we see that it is non-linear as in the case of the Composite Trapezoidal Rule.

Thus, plotting the log-log graph as below,

we see that the slope of the line is 4.0881 which is very close to the analytically determined value of 4.

Taylor Series

[edit | edit source]

Given below is the data for the Taylor series method. Eventhough is not used in the Taylor series method,defining based on the number of terms of the series, it is seen that the error and h are not related exponentially or by a power relation i.e. both semilog and log log plots are not linear.

Taylor Series

No. of terms

Absolute Error

2

1.2500000

0.5

4

1.3159722222

0.25

8

1.3179018152

0.125

16

1.3179021515

0.0625

32

1.3179021515

0.03125

--Egm6341.s10.team2.niki 08:10, 17 February 2010 (UTC)