LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Curve fit second order differential equation from data

Is there any way to find a curve from least squares or anything like that to find coefficients of a second-order differential equation by inputting a data set?

Thanks in advance

0 Kudos
Message 1 of 10
(4,322 Views)

something like this would be excellent:

 

0 Kudos
Message 2 of 10
(4,320 Views)

You can fit anything you want. What have you tried so far?

 

(Your image links to your gmail and is not publicly viewable by any of us. Please link to a public image or attach it here.)

0 Kudos
Message 3 of 10
(4,303 Views)

My apologies - I haven't tried anything yet, I am very new to LabView. I have a set of data that I wish to fit rather than solve a differential equation and am not sure how to proceed. 

relating force to a variable (displacement, velocity, or acceleration) and unknown constants:

forcecurve.png

0 Kudos
Message 4 of 10
(4,269 Views)

@jstoph wrote:

My apologies - I haven't tried anything yet, I am very new to LabView.


I don't think there is anything specific to LabVIEW. How would you solve it in any other programming envoronment?


@jstoph wrote:
I have a set of data that I wish to fit rather than solve a differential equation and am not sure how to proceed. 

 

In order to fit, you need two things:

 

  • data (F(x) measured) as a function of an independent variable (e.g. x). Do you have data?
  • A model function that can calculate F(x) (simulate the data!) based on x and a set of fitting parameters.

For some problems, there is a direct linear algebra solution available (e.g. linear or polynomial fit). For more complicated problems, an iterative procedure (e.g. Levenberg Marquardt) needs to be used, where, given an initial guess for the fitting parameters, the fitting algorithm will adjust them in way to best match the data to the model. In your case.

 

In your case, the differential equation needs to be solved for each iteration. Do you know the initial conditions for the differential equation or is this also to be fit??

0 Kudos
Message 5 of 10
(4,259 Views)

I have about 7,000 KB of data on an excel spreadsheet. 

I am not sure what you mean by initial conditions - the time we start "recording" data can be adjusted if it makes curve fitting easier. Mostly need to figure out said function for an object dropping in freefall, then striking an object which causes a damped oscillation.

0 Kudos
Message 6 of 10
(4,227 Views)

Pleas explain what you mean by "fit"?

 

Of course there are analytical solutions for damped oscillations. What parameters are you interested in?

0 Kudos
Message 7 of 10
(4,224 Views)

I really am searching for coefficients which would be used to write a function that can best describe my data.

0 Kudos
Message 8 of 10
(4,221 Views)

Can you attach some data?

 

Some analytical solution can be found here, of course. The solution will depend on the initial condition, for example if the mass is resting at the equilibrium, nothing interesting will probably happen.

0 Kudos
Message 9 of 10
(4,216 Views)

I can't due to the sensitive nature of the project. It recorded about 20,000 data points in ~20 seconds. It recorded time, force, and two accelerations (the two accelerations were very similar but not exactly the same.) 

0 Kudos
Message 10 of 10
(4,196 Views)