Differences between revisions 3 and 4
 ⇤ ← Revision 3 as of 2008-01-18 15:55:10 → Size: 2585 Editor: DevonMcCormick Comment: Link to another Simpson-related item ← Revision 4 as of 2008-12-08 10:45:53 → ⇥ Size: 2585 Editor: anonymous Comment: converted to 1.6 markup Deletions are marked like this. Additions are marked like this. Line 14: Line 14: The foregoing phrases (based on the development in [:Phrases/References#7:''Calculus ''[6]]) provide the weights for Simpson's Rule and for higher-order polynomial approximations as illustrated below: {{{ The foregoing phrases (based on the development in [[Phrases/References#7|''Calculus ''[6]]]) provide the weights for Simpson's Rule and for higher-order polynomial approximations as illustrated below: {{{ Line 53: Line 53: An example of integration by Simpson's method can be found here: Self:JPhrases/SimpsonIntegraton. An example of integration by Simpson's method can be found here: [[JPhrases/SimpsonIntegraton]].

 m0=: W=: integ p. +: >. 1: Weights for 1+2*y points; try m0 3x m1=: integ=: pint"1@%.@vm Integral of inverse of Vandermonde m2=: vm=: ^~/~@i.@>:@+: Transposed Vm of order 1+2*y m3=: pint=: 0: , ] % >:@i.@# Polynomial integral of coefficients y m4=: pder=: 1: }. ] * i.@# Polynomial derivative of coefficients y d5=: EW=: +/@(-@take {."0 1 ]) Extended weights (x groups of #y points) d6=: take=:i.@[ (] + <:@] * [) #@] Amounts of overtake

The integral of a function f from a to b  is called its quadrature. Quadrature can be approximated by a weighted sum of the values of the function on a uniform grid from a to b .  Use of the weights (1 4 1)%3 on a grid of three points is equivalent to integrating the parabola (polynomial of order 2) fitted to the function at the points. Use of these weights is referred to as an application of Simpson's Rule.

The foregoing phrases (based on the development in ''Calculus ''[6]) provide the weights for Simpson's Rule and for higher-order polynomial approximations as illustrated below:

```   ,.(W 1x);(W 2x);(W 3x)
+---------------------------------------------+
|1r3 4r3 1r3                                  |
+---------------------------------------------|
|14r45 64r45 8r15 64r45 14r45                 |
+---------------------------------------------|
|41r140 54r35 27r140 68r35 27r140 54r35 41r140|
+---------------------------------------------+

,.(3*W 1x);(45*W 2x);(140*W 3x)
+-----------------------+
|1 4 1                  |
+-----------------------|
|14 64 24 64 14         |
+-----------------------|
|41 216 27 272 27 216 41|
+-----------------------+```

If weights for points are applied by dividing the grid into groups of n points, the weights are applied as illustrated below for four groups of Simpson's Rule:

```   (-3 5 7 9) {."0 1 w=: 1 4 1
1 4 1 0 0 0 0 0 0
0 0 1 4 1 0 0 0 0
0 0 0 0 1 4 1 0 0
0 0 0 0 0 0 1 4 1

+/(-3 5 7 9) {."0 1 w
1 4 2 4 2 4 2 4 1```

The function EW provides such extended weights as illustrated below:

```   3 * 5 EW W 1
1 4 2 4 2 4 2 4 2 4 1

45 * 4 EW W 2
14 64 24 64 28 64 24 64 28 64 24 64 28 64 24 64 14```

An example of integration by Simpson's method can be found here: JPhrases/SimpsonIntegraton.

JPhrases/QuadratureSimpson (last edited 2008-12-08 10:45:53 by anonymous)