Estimated area under a curve program

Click For Summary
SUMMARY

The forum discussion focuses on a TI-86 program designed to estimate the area under a curve using the Right Rectangular Approximation Method (RRAM), Left Rectangular Approximation Method (LRAM), and the Trapezoid method. Users report inconsistent results, with some outputs being significantly incorrect, such as three times the expected value. The program structure includes input prompts for function, minimum and maximum values, and the number of intervals, but issues arise during the calculation loops. The user seeks assistance in troubleshooting the program and suggestions for streamlining the code.

PREREQUISITES
  • Understanding of TI-86 programming syntax
  • Familiarity with numerical methods for integration
  • Knowledge of the Right Rectangular Approximation Method (RRAM) and Left Rectangular Approximation Method (LRAM)
  • Basic programming concepts such as loops and variable assignment
NEXT STEPS
  • Review TI-86 programming documentation for syntax and debugging techniques
  • Study numerical integration methods to ensure correct implementation of RRAM, LRAM, and Trapezoid methods
  • Learn about error handling in TI-86 programs to manage unexpected outputs
  • Explore optimization techniques for TI-86 code to improve performance and readability
USEFUL FOR

This discussion is beneficial for TI-86 programmers, students learning numerical methods, and anyone interested in improving their programming skills for mathematical applications.

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.
 

Similar threads

Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
12K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K