numerical integration is a bitch

Dan

Tank
Joined
May 28, 2003
Messages
4,186
Reaction score
3
anybody handy with programming feel like tossing together a program to do reiman sums of Simpson's rule and trapezoid rule approximations quickly.

Basically you have some function f(x) that you want to integrate between a and b. So you break that into n equal length subintervals of length h and you have n+1 values for x and f(x). x0 x1 x2... xn. h=(b-a)/n

For the Simpson's approximation, the total area is
h/3[f(x0)+4f(x1)+2f(x2)+4f(x3)+...+2f(xn-2)+4f(xn-1)+f(xn)]

the pattern is just 1 4 2 4 2... 2 4 2 4 1

For the trapezoid approximation, the total area is
h/2[f(x0)+2f(x1)+2f(x2)+...+2f(xn-2)+2f(xn-1)+2f(xn)]

and the pattern there is 1 2 2 2... 2 2 2 1

So the input variables are f(x), n, a, b, and which approximation it uses, and the output is the approximated integral.
As you can probably guess it takes ****ing forever to add up by hand.
 
This is the kind of mathematics that causes people to blow their brains out at a young age. Or perhaps it's not as complex as I percieve it to be. I just saw numbers and thought "Whoah, no dude".
 
I could probably do it on the 83+ but my batteries are dead :-(
 
Oh yeah those are damn annoying, they take forever. When I had to do them for homework I didn't feel like writing them down, I'd just put down the answer.
 
I've actually got a program for trapezoidal apprx. that will run on the calculator, and works great. Just dont have the link software installed/cant be arsed to type it out, sorry.

But really, programming formulae on the TI83 is simple, just ask for variables, plug it in, display. Programming it should actually help you learn it too.
 
I wish i had the 89 or 92, symbolic integration would be such a kewl feature! :O

I had to get the 84 though cuz i can't use those on quizes or tests :|
 
Back
Top