LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error calculation with LabView

I am just courious, maybe someone did such error estimation with LabView, and can show me a better approach.

Scenario:

I have the following function with one variable (x), K is a constant:

 

y = ( -1/2*K + SQRT( 1/4*K^2 - (4*K - K^2)*(x^2 - x) ) ) / (2-1/2*K);

 I have x as an input, and I know the error of x at certain positions.

I would like to estimate the error of the result y values from the given x values.

Since this is not a monotonic function (the first derivative changes sign), the standard Gauss error propagation formula with the first partial derivative is not enough here. The first derivative of the above function is simple to

get analytically, but the second would be a pain to calculate...

How would you treate such a problem with LabView, maybe some kind of numerical derivation to get second (or maybe even third derivative from the Taylor series?) derivative?

 

Right now we just use a more simple error estimation:

we slightly over-estimate the error of y in the following way: 

delta_y = MAX { ABS(y(x)-y(x-error)) ; ABS(y(x)-y(x+error)) }

 So we take the higher difference as an error.

 

How would you do it differently if you have LabView under your hands? (LabVew pro 2013 + almost all toolkits)

I could not find error calculation related VIs in the drop menu, are there any?

Thanks for any advice!

0 Kudos
Message 1 of 8
(3,307 Views)

You do math in LabVIEW exactly the same as you do math in any other computer language, the only difference is that the program "looks" different. You can always work from the basic equations, as you show in your question, either from wiring something up, using a formula node, or a MatLab script node.

 

LabVIEW does have a lot of functions under the Mathematics palette which you might use as shortcuts to build your function, even if you don't find exactly what you want. Just don't accept what is readily available, customize it to fit your problem.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 2 of 8
(3,289 Views)

Thanks, of course I know that I can either use any other software to do basic calculations, or build up larger functions from smaller elements 🙂

 

The reason of this question was that, I wonder  if LabView has some toolkit or library to handle error calculations. There are lots of signal manipulation and calculation VIs, it would be nice to have some advanced error calculation toolkits/ VIs...For example a "Gauss error propagation VI", what could accept a function even with multiple variables as inputs (and their errors), and it could calculate the resulted error via some numerical partial derivations (including higher orders if necessary)...

Does this make sense, what do you think? It would be useful, since we have to calculate errors/uncertainty often in physics, etc...

0 Kudos
Message 3 of 8
(3,275 Views)

Sure, I think it would be nice, but so far it seems that no one has thought it important enough to build such a library, at least as far as I know. There is an active OpenG community, perhaps you and fellow physicists might look into that and submit such (mathematical) error calculating VIs for review and distribution to the whole LV community. Unfortunately, that's not my bag, so I couldn't help you significantly, but I would give you as much moral support as I can Smiley Happy .

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 4 of 8
(3,264 Views)

You could also just use a formula node

 

Edit: Missed camerond proposing the same thing above. Here is a link on how to use them.

 

http://www.ni.com/white-paper/7572/en/

0 Kudos
Message 5 of 8
(3,257 Views)

I use formula nodes often 🙂

 

I think my post would be more appropriate in the Idea Exchange forum. Maybe someone can move it there...

The idea would be that to have ready made VIs for general often used error calculations...(Gauss error propagation, confidence level, definitions, etc..)

So the LV user could save dev time...?

0 Kudos
Message 6 of 8
(3,252 Views)

Well, write your own toolkit then and post it for us to all use! 🙂

 

I misunderstood what you were going for though. Sorry 😛

0 Kudos
Message 7 of 8
(3,248 Views)

@Blokk wrote:

I use formula nodes often 🙂

 

I think my post would be more appropriate in the Idea Exchange forum. Maybe someone can move it there...

The idea would be that to have ready made VIs for general often used error calculations...(Gauss error propagation, confidence level, definitions, etc..)

So the LV user could save dev time...?


If you have some formula nodes ready to go that might be useful for others, but don't quite have them packaged as VIs yet, it might be faster (and go through less bureaucracy) to just post them up here. I'm sure someone could repackage them according to standard LV connection panes (maybe even do some clever icon designing) and would post them on one of the popular LV Tools repositories.

 

As far as I can tell by just following threads on this forum, the NI engineers already have so many suggestions, fixes, etc. that getting a brand new "this would be nice" Idea added to the LV shipping program is going to take a little less than forever to implement, especially if it would only involve combining functions already available. (No indictment of you, NI engineers, it's just that we users seem to be really good at producing Ideas and we do outnumber you Smiley Very Happy .)

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 8 of 8
(3,234 Views)