LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Solving math expression

There are two equations I would like to solve using a loop with labview, but am having trouble figuring out the correct structure to use and how to get it to work properly. They are:

 

(sin(1))* (sin(2))* (sin(3))9  *… * (sin(10))30

 

and 

 

 1*2*3 + 2*3*4 + 3*4*5 + ... + 18*19*20.

 

Any help is greatly appreciated.

 

0 Kudos
Message 1 of 6
(2,791 Views)

Seems like homework, try something and post the one which you tried based on which others will guide you to achieve your result.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(2,787 Views)

I have this to start with for the first problem. But I don't know how to start the loop at 1 instead of n-1, and I don't know how to multiply the value for one pass of the loop to the next value. 

0 Kudos
Message 3 of 6
(2,775 Views)

MathCalc.png

 

Use this sample and try for other query.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 6
(2,765 Views)

When any of us do your homework for you, we are cheating you of the opportunity to learn something.  Any of us who have become reasonably competent in programming any language knows that the best way to learn a language (true of written and spoken language, as well) is to use it, which in your case means solving your own problems.  What you should have done is to try it yourself and post the VI you wrote, however "bad" it is.  If we see that there is a conceptual error you are having, we can explain the nature of the problem, and the next time, you'll "get it".

 

Please, try to do your own work firstshow what you've done (so we'll understand where you are having difficulty and can help to teach you, rather than "doing it for you").

 

Bob Schor

Message 5 of 6
(2,721 Views)

Hi Need,

 

But I don't know how to start the loop at 1 instead of n-1,

To "start" the loop with "1" instead of "0" (as the loop iterator starts with zero) you might use some very simple math expression like "+1"…

 

I don't know how to multiply the value for one pass of the loop to the next value. 

You might start to learn LabVIEW by taking the free learning resources offered in the "Training resources" in the header of the LabVIEW board!

Read the chapter on loops and shift registers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,693 Views)