LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

step & triangular fitting curve

Is there any way to make a step and triangular fitting pattern.  Right now I'm trying to use the curve fitting function vi.  Using a non-linear curve, I'm trying to implement the following equations...
 
step(x)
rect(x)
tri(x)
 
The vi doesn't like any of these equations.  Suggestions?
0 Kudos
Message 1 of 2
(2,215 Views)
There are two versions of the non-linear curve fitting VIs in LV8. (I am not sure when the changes occurred). One version takes an equation (the one you are trying to use?). The other uses a subVI to generate an array with values for f(x) and the derivatives. The problem with your functions, of course, is the non-existence of derivatives at certain points. In your numeric calculation you can make some approximation which keeps the derivatives finite (since the real world data does not actually have infinte slopes anyway). I think there is an example which ships with LV showing the format of the subVI. It is useful to make a copy and then modify it for your own functions.

Note: I have not tried fitting functions like you are trying to use, so I cannot predict how successful this will be.

Lynn
0 Kudos
Message 2 of 2
(2,200 Views)