LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formula Node

Hi everybody
I have been trying to put this equation into the formula node:
y=(2*D*g*I1*I2/(Pot*L^2))*G1*G2*(2/E1)*(2/E2)*L^2/((k*x^2*b0/(l1^2+k*x^2)+k*x^2*b1/(l2^2+k*x^2)+k*x^2*b2/(l3^2+k*x^2)+k*x^2*b3/(l4^2+k*x^2)+k*x^2*b4/(l5^2+k*x^2)+k*x^2*b5/(l6^2+k*x^2)))^2;
where x is the variable and all the others symbols are constants. All of
them different from zero.
If you run a VI with this formula node the result is NaN. But, if you substitute
x^2 by x*x the VI works fine!!!!!!!!!!!
What is wrong? I am using Labview 5.0 on windows 95.

The above equation is only a piece of a more complex equation that I am
trying to fit
using the VI " Nonlinear Lev-Mar Fit.vi". When I put the complete equation
and the
derivatives into this VI and run it,
I receive the following messages:
1) Compiler Error
2) float spill 6
failure: E\lv45\lvsource\genufp.c
After this messages, Labview closes.

Thanks in advance for any help.
Ricardo.
0 Kudos
Message 1 of 9
(4,186 Views)
Hello

It seems you're saying that x^2 does not work, but x*x works in LabView 5.0
formula node vi. I tried a very simple trial case like y=x^2 in a formula
node. It works fine. I don't know of any limitations in V5.0. Iuse LV5.1. I
doubt NI would leave such a basic feature out till 5.1.
I've another general recommendation from a LV training I took recently. They
suggest using LV vi objects to build a formula like this, rather than using
a formula node. I believe the advantage there is your long formula would be
subdivided up and make it easier for you to debug. You could see
intermediate results with high-lighting, and help you debug it. IMHO, this
long formula is too big for me to keep my attention. I'd rather break it up
into segments and use the math vi's to build
it up.

Hope this helps.
Khan

Ricardo Diniz wrote in message
news:38c681a2@newsgroups.ni.com...
>
> Hi everybody
> I have been trying to put this equation into the formula node:
>
y=(2*D*g*I1*I2/(Pot*L^2))*G1*G2*(2/E1)*(2/E2)*L^2/((k*x^2*b0/(l1^2+k*x^2)+k*
x^2*b1/(l2^2+k*x^2)+k*x^2*b2/(l3^2+k*x^2)+k*x^2*b3/(l4^2+k*x^2)+k*x^2*b4/(l5
^2+k*x^2)+k*x^2*b5/(l6^2+k*x^2)))^2;
> where x is the variable and all the others symbols are constants. All of
> them different from zero.
> If you run a VI with this formula node the result is NaN. But, if you
substitute
> x^2 by x*x the VI works fine!!!!!!!!!!!
> What is wrong? I am using Labview 5.0 on windows 95.
>
> The above equation is only a piece of a more complex equation that I am
> trying to fit
> using the VI " Nonlinear Lev-Mar Fit.vi". When I put the complete equation
> and the
> derivatives into this VI and run it, I receive the following messages:
> 1) Compiler Error
> 2) float spill 6
> failure: E\lv45\lvso
urce\genufp.c
> After this messages, Labview closes.
>
> Thanks in advance for any help.
> Ricardo.
0 Kudos
Message 2 of 9
(4,186 Views)
Hello Khan.
Thanks for your help.
You said that you tried a simple case like y=x^2. In this case LV 5.0 works
fine too. But, if you
use that very large equation you will see that strange feature I mentioned.
If you want I can
send to you my trial VI with the formula node and this equation. I am not
crazy.......x*x works and x^2 doesn't!!!
About your suggestion of using vi objects to buit large equations it seems
to be a good idea. I will try do it.
About that error messages, I discovered that the "Target Fnc & Deriv NonLin.vi"
had two inputs and one output minssing. Now, the "Nonlinear Lev-Mar Fit.vi"
is working fine. But, with x*x.
Ricardo.
0 Kudos
Message 3 of 9
(4,186 Views)
On 9 Mar 2000 05:56:44 -0600, "Ricardo Diniz"
wrote:

>
>Hello Khan.
>Thanks for your help.
>You said that you tried a simple case like y=x^2. In this case LV 5.0 works
>fine too. But, if you
>use that very large equation you will see that strange feature I mentioned.

Could it be that you get trouble with precedence. What happens if you
put parantheses around the x^2 and x*x expressions
0 Kudos
Message 4 of 9
(4,186 Views)
I probably won't help you solve your problem, but I remember (vaguely)
having the same problem back in rev3... As I recall, in that case x*x
worked, as did x^2.0, but x^2 did not... I "solved" the problem by training
myself to put extraneous decimal points in my equations...

just remember... this isn't a bug, it's a feature

