Integrating numbers

S

Sonoman

Hi all:
Is there a class or function that I could use to integrate? By
integrating , I mean calculus integration. I need to get data from a
sensor that gives me the acceleration of an object. In order to find the
displacement for this object I need to integrate its acceleration twice.
How can I achieve this with C++? Please advise.
 
O

osmium

Sonoman said:
Is there a class or function that I could use to integrate? By
integrating , I mean calculus integration. I need to get data from a
sensor that gives me the acceleration of an object. In order to find the
displacement for this object I need to integrate its acceleration twice.
How can I achieve this with C++? Please advise.

I would be inclined to write my own routine using something such as Simpson
numerical integration. You can probably find something already written but
it is probably just as fast to write it. Use 'snippets' in a Google search
if you want to pursue the pre-written approach, that will often limit the
results to source code.
 
T

Thomas Matthews

Sonoman said:
Hi all:
Is there a class or function that I could use to integrate? By
integrating , I mean calculus integration. I need to get data from a
sensor that gives me the acceleration of an object. In order to find the
displacement for this object I need to integrate its acceleration twice.
How can I achieve this with C++? Please advise.

Another issue is whether or not you are integrating over the entire
set of data or performing the integration as the data comes in. The
latter requires a different algorithm than the former.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
K

Karthiik Kumar

Sonoman said:
Hi all:
Is there a class or function that I could use to integrate? By
integrating , I mean calculus integration. I need to get data from a
sensor that gives me the acceleration of an object. In order to find the
displacement for this object I need to integrate its acceleration twice.
How can I achieve this with C++? Please advise.

C++ standard does not speak of this, nor does STL define one.
Google would be your best friend here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top