LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Derivative x(t).VI

The "Derivative x(t).VI" works when I select any method but "4th Order Central" using the default Inital and Final Conditions. The 4th Order produces an:

 

error -2006   "Analysis:  The number of samples must be >= 2."

 

The number of samples is 1000. The VI also produces the same error if I provide a data array to the Initial and Final Condition rather than using the default values. Am I doing something wrong? Is it a bug?

0 Kudos
Message 1 of 5
(1,434 Views)

I'm using LabVIEW 2014 Version 14.0.f1 (32-bit)

0 Kudos
Message 2 of 5
(1,426 Views)

Hi jarniva,

 

please read the help for the derivative function. It mentions some boundary conditions for the "4th order" calculation you need to supply!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 3 of 5
(1,424 Views)

I did read the help file. It says that the initial and final conditions minimize the error at the boundaries. I assumed that the default conditions woud work the same for both the 2nd order and 4th order methods. 2nd order works perfectly. I tried wiring a constant array for the boundary conditions and got the same error. What is different between the two methods?

0 Kudos
Message 4 of 5
(1,419 Views)

Hi jamiva,

 

to quote the LabVIEW help for Derivative:

Initial Condition: If method is 4th Order Central, the VI uses the first two elements in Initial Condition to calculate the derivative. The default is [0].
Final Condition: If method is 4th Order Central, the VI uses the first two elements in Final Condition to calculate the derivative. The default is [0].

 

Again: Did you read the help for that function? Did you read all of the help? Do you understand what it says?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 5
(1,378 Views)