3
Integration via cumsum - Newsreader - MATLAB Central http://www.mathworks.com/matlabcentral/newsreader/view_thread/27105[22/08/2013 09:36:24] Search: MATLAB Central About the MATLAB Newsgroup Post A New Message E-mail this page Create Account Log In File Exchange Answers Newsgroup Link Exchange Blogs Trendy Cody Contest MathWorks.com Reply to this message Add author to My Watch List View original format Flag as spam Reply to this message Add author to My Watch List View original format Flag as spam Thread Subject: Integration via cumsum Tags for this Thread Add a New Tag: Separated by commas Ex.: root locus, bode What are tags? Add thread to My Watch List What is a Watch List? Subject: Integration via cumsum From: J A Llewellyn Date: 30 Aug, 2001 16:20:35 Message: 1 of 3 I have multiple sets of about 32000 points each in an acceleration data set (with close time spacing), so I proposed, for each one, to calculate the integral to get velocity and do a second integration to get displacement. I looked up some old code from an earlier project, and it looks like this ydot=cumsum(y)*delt; ydot=ydot-mean(ydot); ydis=cumsum(ydot)*delt; ydis=ydis-mean(ydis); I know it's a crude integration but what I can't remember for the life of me is why did I do the mean correction? While I'm at it, if there's a fast trap. or other improvement I'd like to know about it. It must be fast. Subject: Integration via cumsum From: Boyko Stoimenov Date: 31 Aug, 2001 20:54:58 Message: 2 of 3 A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest. Anyone can tag a thread. Tags are public and visible to everyone. MATLAB Central > MATLAB Newsreader > Integration via cumsum

Integration via Cumsum - Newsreader - MATLAB Central

Embed Size (px)

DESCRIPTION

integrate

Citation preview

Page 1: Integration via Cumsum - Newsreader - MATLAB Central

Integration via cumsum - Newsreader - MATLAB Central

http://www.mathworks.com/matlabcentral/newsreader/view_thread/27105[22/08/2013 09:36:24]

Search: MATLAB Central

About the MATLABNewsgroup

Post A New Message

E-mail this page

Create Account Log In

File Exchange Answers Newsgroup Link Exchange Blogs Trendy Cody Contest MathWorks.com

Reply to this messageAdd author to My Watch ListView original formatFlag as spam

Reply to this messageAdd author to My Watch ListView original formatFlag as spam

Thread Subject:Integration via cumsum

Tags for this Thread

Add a New Tag:

Separated by commasEx.: root locus, bode

What are tags?

Add thread to My Watch List

What is a Watch List?

Subject: Integration via cumsumFrom: J A LlewellynDate: 30 Aug, 2001 16:20:35Message: 1 of 3

I have multiple sets of about 32000 points each in anacceleration data set (with close time spacing), so Iproposed, for each one, to calculate the integral toget velocity and do a second integration to getdisplacement. I looked up some old code from an earlierproject, and it looks like this ydot=cumsum(y)*delt;ydot=ydot-mean(ydot);ydis=cumsum(ydot)*delt;ydis=ydis-mean(ydis);I know it's a crude integration but what I can'tremember for the life of me is why did I do the meancorrection?While I'm at it, if there's a fast trap. or otherimprovement I'd like to know about it. It must be fast.

Subject: Integration via cumsumFrom: Boyko StoimenovDate: 31 Aug, 2001 20:54:58Message: 2 of 3

A tag is like a keyword or categorylabel associated with each thread.Tags make it easier for you to findthreads of interest.

Anyone can tag a thread. Tags arepublic and visible to everyone.

MATLAB Central > MATLAB Newsreader > Integration via cumsum

Page 2: Integration via Cumsum - Newsreader - MATLAB Central

Integration via cumsum - Newsreader - MATLAB Central

http://www.mathworks.com/matlabcentral/newsreader/view_thread/27105[22/08/2013 09:36:24]

Reply to this messageAdd author to My Watch ListView original formatFlag as spam

Feed for this Thread

Hi J A Llewellyn,

> I know it's a crude integration but what I can't> remember for the life of me is why did I do the mean> correction?It's a good idea to comment your own code isn't it?You did the mean correction, becauseVelocity = Integral (acceleration) + Constant

The Constant is your initial velocity V0. You don't know it, but what youknow is that your velocity fluctuates around the zero, otherwise yourstructure will not be vibrating, it will be moving. That's why removing themean has the effect of adjusting for your unknown initial conditions.If the data is to be used for frequency analysis, consider better to useSimpson's rule. It has a better frequency response (flat up to 0.2*Samplingfrequency).Simpson's rule integration is performed with this:

b = [1 4 1]/3;a = [1 0 -1];z = filter(b,a,y)*delta;

Hope this hepls.Boyko

--On the USENET they seldom misquote you. In fact, they usually repeat word for word what you shouldn't have said.--------------------------------------------------------------------------------------------------------

Subject: Integration via cumsumFrom: J A LlewellynDate: 31 Aug, 2001 11:22:52Message: 3 of 3

Thanks Boyko, I couldn't tolerate simpson's before butI'll try it again.Tony

Page 3: Integration via Cumsum - Newsreader - MATLAB Central

Integration via cumsum - Newsreader - MATLAB Central

http://www.mathworks.com/matlabcentral/newsreader/view_thread/27105[22/08/2013 09:36:24]

Site Help Patents Trademarks Privacy Policy Preventing Piracy Terms of Use

Featured MathWorks.com Topics: New Products Support Documentation Training Webinars Newsletters MATLAB Trials Careers

Contact us

© 1994-2013 The MathWorks, Inc.