Does anybody know how to do a maths integration in C? I have been looking around and am finding it difficult to produce this piece of code and was wondering if anybody code help me? Thanks for your help
Does anybody know how to do a maths integration in C? I have been looking around and am finding it difficult to produce this piece of code and was wondering if anybody code help me? Thanks for your help
What exactly is your problem? What piece of code are you trying to compile?
Post the code that's giving you problems and the errors you are having.
SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
I say what I say, I mean what I mean.
IDE: emacs + make + gcc and proud of it.
ya right... do a bit of genetic algo with some artificial intelligence..Originally Posted by westclok
Code:>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
Well I'm interested, but I have questions.
Do you mean numerical integration or symbolic (if this is the right word) integration?
What's the nature of the data to be integrated?
if its numerical, that is definite integration, then it is easy. one has to know stuff like the trapezoidal rule or simpsons one-third rule and stuff like that. if it is indefinite (its not symbolic jez) then one has to know many other things..if you've heard of mathematica, there is an entire book written on the techniques used to write the code for mathematica. i dont know the name though.
Code:>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
Thanks Ping! I couldn't think of the right word.indefinite (its not symbolic jez)
Don't suppose he really wants symbolic integration though. I was merely highlighting the fact that we have little information to go on.
i agree with you jez..coz making something that gives you the value of the indefinite integral is not that simple you know.. i hope this westclok guy tells us exactly what he wants..instead of his vague question..lol
Code:>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
I've got an easy answer:
You've got to do it on your own, and you have to know how to do it in order to implement it in C.
If you are just doing symbolic (indefinite) integration, then I assume that means you're just doing something like parsing functions, and then finding its general anti derivative (give it limits and a starting value and you've got a definite integral).
If you are doing numerical integration, you are basically writing a numerical differential equation solver. Here are some terms you want to look for:
-Euler integration (least accurate)
-Improved euler integration (semi accurate)
-runge kutta (most accurate)
each of those are numerical techniques employed for taking the numerical route to integration. Also look for taylor series expansion (you will have to know it in order to implement runge kutta).
See you in 13
Wolframs Mathematica is also an excellent maths package Matlab. they are both quite advanced though and a much simpler/cheaper program (with much of the functionality) is Derive from TI interactive.
I have been looking at writing something similar to westclock and have found writing something to interpret user input is no small task in itself.