Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
fitting integral function with parameters as limits of integration

Subject: fitting integral function with parameters as limits of integration

From: Steve Sachay

Date: 25 Feb, 2011 05:13:07

Message: 1 of 2

Hi. I'm trying to fit a function which is a function of a time shifted integral function, so the limits of the integral are themselves parameters.

The function to fit, C(t), is a parameter, A, times the integral of B(u), from a second parameter, deltaT, to the second parameter + t. u is the sum of the parameter deltaT and t.

symbolically:
C(t)=A * int(B(u),deltaT,deltaT+t)

where u=deltaT+t

I do have data for both B(t) and C(t), and don't know beyond a guess what functional form B would take. The plan is to spline interpolate B(t) to generate B(u). Leaving everything at integer t values is fine if necessary, especially B, though I'd prefer the finished fit of C to be at a finer timescale.

I'm having a tough time coming up with the right way to do the integration in matlab.

The closest I have come is using cumtrapz for B(t) from 0 to t, but then things won't work right when I need a floating deltaT.

Quad and quadv don't seem to work work as B(t) and B(u) aren't really functions proper.

Any pointer on how to approach this are appreciated.

Subject: fitting integral function with parameters as limits of integration

From: Steve Sachay

Date: 25 Feb, 2011 05:55:36

Message: 2 of 2

I've thought about making a for loop for my deltaT, since it will likely be a positive value less than 50, then comparing all the cost functions, but it seems like there may be a better way. Thanks.

Tags for this Thread

No tags are associated with this thread.

What are tags?

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.

Contact us