Hi,
I've been using my TI-Nspire to find Riemann sums. I created a program that goes like this:
Code:
This program runs perfectly on my N-Spire. However when I tried to program this onto my friend's TI-89 Titanium, I get an error because it won't accept g(x) as an argument for the first Request (Input) statement. I have tried to input it as a string and convert it to an expression with the expr() command, but when I run this code:
Code:
it throws an argument error. I have tried using the #indirection command but when I do this I still get an error or an incorrect answer. I have seen Riemann sum programs that don't store a function, but I was wondering if it is possible to do it like I have done on the N-Spire by storing a function and then using that function to find the sum.
I would greatly appreciate any help,
Thanks in advance
I've been using my TI-Nspire to find Riemann sums. I created a program that goes like this:
Code:
Prgrm
Request "Function",f(x)
Request "Start of Interval:",a
Request "End of Interval:",b
Request "Number of rectangles:",n
0→l
0→m
(b-a)/d→n
For i,0,n-1
l+f(a+d*i)*d→l
m+f(a+d*i)*d→m
EndFor
l-f(a)*d+f(a+d*n)*d→r
(l+r)/2→t
Disp "Left Sum:"
Disp approx(l)
Disp "Right Sum:"
Disp approx(r)
Disp "Midpoint Sum:"
Disp approx(m)
Disp "Trapezoidal Sum:"
Disp approx(t)
EndPrgm
This program runs perfectly on my N-Spire. However when I tried to program this onto my friend's TI-89 Titanium, I get an error because it won't accept g(x) as an argument for the first Request (Input) statement. I have tried to input it as a string and convert it to an expression with the expr() command, but when I run this code:
Code:
InputStr "Function:",f(x)
expr(f)→f(x)
it throws an argument error. I have tried using the #indirection command but when I do this I still get an error or an incorrect answer. I have seen Riemann sum programs that don't store a function, but I was wondering if it is possible to do it like I have done on the N-Spire by storing a function and then using that function to find the sum.
I would greatly appreciate any help,
Thanks in advance