# LabVIEW

cancel
Showing results for
Did you mean:

## Solving linear equation

Is any formula to solve the below equation in LabVIEW

3*x^1/2+2*x+7*x^3/2+2*x^2+5*x^5/2=2

Message 1 of 10
(3,421 Views)

## Re: Solving linear equation

If you have a formula, it does not depend on the programming language. Nothing to do with LabVIEW.

Is x guaranteed to be positive?

If you don't have a formula, you could e.g. use e.g.  Newton-Raphson with a few iterations starting with a reasonable guess. A nice programming exercise. 😄 LabVIEW Champion. Message 2 of 10
(3,412 Views)

## Re: Solving linear equation

Have you tried using the formula node?

Message 3 of 10
(3,359 Views)

## Re: Solving linear equation

@Fewoiz wrote:

Have you tried using the formula node?

It is "=2", not "+2" and he wants to solve for x. LabVIEW Champion. Message 4 of 10
(3,353 Views)

## Re: Solving linear equation

Yeah I know,  I wasn't sure if I was being too simple but assumed that he would know to rewrite the equation so that 2( as a variable) is the input and X is the output.

X= 0.222647?

Message 5 of 10
(3,341 Views)

## Re: Solving linear equation

Thanks to everyone for your valuable inputs.

Atlast i solved the equation by doing some modifications in the vi which i downloaded from forum and am attaching the same vi here

Message 6 of 10
(3,323 Views)

## Re: Solving linear equation

Brabin777 wrote:

Atlast i solved the equation by doing some modifications in the vi which i downloaded from forum and am attaching the same vi here

Why is the VI so messy? LabVIEW Champion. Message 7 of 10
(3,288 Views)

## Re: Solving linear equation

@Brabin777 wrote:

Thanks to everyone for your valuable inputs.

Atlast i solved the equation by doing some modifications in the vi which i downloaded from forum and am attaching the same vi here

Don't forget that there will be quite a few more roots, some complex. In this case, there is one real root and you can find it as follows using this VI. (Of course you need to make certain assumptions about x). In the more general case, use this VI to sort out the real roots.  LabVIEW Champion. Message 8 of 10
(3,285 Views)

## Re: Solving linear equation

Thanks

As mentioned earlier here is the link where i got vi to solve the equation https://forums.ni.com/t5/LabVIEW/Solving-Math-Expression-using-Labview/td-p/2113376

Message 9 of 10
(3,274 Views)

## Re: Solving linear equation

Hi,

The „Solve Linear Equations VI“  works differently in PC and in Realtime. When I run the attached VI in the PC (without compilation) it gives TRUE. The same VI when I run in Real time Project (cRIO – with compilation) it gives FALSE.

I have gone through the VIs and I found different function for different target (Default & RT Target). Why its different for various target? The result without compilation (Default) is correct value. How I can use that?

Whether the DLL format is not supported by Realtime?

Thanks & Regards,

Shree

Message 10 of 10
(2,833 Views)