Metodos Numericos
Enviado por diegoquizhpi • 11 de Diciembre de 2014 • 1.440 Palabras (6 Páginas) • 154 Visitas
CHAPTER 22
22.1 Analytical solution:
The first iteration involves computing 1 and 2 segment trapezoidal rules and combining them as
and computing the approximate error as
The computation can be continues as in the following tableau until a < 0.5%.
1 2 3
n a 1.6908% 0.0098%
1 27.62500000 25.87500000 25.83456463
2 26.31250000 25.83709184
4 25.95594388
The true error of the final result can be computed as
22.2 Analytical solution:
1 2 3 4
t 5.8349% 0.1020% 0.0004%
n a 26.8579% 0.3579% 0.0015862%
1 90.38491615 43.57337260 41.21305531 41.17125852
2 55.27625849 41.36057514 41.17191160
4 44.83949598 41.18370307
8 42.09765130
22.3
1 2 3
n a 7.9715% 0.0997%
1 1.34376994 1.97282684 1.94183605
2 1.81556261 1.94377297
4 1.91172038
22.4 Change of variable:
Therefore, the transformed function is
Two-point formula:
Three-point formula:
Four-point formula:
22.5 Change of variable:
Therefore, the transformed function is
Two-point formula:
Three-point formula:
Four-point formula:
22.6 Change of variable:
Therefore, the transformed function is
Five-point formula:
22.7 Here is the Romberg tableau for this problem.
1 2 3
n a 5.5616% 0.0188%
1 224.36568786 288.56033084 289.43080513
2 272.51167009 289.37640049
4 285.16021789
Therefore, the estimate is 289.430805.
22.8 Change of variable:
Therefore, the transformed function is
Two-point formula:
The remaining formulas can be implemented with the results summarized in this table.
n Integral t
2 1.5 39.95%
3 3.1875 27.60%
4 2.189781 12.34%
5 2.671698 6.95%
6 2.411356 3.47%
Thus, the results are converging, but at a very slow rate. Insight into this behavior can be gained by looking at the function and its derivatives.
We can plot the second derivative as
The second and higher derivatives are large. Thus, the integral evaluation is inaccurate because the error is related to the magnitudes of the derivatives.
22.9 (a)
We can use 8 applications of the extended midpoint rule.
This result is close to the analytical solution
(b)
For the first part, we can use 4 applications of Simpson’s 1/3 rule
For the second part,
We can use the extended midpoint rule with h = 1/8.
The total integral is
This result is close to the analytical solution of 0.4.
(c) Errata: In the book’s first printing, this function was erroneously printed as
The correct function, which appears in later printings, is
Solution:
For the first part, we can use Simpson’s 1/3 rule
For the second part,
We can use the extended midpoint rule with h = 1/8.
The total integral is
This result is close to the analytical solution of 0.920151.
(d)
For the first part, we can use 4 applications of Simpson’s 1/3 rule
For the second part,
We can use the extended midpoint rule with h = 1/8.
The total integral is
(e) Errata: In the book’s first printing, this function was erroneously printed as
The correct function, which appears in later printings, is
Solution:
For the first part, we can use 4 applications of Simpson’s 1/3 rule
For the second part,
We can use the extended midpoint rule with h = 1/8.
The total integral is
This is close to the exact value of 0.5.
22.10 (a) Here is a VBA program to implement the algorithm from Fig. 22.1a. It is set up to evaluate the integral in the problem statement,
Option Explicit
Sub TrapTest()
Dim a As Double, b As Double
Dim n As Integer
a = 0
b = 1
n = 4
MsgBox TrapEq(n, a, b)
End Sub
Function TrapEq(n, a, b)
Dim h As Double, x As Double, sum As Double
Dim i As Integer
h = (b - a) / n
x = a
sum = f(x)
For i = 1 To n - 1
x = x + h
sum = sum + 2 * f(x)
Next i
sum = sum + f(b)
TrapEq = (b - a) * sum / (2 * n)
End Function
Function f(x)
f = x ^ 0.1 * (1.2 - x) * (1 - Exp(20 * (x - 1)))
End Function
When the program is run, the result is
The percent relative error can be computed
...