Using Node-Voltage method in the phasor domain

In summary, solving circuits using matrix inversion can be made easier by using a computer or calculator with complex matrix capabilities. However, if these tools are not available, there are some shortcuts that can be used to reduce the dimension of the matrices. In particular, dimension reduction can be used to reduce a 4x4 matrix to a 3x3 and then a 3x3 to a 2x2. Additionally, Cramer's rule for 3x3 matrices can also be used. However, doing these computations by hand can be time-consuming and challenging, especially with complex numbers. It is recommended to use a calculator with complex matrix capabilities or utilize available computer resources to solve these problems efficiently.
  • #1
november1992
120
0
I was wondering if there is an easier way to solve circuits using matrix inversion if I have complex numbers. So far I've been doing them by hand with 2x2 matrices. It isn't hard, but it takes a while. I have a test coming up in about a week which will have 10 questions that have to be solved in 1 hour. My teacher said that I may have to solve 3x3 or 4x4 matrices. If I have to do it by hand I don't think I'll finish on time
 
Physics news on Phys.org
  • #2
If you can have a laptop with you, your school probably has Matlab or something like it on the school network.

If you can't do that, you better get yourself a calculator that can do complex matrices, such as a TI89 or an HP48G, HP49G+ or HP50G.

You'll never be able to do a 4x4! :cry:
 
  • #3
The Electrician said:
You'll never be able to do a 4x4! :cry:
Gaussian elimination works just fine for 4x4 matrices. It wouldn't be fast, but it works.

Alternatively, do dimension reduction to get to a 3x3 matrix. Observe that if [itex]\sum_{j=1}^NA_{ij}x_j=b_i[/itex] then the following holds for x1.

[tex]x_1 = \frac{b_1 - \sum_{j=2}^NA_{1j}x_j}{A_{11}}[/tex]

If you substitute this back into the system, you get the reduced system.

[tex]\sum_{j=2}^N\left(A_{ij}-\frac{A_{i1}A_{1j}}{A_{11}}\right)x_j=b_i-\frac{b_1A_{i1}}{A_{11}}[/tex]

This will let you reduce a 4x4 to 3x3 and 3x3 to 2x2.

3x3 matrix can also be attacked directly. Cramer's rule for 3x3 is not that bad. It's just 1 3x3 determinant and 9 2x2 determinants. Even with complex numbers, not all that terrible. It does involve 9 complex divisions, though, to get the final result.

None of this is trivial, but it's not that complicated and can be done even with regular calculator. If you have one that does complex numbers, you can fly through them. And remember, people used to do this stuff with logarithmic slide rules. Be glad you are not them.

your school probably has Matlab or something like it
Octave does anything Matlab does and is free.
 
  • #4
K^2 said:
Gaussian elimination works just fine for 4x4 matrices. It wouldn't be fast, but it works.

Alternatively, do dimension reduction to get to a 3x3 matrix. Observe that if [itex]\sum_{j=1}^NA_{ij}x_j=b_i[/itex] then the following holds for x1.

[tex]x_1 = \frac{b_1 - \sum_{j=2}^NA_{1j}x_j}{A_{11}}[/tex]

If you substitute this back into the system, you get the reduced system.

[tex]\sum_{j=2}^N\left(A_{ij}-\frac{A_{i1}A_{1j}}{A_{11}}\right)x_j=b_i-\frac{b_1A_{i1}}{A_{11}}[/tex]

This will let you reduce a 4x4 to 3x3 and 3x3 to 2x2.

3x3 matrix can also be attacked directly. Cramer's rule for 3x3 is not that bad. It's just 1 3x3 determinant and 9 2x2 determinants. Even with complex numbers, not all that terrible. It does involve 9 complex divisions, though, to get the final result.

None of this is trivial, but it's not that complicated and can be done even with regular calculator. If you have one that does complex numbers, you can fly through them. And remember, people used to do this stuff with logarithmic slide rules. Be glad you are not them.

