LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Equation implemented in nested for loops.

Hi,

 

I’m trying to implement an equation similar to this one embedded in my VI. I’ve simplified it somewhat for the purposes of getting assistance from you guys with the mechanics of crunching through the calc with LabVIEW.

For the equation given can you tell me if the code I’ve produced does what it should be doing to mathematically represent this equation to resolve B? I’ve been thinking about this too long now and my brain is beginning to hurt a little 🙂

 

Many thanks

L. noob!

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

I think this is what you are going for.

 

Remember that i starts at 0, so you need to add one.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(3,376 Views)

As a mathematician I would utilize the distributive property, or as a software developer I would move a loop invariant.  As a minimalist with no regard for memory I would go an alternate route.

 

 

NestedSum.png

Message 3 of 8
(3,361 Views)

As a minimalist with no regard for memory I would go an alternate route.

 

Shockingly, guess which uses less memory  (unless I missed something) 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(3,351 Views)
Thanks crossrulz... I did have it in that case configuration at one point but you convince your self it's not right lol. Also I was taking account of u starting at 0 however in my real scenario I'm pulling I and j values from a table which is of course offset 0 too.

Darin I'm not sure I follow your words of wisdom... Would u mind explaining layman's terms?

Many thanks
0 Kudos
Message 5 of 8
(3,347 Views)

@labnoob wrote:
Thanks crossrulz... I did have it in that case configuration at one point but you convince your self it's not right lol. Also I was taking account of u starting at 0 however in my real scenario I'm pulling I and j values from a table which is of course offset 0 too.

Darin I'm not sure I follow your words of wisdom... Would u mind explaining layman's terms?

Many thanks

Well, I'm not neerly a wise in the math field as Darin but,  the snippet he attached shows two methods to achieve the same result.  One uses a little known vi pulled out of a dark corner of vi.lib and Well lets just say its Block Diagram looks like this

!1.png

I don't understand the comments eitherSmiley Very Happy  but, it apparently does what you wanted to do if hooked up like Darin showed.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(3,345 Views)
Ahhh! I'm on my phone didn't see the snippet. Will check tonight when I'm home. Thanks lads
0 Kudos
Message 7 of 8
(3,342 Views)
Just reviewed your suggestions darin. Your second one looks waaay to intelligent and lean for me personally. I can visually understand the first method easier so will stick to that I think. Many thanks for your time validating this and showing me other better solutions too.

L. Noob
0 Kudos
Message 8 of 8
(3,306 Views)