LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in curve fitting and or forecasting decay

Hello,

 

I have a bit of code that I want to use to fit a curve and forcast the future points, but I can't make it work with the timestamp I need. Any help would be appreciated! Labview version is 2009 SP1.

 

 

0 Kudos
Message 1 of 8
(2,940 Views)

From looking at the code (not trying it yet), I suggest you convert the timestamps to DBL instead of U32 and set the initial time to t=0 by subtracting the first element from the array.

0 Kudos
Message 2 of 8
(2,935 Views)

changing to DBL was a good idea. Haven't gotten the rest working yet.

0 Kudos
Message 3 of 8
(2,927 Views)

One of our engineers took pity on me and came up with this. Does just what I need. Thanks for looking at it Darin!

0 Kudos
Message 4 of 8
(2,916 Views)
  • Is there any conceivable reasons for your three sequence frames????
  • You leftmost FOR loop can be removed without change in functionality.
  • ...
0 Kudos
Message 5 of 8
(2,882 Views)

OK, this code is pretty ridiculous, why would you need to loop and constantly compare to find the 0.6 threshold if you can calculate the corresponding time from first principles using the best fit values?

 

Here's a very quick draft showing some simplifications. Many more simplifications are definitely possible (I kept most of your code intact so far).

 

 

 

Message 6 of 8
(2,870 Views)

The sequence frames are temporary. I use them to keep the code organized and grouped by function while I am coding (the auto cleanup tool lays things out better with them). I'll delete them before final use.

 

I'll look at the loop. Right now I don't fully see how the removal wouldn't change it. (Homework, I guess.)

0 Kudos
Message 7 of 8
(2,869 Views)

Thanks for the changes. I'll have to look that over. I don't understand this kind of math or stats at all. All new stuff.

0 Kudos
Message 8 of 8
(2,828 Views)