Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Integration Programming: Commands and Calculations, Study notes of Calculus

The commands and calculations involved in a programming integration using basic language. It covers the steps to input lower and upper limits, number of subdivisions, and the calculations of left sum, midpoint sum, and approximations using trapezoidal rule and simpson's rule.

Typology: Study notes

Pre 2010

Uploaded on 08/30/2009

koofers-user-3jb
koofers-user-3jb 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
281
Prgm: INTEGRAL Where to Find The Commands
:Disp “LOWER LIMIT” Disp and Input are accessed via PRGM, I/O
:Input
A
Enter lower limit of integration.
:Disp “UPPER LIMIT
:Input
B
Enter upper limit of integration.
:Disp “DIVNS”
:Input
N
Enter number subdivisions.
:
(
B
,
A
)
=N
!
H
Stores size of one subdivision in
H
(Note that
!
means
hit STO button).
:
A
!
X
Start
X
off at beginning of interval.
:0
!
L
Initialize
L
, which keeps track of left sums, to zero.
:0
!
M
Initialize
M
, which keeps track of midpointsums, to zero.
:1
!
I
Initialize
I
, the counter for the loop.
:Lbl P Label for top of loop. Lbl is accessed via PRGM, CTL.
:
L
+
H
Y
1
!
L
Increment
L
by
Y
1
H
, the area of one more rectangle.
(
Y
1is accessed via
Y
-VARS, or 2nd VARS.)
:
X
+
:
5
H
!
X
Move
X
to middle of interval.
:
M
+
H
Y
1
!
M
Evaluate
Y
1at the middle of int erval and increment
M
by rectangle of this height.
:
X
+
:
5
H
!
X
Move
X
tostartofnextinterval.
:
IS >
(
I;N
)
IS >
(
is accessed via PRGM, CTL. This is the most
difficult step in the program: adds 1 to
I
and does the
the next step if
I
N
(i.e., if haven’t gone through
loop enought times); otherwise, skips next step. Thus,
if
I
N
, goes back toLbl P and loops throughagain.
If
I>N
, loop is finished and goes on to print out
results. Continue here if
I>N
, in which case
the value of
X
is now
B
.
:Goto P Goto is accessed vi a PRGM, CTL. Jumps back to
Lbl P if
J
N
.
:Disp “LEFT/RIGHT”
:Disp
L L
now equals the left sum, so display it.
:
L
+
H
Y
1
!
R
Add on area of right-most rectangle, store in
R
.
:
A
!
X
Reset
X
to
A
.
:
R
,
H
Y
1
!
R
Subtract off area of left-most rectangle.
:Disp
R R
now equals right sum, so display it.
:
(
L
+
R
)
=
2
!
T
Trap approximation is average of
L
and
R
.
:Disp “TRAP/MID/SIMP”
:Disp
T
Display trap approximation.
:Disp
M
Display midpoint approximation.
:
(
2
M
+
T
)
=
3
!
S
Simpson is weighted average of
M
and
T
.
:Disp
S
Display Simpson’s approximation.

Partial preview of the text

Download Integration Programming: Commands and Calculations and more Study notes Calculus in PDF only on Docsity!

Prgm: INTEGRAL Where to Find The Commands :Disp “LOWER LIMIT” Disp and Input are accessed via PRGM, I/O :Input A Enter lower limit of integration. :Disp “UPPER LIMIT” :Input B Enter upper limit of integration. :Disp “DIVNS” :Input N Enter number subdivisions. :(B A)=N! H Stores size of one subdivision in H (Note that! means hit STO button). :A! X Start X off at beginning of interval. :0! L Initialize L, which keeps track of left sums, to zero. :0! M Initialize M , which keeps track of midpoint sums, to zero. :1! I Initialize I , the counter for the loop. :Lbl P Label for top of loop. Lbl is accessed via PRGM, CTL. :L + H  Y 1! L Increment L by Y 1 H , the area of one more rectangle. (Y 1 is accessed via Y -VARS, or 2nd VARS.) :X + : 5 H! X Move X to middle of interval. :M + H  Y 1! M Evaluate Y 1 at the middle of interval and increment M by rectangle of this height. :X + : 5 H! X Move X to start of next interval. :I S > (I ; N ) I S > ( is accessed via PRGM, CTL. This is the most difficult step in the program: adds 1 to I and does the the next step if I  N (i.e., if haven’t gone through loop enought times); otherwise, skips next step. Thus, if I  N , goes back to Lbl P and loops through again. If I > N , loop is finished and goes on to print out results. Continue here if I > N , in which case the value of X is now B. :Goto P Goto is accessed via PRGM, CTL. Jumps back to Lbl P if J  N. :Disp “LEFT/RIGHT” :Disp L L now equals the left sum, so display it. :L + H  Y 1! R Add on area of right-most rectangle, store in R. :A! X Reset X to A. :R H  Y 1! R Subtract off area of left-most rectangle. :Disp R R now equals right sum, so display it. :(L + R)= 2! T Trap approximation is average of L and R. :Disp “TRAP/MID/SIMP” :Disp T Display trap approximation. :Disp M Display midpoint approximation. :( 2 M + T )= 3! S Simpson is weighted average of M and T. :Disp S Display Simpson’s approximation.