Estimated area under a curve program

AI Thread Summary
A user developed a TI-86 program to estimate the area under a curve using the Right Rectangular Approximation Method (RRAM), Left Rectangular Approximation Method (LRAM), and the Trapezoid method, but is experiencing inconsistent results. The program sometimes produces answers that are significantly incorrect, including one instance where the output was three times the expected value. The user seeks assistance in troubleshooting the program's functionality and is also interested in potential ways to streamline the code for better performance. The use of the arrow symbol in the code has caused confusion, resembling a minus greater than sign. The discussion focuses on debugging and optimizing the area estimation program.
Jeremy
Messages
28
Reaction score
0
I wrote a TI-86 program for estimating the area under a curve using "Right Rectangular Approximation Method" (RRAM), "Left..." (LRAM), and "Trapezoid" method.

However, it refuses to work. Sometimes it works, but I have gotten answers that are way off. Once i got something that was 3x the correct answer.

InpSt "Function;",EQ
St>Eq(EQ,y9)
Input "Min=",EN
Input "Max=",EX
Input "# of intervals:",EI
(EX-EN)/EI -> LI
EN -> NN
EN -> NP
0 -> AA
For (NN,EN,EX-LI,LI)
AA+y9(EN) -> AA
End
AA(LI) -> AA
0 -> AB
For (NP,EN+LI,EX,LI)
AB+y9(NP) -> AB
End
AB(LI) -> AB
(AA+AB)/2 -> AC
Disp "LRAM",AA
Disp "RRAM",AB
Disp "Trap",AC

why doesn't this work? also, could it be streamlined?
 
Physics news on Phys.org
for simplicities sake i used -> as an arrow. i see now that it looks like a minus greater than sign.
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...
Back
Top