newton-cotes y reglas compuestas.disi.unal.edu.co/profesores/jeortizt/metnum/archivos/08b.%20... ·...
TRANSCRIPT
![Page 1: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/1.jpg)
8. INTEGRACIÓN NUMÉRICA:
Newton-Cotes y Reglas Compuestas.
Jorge Eduardo Ortiz Triviño
http://www.docentes.unal.edu.co/jeortizt/
![Page 2: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/2.jpg)
Organización general
• Errores en los cálculos numéricos
• Raíces de ecuaciones no-lineales
• Sistemas de ecuaciones lineales
• Interpolación y ajuste de curvas
• Diferenciación
• Integración
– Fórmulas de Newton-Cotes
– Reglas compuestas
• Ecuaciones diferenciales ordinarias
![Page 3: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/3.jpg)
Integración numérica
Al igual que antes...
![Page 4: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/4.jpg)
Integración numérica
Al igual que antes...
1. Interpolamos mediante un polinomio
2. Calculamos la integral sobre el polinomio
![Page 5: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/5.jpg)
Integración: Newton-Cotes
• Con polinomios de orden 1:
método trapezoidal
• Con polinomios de orden 2:
regla de Simpson
...
• Con polinomios de orden 4:
regla de Milne
![Page 6: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/6.jpg)
Newton-Cotes: trapezoidal
Aproximamos:
1
0
1
0
)()()( 101
00
10
1
x
x
x
x
dxxfxx
xxxf
xx
xxdxxf
![Page 7: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/7.jpg)
Newton-Cotes: trapezoidal
Resolviendo:
)()(2
)( 1001
1
0
xfxfxx
dxxf
x
x
![Page 8: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/8.jpg)
Newton-Cotes: trapezoidal
Resolviendo:
)()(2
)( 10
1
0
xfxfh
dxxf
x
x
![Page 9: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/9.jpg)
Regla del trapecio Utilizando un polinomio interpolante lineal de Lagrange.
1
01
00
10
1 xfxx
xxxf
xx
xxxP
1010
01
1
01
00
10
1
22xfxf
hxfxf
xx
dxxfxx
xxxf
xx
xxdxxf
b
a
b
a
Donde h = x1 – x0 =
Esta fórmula vale cuando
f(x) tiene valores positivos.
Da valores exactos para
polinomios de grado 1.
x0 = a x1 = b
P1 f
![Page 10: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/10.jpg)
¿Es claro que …?
Muestre que se cumple la regla del trapecio
1010
01
1
01
00
10
1
22xfxf
hxfxf
xx
dxxfxx
xxxf
xx
xxdxxf
b
a
b
a
![Page 11: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/11.jpg)
Newton-Cotes: Simpson
Tomamos un punto intermedio y aprox.:
dxxfxxxx
xxxx
xfxxxx
xxxx
xfxxxx
xxxxdxxf
x
x
x
x
)())((
))((
)())((
))((
)())((
))(()(
21202
10
12101
20
02010
212
0
2
0
![Page 12: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/12.jpg)
Newton-Cotes: Simpson
Resolviendo:
)()(4)(3
)( 210
2
0
xfxfxfh
dxxf
x
x
![Page 13: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/13.jpg)
Regla de Simpson La regla se Simpson se obtiene suponiendo el segundo polinomios
de Lagrange con los nodos x0 = a, x2 = b, x1 = a + h, h = (b – a)/2.
210
2
1202
101
2101
200
2010
21
43
xfxfxfh
dxxfxxxx
xxxxxf
xxxx
xxxxxf
xxxx
xxxxdxxf
b
a
b
a
Donde se han
despreciado los términos
de error.
La fórmula es exacta para
polinomios de hasta
tercer grado. x0 = a x2 = b
P3 f
x1
![Page 14: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/14.jpg)
Comparación
f(x) x 2̂ x 4̂ 1/(x + 1) sqrt(1 + x2) sen x exp(x)
Valuación exacta 2.667 6.400 1.099 2.958 1.416 6.389
Trapecio 4.000 16.000 1.333 3.236 0.909 8.389
De Simpson 2.667 6.667 1.111 2.964 1.425 6.421
Comparación entre el valor exacto, la regla del trapecio y
la regla de Simpson para diferentes funciones en el
intervalo [0 , 2].
![Page 15: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/15.jpg)
Newton-Cotes: Milne
De forma similar, dividiendo el intervalo en 4
partes pero utilizando solo algunas:
)(2)()(23
4)( 321
4
0
xfxfxfh
dxxf
x
x
![Page 16: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/16.jpg)
Integración: más puntos?
• Al evaluar más puntos de la función en el
intervalo dado, podemos obtener mayor
exactitud
![Page 17: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/17.jpg)
Integración: más puntos?
• Al evaluar más puntos de la función en el
intervalo dado, podemos obtener mayor
exactitud
• Pero los polinomios de alto orden nos
traen problemas numéricos...
![Page 18: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/18.jpg)
Integración: más puntos?
• Al evaluar más puntos de la función en el
intervalo dado, podemos obtener mayor
exactitud
• Pero los polinomios de alto orden nos
traen problemas numéricos...
• ¿Y si integramos un polinomio de bajo
orden por cada segmento?
![Page 19: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/19.jpg)
Reglas compuestas
Elegimos n puntos en el intervalo e
integramos mediante:
dxxfdxxfdxxfdxxfn
n
n x
x
x
x
x
x
x
x
1
2
1
1
00
)()()()(
![Page 20: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/20.jpg)
Reglas compuestas
Elegimos n puntos en el intervalo e
integramos mediante:
¿Cómo resolvemos estas integrales?
dxxfdxxfdxxfdxxfn
n
n x
x
x
x
x
x
x
x
1
2
1
1
00
)()()()(
![Page 21: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/21.jpg)
Reglas compuestas: trapecios
Cada segmento se integra por trapecios:
)()(2
)()(2
)()(2
)(
1
21
10
0
nn
x
x
xfxfh
xfxfh
xfxfh
dxxfn
![Page 22: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/22.jpg)
Reglas compuestas: trapecios
Simplificando:
)()(2)(2)(2
)( 110
0
nn
x
x
xfxfxfxfh
dxxfn
![Page 23: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/23.jpg)
Reglas compuestas: Simpson
De forma similar a trapecios por segmento:
)()(4)(2
)(2)(4)(3
)(
12
210
0
nnn
x
x
xfxfxf
xfxfxfh
dxxfn
![Page 24: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/24.jpg)
Ejemplo: Integración numérica
compuesta
76958.56´43
2 4204
0 eeedxex
Integrando ex por Simpson en [0,4]
El error es: Abs[53.59815 – 56.76958] = +3.17143
Separando en dos integrales:
86385.53
4243
1
43
14
3
1
4320
43220
4
2
2
0
4
0
eeeee
eeeeee
dxedxedxe xxx
![Page 25: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/25.jpg)
Dividiendo en 4 intervalos
61622.53
42424243
1
46
14
6
1
46
14
6
1
4320
4332
20
4
3
3
2
2
1
1
0
4
0
27
25
23
21
27
25
23
21
eeeeeeeee
eeeeee
eeeeee
dxedxedxedxedxe xxxxx
El error es: Abs[53.59815 – 53.61622] =
+0.01807
![Page 26: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/26.jpg)
Regla compuesta de Simpson
bfxfxfafh
dxxfn
j
j
n
j
j
b
a
2/
0
12
12/
0
2 423
Teorema. Sea f C4[a, b], n par, h = (b – a)/n, y xj = a + jh para
cada j = 0, 1, 2, ... n . La regla de Simpson para n subintervalos
puede escribirse como:
x0 = a xn = b
y= f(x)
x2 x2j-1 x2j x2j+1
![Page 27: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/27.jpg)
Regla compuesta del trapecio
bfxfafh
dxxfn
j
j
b
a
1
1
22
x0 = a xn = b
y= f(x)
x1 xj-1 xj xn–1
Teorema. Sea f C4[a, b], n par, h = (b – a)/n, y xj = a + jh para
cada j = 0, 1, 2, ... n . La regla del trapecio para n subintervalos
puede escribirse como:
![Page 28: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/28.jpg)
Regla compuesta del punto
medio
2/
0
22n
j
j
b
axfhdxxf
x0 = a xn+1 = b
y= f(x)
x0 xj-1 xj xn x1 xj+1
Teorema. Sea f C4[a, b], n par, h = (b – a)/(n+2), y xj = a +
(j+1)h para cada j = –1, 0, 1, 2, ... n+1. La regla de compuesta
del punto medio para n subintervalos puede escribirse como:
![Page 29: Newton-Cotes y Reglas Compuestas.disi.unal.edu.co/profesores/jeortizt/MetNum/Archivos/08B.%20... · Trapecio 4.000 16.000 1.333 3.236 0.909 8.389 De Simpson 2.667 6.667 1.111 2.964](https://reader033.vdocuments.site/reader033/viewer/2022052320/5c5d427209d3f2d72f8cb1a2/html5/thumbnails/29.jpg)
Datos con espaciamiento
irregular
Si los datos están espaciados de forma irregular, como en el caso de datos
experimentales, la integración puede llevarse a cabo mediante la aplicación de la
regla del trapecio a cada subintervalo.
2
...22
1212
101
nnn
xfxfh
xfxfh
xfxfhI
Donde hi = ancho del segmento i.