Ricardo Diniz wrote in message
news:38c7917c@newsgroups.ni.com...
>
> Hello Khan.
> Thanks for your help.
> You said that you tried a simple case like y=x^2. In this case LV 5.0
works
> fine too. But, if you
> use that very large equation you will see that strange feature I
mentioned.
> If you want I can
> send to you my trial VI with the formula node and this equation. I am not
> crazy.......x*x works an
d x^2 doesn't!!!
> About your suggestion of using vi objects to buit large equations it
seems
> to be a good idea. I will try do it.
> About that error messages, I discovered that the "Target Fnc & Deriv
NonLin.vi"
> had two inputs and one output minssing. Now, the "Nonlinear Lev-Mar
Fit.vi"
> is working fine. But, with x*x.
> Ricardo.
0 Kudos
Message 5 of 9
(4,186 Views)
> I have been trying to put this equation into the formula node:
> y=(2*D*g*I1*I2/(Pot*L^2))*G1*G2*(2/E1)*(2/E2)*L^2/((k*x^2*b0/(l1^2+k*x^2)+k*x^2*b1/(l2^2+k*x^2)+k*x^2*b2/(l3^2+k*x^2)+k*x^2*b3/(l4^2+k*x^2)+k*x^2*b4/(l5^2+k*x^2)+k*x^2*b5/(l6^2+k*x^2)))^2;
> where x is the variable and all the others symbols are constants. All of
> them different from zero.
> If you run a VI with this formula node the result is NaN. But, if you substitute
> x^2 by x*x the VI works fine!!!!!!!!!!!
> What is wrong? I am using Labview 5.0 on windows 95.
>
> The above equation is only a piece of a more complex equation that I am
> trying to fit
> using the VI " Nonlinear Lev-Mar Fit.vi". When I put the complete equation
> and the
> derivatives into this VI and run it, I receive the fo
llowing messages:
> 1) Compiler Error
> 2) float spill 6
> failure: E\lv45\lvsource\genufp.c
> After this messages, Labview closes.

This looks like a bug. Please report it to technical support via email
and provide the VI. In the meantime, the suggestion to use nodes for
some portion of it is a good one. Tecnically, it should work either
way, but the formula node is typically used for simpler expressions, and
this bug most likely hasn't been reported before.

Greg McKaskle
0 Kudos
Message 6 of 9
(4,186 Views)
sure it has... in July of 1994... see post above...

Greg McKaskle wrote in message
news:38C99CA9.15C86E18@austin.rr.com...
> > I have been trying to put this equation into the formula node:
> >
y=(2*D*g*I1*I2/(Pot*L^2))*G1*G2*(2/E1)*(2/E2)*L^2/((k*x^2*b0/(l1^2+k*x^2)+k*
x^2*b1/(l2^2+k*x^2)+k*x^2*b2/(l3^2+k*x^2)+k*x^2*b3/(l4^2+k*x^2)+k*x^2*b4/(l5
^2+k*x^2)+k*x^2*b5/(l6^2+k*x^2)))^2;
> > where x is the variable and all the others symbols are constants. All of
> > them different from zero.
> > If you run a VI with this formula node the result is NaN. But, if you
substitute
> > x^2 by x*x the VI works fine!!!!!!!!!!!
> > What is wrong? I am using Labview 5.0 on windows 95.
> >
> > The above equation is only a piece of a more comple
x equation that I am
> > trying to fit
> > using the VI " Nonlinear Lev-Mar Fit.vi". When I put the complete
equation
> > and the
> > derivatives into this VI and run it, I receive the following messages:
> > 1) Compiler Error
> > 2) float spill 6
> > failure: E\lv45\lvsource\genufp.c
> > After this messages, Labview closes.
>
> This looks like a bug. Please report it to technical support via email
> and provide the VI. In the meantime, the suggestion to use nodes for
> some portion of it is a good one. Tecnically, it should work either
> way, but the formula node is typically used for simpler expressions, and
> this bug most likely hasn't been reported before.
>
> Greg McKaskle
0 Kudos
Message 7 of 9
(4,186 Views)
Greg McKaskle wrote:
>> I have been trying to put this equation into the formula node:>> y=(2*D*g*I1*I2/(Pot*L^2))*G1*G2*(2/E1)*(2/E2)*L^2/((k*x^2*b0/(l1^2+k*x^2)+k*x^2*b1/(l2^2+k*x^2)+k*x^2*b2/(l3^2+k*x^2)+k*x^2*b3/(l4^2+k*x^2)+k*x^2*b4/(l5^2+k*x^2)+k*x^2*b5/(l6^2+k*x^2)))^2;>>
where x is the variable and all the others symbols are constants. All of>>
them different from zero.>> If you run a VI with this formula node the result
is NaN. But, if you substitute>> x^2 by x*x the VI works fine!!!!!!!!!!!>>
What is wrong? I am using Labview 5.0 on windows 95.>> >> The above equation
is only a piece of a more complex equation that I am>> trying to fit>> using
the VI " Nonlinear Lev-Mar Fit.vi". When I put the complete equation>> and

the>> derivatives into this VI and run it, I receive the following messages:>>
1) Compiler Error>> 2) float spill 6>> failure: E\lv45\lvsource\genufp.c>>
After this messages, Labview closes.>>This looks like a bug. Please report
it to technical support via email>and provide the VI. In the meantime, the
suggestion to use nodes for>some portion of it is a good one. Tecnically,
it should work either>way, but the formula node is typically used for simpler
expressions, and>this bug most likely hasn't been reported before.>>Greg
McKaskle

Hi Greg.
The vi with the formula node and this large equation works fine in LV5.1
but doesn't
in LV5.0. I will need an upgrade.....
About that error messages, the problem was a missing terminal in a sub vi
of the
" Nonlinear Lev-Mar Fit.vi". Now the vi is working fine but with x*x terms.
Ricardo.
0 Kudos
Message 8 of 9
(4,186 Views)
you may have already figured out the answer to your question, but i used the same notation for exponents and then ran across a labview doc that said to use x**2 instaed of x^2. I may have been reading the wrong thing, but apparently the carat (^) is used for some boolean operation so you have to use the ** instead. If I'm wrong please let me know, I am just getting started using formula nodes.

Doug
0 Kudos
Message 9 of 9
(4,185 Views)