LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do a curve fit

Hi!

 

I am trying to do a curve fit on two graphs I have in a Lab View and I am the worse person who ever worked in LabView... Can please sombody help me to do this?

I attache a set of data and the LabView program.

To be able to see the data you need to set the NSample at 19920000 and the sample Rate at 180000000.

The data I need to fit is the one in the graph 'data from file 4' and 'wave form'. To see something on the graph  'data from file 4' you need to increse the record number.

 

Thank you so much!

 

Regards,

Luminita

 

PS The data file doen't fit... I don't know if somebody can help me without it....

0 Kudos
Message 1 of 11
(2,936 Views)

Right click on the 'data from file 4' and waveform graphs and choose data operations->make current value default for each graph.

Then repost the VI.

There is no curve fitting code anywhere in your VI.  What is the model for your data?  What curve fitting VIs have you tried?

 

-Jim

0 Kudos
Message 2 of 11
(2,923 Views)

Hi Jim!

 

I set the two values as default values.

The curves should be fitted, I think, by a polinomial fit.

Do you have any idea even how to export tha actual data? I could do that in origin but I can't take the data out....

Thanks!

0 Kudos
Message 3 of 11
(2,912 Views)

Still no data in the graphs.  Did you save the default data after running the VI?

 

-Jim

0 Kudos
Message 4 of 11
(2,907 Views)

Hi Jim!

 

I can't make all the values as default as the data file is so big...

I attached a image of the two graphs.

I don't know if that helps.

The data file is as well too big to attached.

 

Thanks a lot!

0 Kudos
Message 5 of 11
(2,900 Views)

All you are showing us is a prehistoric VI that does a way to complicated read from a binary file (which you have not attached yet!).

 

This VI is mostly obsolete! All that song and dance with FOR loops, type casting, string reversals, etc can be done with atomic operations in the LabVIEW version (9.0) that you have. Simply use read from binary fine, set the datatype to U16, and select the byte order (little vs big endian).

 

In any case, none of the code has anything to do with fitting.

 

Please do the following:

 

  1. run the program and read your binary file so the graph on the front panel contains the data you want to fit.
  2. make the current graph data the default.
  3. Delete everything but the graph, it is irrelevant for fitting.
  4. Save the VI under a new name.
  5. Attach the VI here.

 

0 Kudos
Message 6 of 11
(2,897 Views)

 


@luminita wrote:

I can't make all the values as default as the data file is so big...

I attached a image of the two graphs.


 

Your data does not look like something suitable for a polynomial fit. Do you have a better model?

 

In any case, to show the general process of fitting, we don't need a file with so many points. Attach a data file where the data is decimated to about 2000 points, for example.

0 Kudos
Message 7 of 11
(2,894 Views)

Hi!

Altenbach probably for you looks like something bad built but I inheritate it. I am a material scientist... Unfortunatelly I need just the data to interpret it. The data is from a masine. They have one program to aquier it from the device and this one is ploting it. Unfortunatelly I can't compare the stages if I don't do the curve fit.

Now I say it I don't have a clue what is there and the stupiud set of data is too big to attach it here as I said...

 

Thank you guys for trying to help me....

0 Kudos
Message 8 of 11
(2,865 Views)

Sorry, I don't know what a masine is, but lets look at the two datasets you attached (image).

 

 


@luminita wrote:

I am a material scientist... Unfortunatelly I need just the data to interpret it. The data is from a masine. They have one program to aquier it from the device and this one is ploting it. Unfortunatelly I can't compare the stages if I don't do the curve fit.


 

OK, let's do the scientific approach.

 

On the left we have some heavily distorted square wave fragment with very few features. In any case, you have way too many very noisy data points to describe the curve. Clearly, it could be filtered and decimated to a few hundred points without loss in real information.

Maybe you can tell us what kind of information you want to extract using a fit.

A polynomial fit is certainly inappropriate and you need quite a high order to approximate the curve. Still, the polynomial coefficient would have very little scientific meaning (or no meaning at all).

All I can say is that the data was recorded with way too many data points and way too little filtering.

 

The data on the right is highly oscillatory and again I see no reasonable way to fit this unless you have an appropriate mathematical model. Maybe an FFT would show some characteristic frequencies that could mean something.. or not.

 

So, again what does a "stage comparison" include? Can you explain in more details what you actually need to do with all that? What kind of parameters are you trying to extract from the raw data? What is the relevance of the two images?

 

 

0 Kudos
Message 9 of 11
(2,857 Views)

Hi!

The first graph is just showing when a device is injecting material. So if I can get this graph in any way smoothere and still showing the steps will be fine.

The second one I should keep the maximum on each bump and maybe few (3,4) points left and right and pass the curve trough them. I need to not loose the maximum and the actual shape coz from thet graph I am able to say when cooling proccess is over. Basically that is a zoom of the graph in the area marked.

 

Thank you!

0 Kudos
Message 10 of 11
(2,806 Views)