469,648 Members | 1,709 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

Integrating numbers

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.
Jul 22 '05 #1
3 1901
Sonoman writes:
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.
Jul 22 '05 #2
Sonoman wrote:
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

Jul 22 '05 #3
Sonoman wrote:
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.

--
Karthik
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Al | last post: by
reply views Thread by kadam_murali | last post: by
reply views Thread by Jakke | last post: by
reply views Thread by Rob C | last post: by
5 posts views Thread by Shikari Shambu | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.