I am adding numerical integration and numerical differentiation to the graph module, intended to be restricted to a simple menu button to click, to show said points on screen. More accurately, it is not integration but discrete trapezoidal sum points and not differentiation but discrete Δy/Δx slope points.
These menu options simply look at the x,y pair graphing values stored in the STAT memory and perform the said discrete calcs for every consecutive sample and plot the result together with the main graph.
It is clear that for a slope point Δy/Δx, the slope value should be placed in between sample points, i.e. mid point, at x1+Δx/2.
My question is where to show the integration point ½Σ(y2-y1)Δx, i.e. at left edge x1, right edge x2, or mid point x1+Δx/2. Currently I do mid-point.
I do not really find references on Wiki of where this is done. Yes, there are ideas on the Riemann Sums on the left, and on the right, but not on the trapezoid sum which I have here, and not where to graph it. I can understand putting it on the right hand side as that would indicate the preceding area, but for graphing it, it probably makes more sense on the mid point, together with the slope value.
Any answers for me?
The below program and graph illustrates it:
Code: Select all
XEQC43 XEQLBL 13 TRAPZ
CLSUM
0 ENTER 0 SUM+
1 ENTER 0.001 SUM+
1 ENTER 1 SUM+
0 ENTER 1.001 SUM+
3 ENTER 2 SUM+
0 ENTER 3 SUM+
3 ENTER 4 SUM+
0 ENTER 4.001 SUM+
PLOT
.
. Placement of the integration point does not make a difference if there are 400 sample points, as the function and its integral illustrates above. This is sinc𝝿 with the discrete integral button (ΣȳΔx) ticked, showing the approximated integral from -10𝝿 to +10𝝿, which approximates unity.