I think you're being overly optimistic. He said he does the computations "by hand" (so far), and he says that even a 2x2 "takes a while". He will have to do 10 such problems, some of which involve 3x3 and 4x4 complex matrices, in an hour. If he does them "by hand", as he has done so far, carefully so as to make no numerical mistakes, I think he's unlikely to get them all done in an hour.

K^2 said:
Octave does anything Matlab does and is free.

Matlab will also be free to him if it's on the school network.
 
  • #5
The Electrician said:
I think you're being overly optimistic.
Perhaps. But if he's not allowed a computer or a calculator with sufficient capabilities, it's better than nothing.

The Electrician said:
Matlab will also be free to him if it's on the school network.
Some schools don't. My university has a Mathemtaica license for student machines, but not a Matlab one. Of course, Mathematica will power through these just as easily. In either case, though, Octave is always an option.


I'm just trying to cover all the bases. Not saying your advice is bad. If he has an opportunity to use it, he should. If he doesn't, and he has to do it by hand, he'll get through more of them by utilizing some shortcuts.
 
  • #6
K^2 said:
I'm just trying to cover all the bases. Not saying your advice is bad. If he has an opportunity to use it, he should. If he doesn't, and he has to do it by hand, he'll get through more of them by utilizing some shortcuts.

What makes you think he doesn't know some shortcuts?

Furthermore, you seriously underestimate the difficulty of inverting a 4x4 complex matrix by hand, even with the aid of a simple calculator.

My copy of Golub & Van Loan gives the flop counts for various matrix operations, but for convenience I found a reference on the web. Consider:

http://www.physics.sfsu.edu/~bland/courses/385/downloads/vector/ch5.pdf

Look at table 5-1 on page 5-5.

