LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I fit a curve saved in "read from measurement file"?

Hi everybody?

 

I am doing curve fitting on step change in thermocouple response. I have already developed a vi on this but any time I run it the curve fitting vi always return the following error

  

  analysis: the system of equations cannot be solved because the input matrix is singular.

 

I have tried to adjust my initial guess and the number of iteration in the curve fitting vi several times but am still getting the error.

 

I now thought of breaking down the program by capturing the response of the thermocouple and save it in a file. Then may be I can now do the curve fitting on the saved data.

 

If anybody has idea on how to go about this, it will be appreciated. I have attached the vi that was returning errors.

 

Thanks

 

kdgreat.

0 Kudos
Message 1 of 9
(3,367 Views)

kdgreat,

 

We cannot do anything without data.  Please run your VI and acquire some typical data. Then context-click on "raw" and choose Data Operations >> Make Current Value Default. Save the VI (with a different name if you do not want the default data in your working VI).  Post this VI with the data.

 

Lynn

0 Kudos
Message 2 of 9
(3,366 Views)

Thanks for your response lynn,

 

 I have acquired a raw data and attached the vi with this message. Your modification and suggestion will be appreciated.

 

Regards

 

kdgreat.

 

 

 

0 Kudos
Message 3 of 9
(3,343 Views)

Don't make the number of points a control, because you don't know it. Have the computer determine it after triggering.

The "locations" data needs to match.

 

Now it seems to fit just fine, see attached.

0 Kudos
Message 4 of 9
(3,338 Views)

Of course you might want to generate the correct x-array (not just 0,1,2,3,...) based on dt of the data to get proper units for the parameters.

0 Kudos
Message 5 of 9
(3,334 Views)

Altabanch,

 

Thanks for your response. The vi really worked well. Is there a way that I can combine the two vi's together? ( the acquisition and the curve fitting routine). So that I can acquire and curve fit the signal with a single vi.

 

Thanks again.

 

kdgreat.

0 Kudos
Message 6 of 9
(3,317 Views)

Yes, simply change the "raw" graph into an indicator (right-click...change to indicator), add your DAQ VI and wire it to the broken wire to provide a source. See how far you get.

0 Kudos
Message 7 of 9
(3,313 Views)

ALTABANCH,

 

THANKS AGAIN FOR YOUR RESPONSE. I HAVE MODIFIED THE VI SO THAT I CAN ACQUIRE AND CURVE FIT AT THE SAME TIME.

 

THE ONLY CHALLENGE NOW IS THAT THE CURVE FITTING VI RETURNS ERRORS AT TIMES, THOUGH THE VI WORKS AT TIMES.

 

WHAT I NOTICED IS THAT THE TIME OF PLUNGING THE THERMOCOUPLE INTO A WARM WATER HAS EFFECT AND THIS DETERMINES IF THE VI WILL WORK OR RETURN THE ERROR.

 

THE ERROR IS: ANALYSIS:THE SYSTEM OF EQUATION CANNOT BE SOLVED BECAUSE THE INPUT MATRIX IS SINGULAR.

 

THE SOLUTION AM THINKING OF IS (BUT I DON'T KNOW IF IT WILL SOLVE THE PROBLEM) IF THERE IS WAY TO DELAY THE OPERATION OF THE CURVE FITTING VI UNTIL ITS SEES THE TRIGGERED SIGNAL.

 

ANY ADVICE YOU HAVE ON HOW TO STOP THE ERROR WILL BE APPRECIATED.

 

PLS FIND THE ATTACHED VI.

 

THANKS

KDGREAT.

 

 

0 Kudos
Message 8 of 9
(3,301 Views)

@KDGREAT. wrote:

... INTO A WARM WATER ...



As a first step, take some of that warm water  and remove the dried soda from under the keys of your keyboard. It seems your capslock or shift key is permanently stuck in a down position.

 

There is no while loop. Are you using continuous run? That's not a good idea.

All important VIs have error terminals, so you can easily add case structures to only conditionally execute code (e.g. only fit if the triggered array exceeds a minimum size). You might also want tune your parameter estimates so they are closer to the expected results. 

0 Kudos
Message 9 of 9
(3,290 Views)