LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert complex equation in LabVIEW without mathscript

mrdas9820_0-1722908634864.png

Hello everyone. Could you please assist in creating a LabVIEW block diagram based on the attached formula?

Thank you

0 Kudos
Message 1 of 15
(774 Views)

Hi mrdas,

 


@mrdas9820 wrote:

Could you please assist in creating a LabVIEW block diagram based on the attached formula?


What have you tried and where are you stuck?

Best regards,
GerdW


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

I assume you know the datatypes and number of dimensions of the inputs and output. Are these complex datatypes?

 

Do you have a website that describes the math (I.e. is the source of your formula image)?

0 Kudos
Message 3 of 15
(669 Views)

Providing a "complex equation" without references is not very useful for us to help you learn to handle this yourself.  Some "notation" questions include the following:

  • V(subscript i)(superscript k+1), I assume, is an array element (indexed by i, going from 0, or possibly from 1 to n) that is the next iteration of a routine that possibly converges to some function of one variable.
  • V(superscript *)(subscript i)(superscript k) is the preceding value of the i-th iteration of the V function.  The * might indicate "complex conjugate", or might mean something else.
  • P(subscript i)(superscript sch) is an array element of P(superscript sch).  No explanation of the meaning of the superscript.
  • The following Q element has a "j" preceding it.  As there is no index "j" yet, this might mean the "imaginary" value, sqrt(-1), or something else.
  • The upper summation is a dot product of y(subscript i)(subscript j) and what I assume is the previous iterate of the V function (leaving out the j=0 term and the term where j = i).  Note that j also appears in the first term on the right-hand side -- not clear if these two "j" symbols are the same (in which case, what is the value of j in that first term?).
  • The denominator is a simple sum of a column of the 2-D y array, omitting the "j = i" element.

Do you know how to create Arrays in LabVIEW?  Do you know how to use a For Loop to index elements of Arrays?  Do you know how to do simple arithmetic (addition, multiplication, and division) in LabVIEW (hint -- use functions called "Add", "Multiply", and "Divide").  Do you understand how you can use "wires" to take the output of, say, an addition and have it be the "numerator" element of a Divide function?

 

If you are "iterating" (over "i") to determine V (as a function of i), do you know when/how to stop iterating?

 

Bob Schor

0 Kudos
Message 4 of 15
(655 Views)

I have tried using a for loop and other methods, but I haven't been successful. Could you please help me, Prof?

0 Kudos
Message 5 of 15
(537 Views)

Hello, prof. This is a power flow solution formula using the Gauss-Seidel Method.

I have attached a book related to this formula. Thank you

0 Kudos
Message 6 of 15
(535 Views)

Thank you for your detailed explanation. I apologize for any confusion caused. Yes, the equation is from the Gauss-Seidel method used in power flow analysis. Here are some clarifications:

  1. Vi(k+1)V_i^{(k+1)} is indeed an array element indexed by ii, representing the next iteration of the voltage at bus ii, which is part of the iterative process to converge to a stable solution.
  2. Vi∗(k)V_i^{*(k)} refers to the complex conjugate of the voltage at bus ii from the previous iteration kk.
  3. PischP_i^{sch} represents the scheduled active power at bus ii.
  4. The "j" in front of QischQ_i^{sch} indeed denotes the imaginary unit, representing the reactive power.
  5. The summation involves the dot product of the admittance matrix YijY_{ij} and the voltage vector Vj(k)V_j^{(k)}, excluding the diagonal element where j=ij = i.
  6. The denominator is simply the diagonal element YiiY_{ii} from the admittance matrix.

I am familiar with creating arrays, using For Loops for indexing array elements, and performing arithmetic operations in LabVIEW. However, I am struggling with implementing this specific iterative process correctly in LabVIEW, especially with managing the complex data types and ensuring proper convergence of the solution.

 

Any guidance on how to properly set this up in LabVIEW would be greatly appreciated. Thank you in advance for your assistance.

0 Kudos
Message 7 of 15
(530 Views)

The following is the block diagram that has been created

0 Kudos
Message 8 of 15
(528 Views)

@mrdas9820 wrote:

The following is the block diagram that has been created


That looks more line an image of a block diagram and most of it makes no sense at all. A "one iteration FOR loop" is just a glorified sequence structure. Your use of local variables is creating massive race conditions because you cannot tell in what order they (or the terminal) gets written or read.

 

What are these blue squares? They are not functional parts of the code, right?

 

Is there anything preventing you from attaching the VI instead?

0 Kudos
Message 9 of 15
(493 Views)

Hello prof,
The blue squares are just to make it easier to group the steps, it is not for code function.

For this for loop, I am still confused. How is the formula converted into a block diagram? For input variables, you can see it at the very top.

Here I attach the VI.

0 Kudos
Message 10 of 15
(460 Views)