By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,388 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,388 IT Pros & Developers. It's quick & easy.

Integrating numbers

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.