Getting comfortable with objects.
The function form for a subscripted variable
, and
the summation object
can
be used to construct a power series function.
For example, the coefficients for the exponential series are
reciprocals of factorials.
They can be used together to make a familiar polynomial
approximation to
.
![[Graphics:../Images/LagrangePolyMod_gr_80.gif]](../Images/LagrangePolyMod_gr_80.gif)
Our use of the function for a subscripted variable precludes some
awkward subscripts in the list of data points which we want to label
with the starting subscript zero, for example
for
.
Note that the "points" require a data structure that is a list of
"pairs" of numbers. The mathematics we use uses individual values
such as
.
The abscissas and ordinates are extracted with the assistance of the
"Transpose" operator
Using the selection operation for matrices we can get
the
out
of the "list" with the command
That's o.k. but you need to add one to the "matrix subscript" to get the desired "abscissa." To make things nicer we used a function for a subscripted variable.
Compare this with the commands for working with "matrix subscripts." Notice the difference in the range: 0,1,2,3,4 for the subscripted variable and 1,2,3,4,5 for the "table" which is stored in a "list."
The product object
is
probably new to you. It can be used to construct a
polynomial with known roots.
![[Graphics:../Images/LagrangePolyMod_gr_103.gif]](../Images/LagrangePolyMod_gr_103.gif)
(c) John H. Mathews 2004