Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Integrating numbers (http://www.velocityreviews.com/forums/t285256-integrating-numbers.html)

 Sonoman 08-27-2004 04:24 PM

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.

 osmium 08-27-2004 04:28 PM

Re: Integrating numbers

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.

 Thomas Matthews 08-27-2004 08:20 PM

Re: Integrating numbers

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

 Karthiik Kumar 08-28-2004 05:34 AM

Re: Integrating numbers

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

 All times are GMT. The time now is 04:36 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.