sample =: list of ((first
of right) + h*/ indices)
d =: behead - curtail
mids =: half of (behead + curtail)
S =: 0: , + / \
sum =: + /
where
first =: {.
of =: @
right =: ]
left =: [
h =: %~ d
indices =: i. of (1: + left)
half =: -:
behead =: }.
curtail =: }:
list =: , |
A typical sequence to demonstrate
that the derivative of the integral returns the original function might
consist of
x
=:
100 sample 0 3
y =: exp - x
^ 2
Iy
=: S (mids y) * d x
DIy =:
(d Iy) % d x
plot (y vs x) and
(DIy vs mids x)
vs is a function that delivers the lists y and x
to the plot function in the required form; while function and
delivers several tables to plot.
i. is the index generator : i.5 gives 0,1,2,3,4
* gives (term-by-term) multiplication
% gives (term-by-term) division
/ applies an operation over a list
|