To invert a 4x4, non-complex matrix takes about 384 flops (floating point operations, in case the OP doesn't know what a flop is) using the method of cofactors; the better (for 4x4 and larger matrices) Gauss-Jordan method takes 256 flops. If the operations involve complex numbers, and we're doing them by hand with a simple 4 banger calculator, each complex multiplication will take 4 real multiplies and 2 real additions; each complex addition will take two real additions. The number of real flops to invert a 4x4 complex matrix will certainly be greater than 4*256 real flops.

In addition, if using a calculator without built-in matrix operations, a person will have to write down (and keep track of) a large number of intermediate results and re-enter them on the calculator at various points during the calculations.

If the calculator can do complex arithmetic (but without built-in matrix operations), it still takes 256 complex flops to calculate the inverse of a 4x4 complex matrix. To do that in an hour would require making a calculation every 14 seconds, and that would include typing in the complex numbers and writing down intermediate results (and not making any mistakes in procedure or reading and writing a lot of numbers).

The OP won't be able to invert even one 4x4 matrix in an hour doing things the way he has been, much less also solve 9 more (possibly lesser) problems. He won't be able to do it even with a calculator that can do complex arithmetic without built-in complex matrix operations.

He better get a calculator that can do complex matrix arithmetic or access to an appropriate mathematical software package.
 
  • #7
You see how Cramer's rule (cofactor method) has a huge jump fro 3x3 to 4x4? Exploit that. It takes 27 flops to go from 4x4 to 3x3, giving you 80 flop computation for a 4x4 matrix. It's not an efficient general algorithm, but it is the most efficient way to do 4x4 case.

I can do 80 complex operations on a slide rule in half an hour. A calculator with built in complexes should get you done in less than 20 if you have a system.

If that's one problem out of a set of 10, this is entirely reasonable.
 
  • #8
K^2 said:
You see how Cramer's rule (cofactor method) has a huge jump fro 3x3 to 4x4? Exploit that. It takes 27 flops to go from 4x4 to 3x3, giving you 80 flop computation for a 4x4 matrix. It's not an efficient general algorithm, but it is the most efficient way to do 4x4 case.

You want to start with a complex 4x4 matrix:

attachment.php?attachmentid=53675&stc=1&d=1354786368.png


And calculate a reduced 3x3 matrix like this:

attachment.php?attachmentid=53676&stc=1&d=1354786368.png


I see that each element of the reduced matrix requires 1 complex multiplication, 1 complex division and 1 complex subtraction. I think this would require 15 real flops. And to do the 9 repetitions will require a total of 135 real flops.

Next, calculating the inverse of the 3x3 reduced matrix will require an additional 54 complex flops. I haven't determined the mix of multiplications, additions and divisions for this, but taking 3.5 real flops per complex flop, we would need 189 more real flops for a total of 324 real flops. If a full hour is allocated to this massive computation, one flop will have to be calculated every 11.1 seconds, no stopping, and this includes writing down intermediate results, and keeping them straight, and making no mistakes.

I don't think the OP would be able to do this using a calculator that can only do real arithmetic.

And, even if he has a calculator that can do complex arithmetic, he still must write down all those complex intermediate results and keep them straight, which takes longer that the calculations.. One of the very great advantages of a calculator that can do matrix arithmetic is not having to keep track of all those intermediate results.

His original problem was to calculate the inverse of a 4x4 complex matrix. Having calculated the inverse of the reduced 3x3 matrix, how much more computation is needed to get the inverse of the original 4x4 matrix? Just how does he do that?

K^2 said:
I can do 80 complex operations on a slide rule in half an hour. A calculator with built in complexes should get you done in less than 20 if you have a system.

If that's one problem out of a set of 10, this is entirely reasonable

What kind of operations? Multiplications, additions, divisions? As you know, you can't do addition on a slide rule. The additions will have to be done some other way.

If we assume a mix of operations similar to the OP's problems of 3.5 real flops per complex flop, you would be doing 280 real flops in a half hour--that's 6.4 seconds per real flop, and the matrix reduction would also require writing down and keeping track of the intermediate results.

I'm skeptical.

With a calculator, keying in an operand (and fairly often, keying in two) and then writing down the result will dominate each calculation. Any calculator can do +,-,/,and * in a small fraction of a second.

If I were the OP, I'd get myself a calculator that can do complex arithmetic, including matrix operations. He'll need it if he continues in an EE curriculum.
 

Attachments

  • Red1.png
    Red1.png
    706 bytes · Views: 633
  • Red2.png
    Red2.png
    1.1 KB · Views: 621
Last edited:

1. How does the Node-Voltage method work in the phasor domain?

The Node-Voltage method is a circuit analysis technique used to solve for unknown node voltages in a circuit. In the phasor domain, this method involves representing all circuit elements, such as resistors and capacitors, as complex impedances. The node voltages are then represented as phasors, which are vectors with amplitude and phase angle components. By applying Kirchhoff's Current Law and Ohm's Law, a system of equations can be formed and solved for the unknown node voltages.

2. What are the advantages of using the Node-Voltage method in the phasor domain?

The Node-Voltage method has several advantages in the phasor domain. Firstly, it simplifies complex circuits by representing all elements as impedances, making the analysis process more efficient. Additionally, it allows for the analysis of both AC and DC circuits, making it a versatile technique. Finally, it can handle circuits with multiple sources and dependent sources, making it suitable for a wide range of circuit analysis problems.

3. Are there any limitations to using the Node-Voltage method in the phasor domain?

While the Node-Voltage method is a powerful tool, it does have some limitations. It assumes a linear circuit with ideal elements, so it may not accurately model non-linear or real-world components. Additionally, it can be challenging to apply in circuits with a large number of nodes, as the number of equations to be solved can become cumbersome.

4. How accurate is the Node-Voltage method in the phasor domain?

The accuracy of the Node-Voltage method depends on the assumptions made in the analysis and the accuracy of the given circuit parameters. If the circuit is linear and contains ideal components, the results will be very accurate. However, as mentioned before, this method may not accurately model non-linear or real-world components, which can affect the accuracy of the results.

5. Can the Node-Voltage method be used in any type of circuit?

The Node-Voltage method can be applied to both AC and DC circuits, making it suitable for a wide range of circuit types. However, it may not be the best method for every circuit. For example, in circuits with only one or two nodes, other analysis techniques such as the Mesh Current method may be more efficient.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
  • Electrical Engineering
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Electrical Engineering
Replies
3
Views
758
Back
Top