| Electronics > Beginners |
| KVL and KCL Equations |
| (1/4) > >> |
| cjuried:
Hello, I have a basic circuit (I have attached a screenshot of the circuit) in which I am trying to enter both my KCL and KVL equations into my TI Nspire calculator using the "systems of equations" option. I keep getting a "False" for the answer. I am trying to solve for the three variables: is, ia, ib. The equations are: Equation#1 KCL at Top Node: -is+ia+ib=0 Equation#2 KVL @ Left Node: -200+is(4)+ia(20)=0 Equation#3 KVL @ Right Loop: ib(80)-ia(20)=0 Thank you for your help. |
| Nominal Animal:
I don't know what goes wrong for you, but when I tell Maxima (free/open source, available for all OSes) solve([ ia + ib - is = 0, 4*is + 20*ia - 200 = 0, 80*ib - 20*ia = 0 ], [ia, ib, is]); it tells me there is exactly one answer, [[ ia = 8, ib = 2, is = 10 ]] Maple agrees, too. |
| rstofer:
I like working on these problem with Maxima so I'll embed the code here. I highly recommend wxMaxima (the windowing version of Maxima). Of course, I also recommend MATLAB --- Code: ---/* Kirchhoff's Current Law */ KCL1 : Is=(200-Vn)/4$ KCL2 : Ia=(Vn-0)/20$ KCL3 : Ib=(Vn-0)/80$ KCL4 : Is-Ia-Ib=0$ res : solve([KCL1,KCL2,KCL3,KCL4])$ /* we could skip the 'res : ' part, replace the $ */ /* with a ; and skip the pretty print stuff */ /* like this: */ /* solve([KCL1,KCL2,KCL3,KCL4]); */ /* but I like pretty print */ results : float(res)$ /* this stuff is the pretty print of sorted results */ lngth : length(results[1])$ sorted : sort(results[1])$ print("KCL")$ for i:1 thru lngth do print(sorted[i])$ print("")$ /* Kirchhoff's Voltage Law */ KVL1 : 200 - (Ia+Ib)*4 - Ia*20 = 0$ KVL2 : 200 - (Ia+Ib)*4 - Ib*80 = 0$ KVL3 : Is = Ia + Ib$ /* KVL3 and KVL4 are not required for a solution */ KVL4 : Vn = Ia*20$ /* but they provide the other values for the circuit*/ res : solve([KVL1,KVL2,KVL3,KVL4])$ /* pretty print stuff again */ results : float(res)$ lngth : length(results[1])$ sorted : sort(results[1])$ print("KVL")$ for i:1 thru lngth do print(sorted[i])$ --- End code --- --- Code: ---KCL Ia=8.0 Ib=2.0 Is=10.0 Vn=160.0 KVL Ia=8.0 Ib=2.0 Is=10.0 Vn=160.0 --- End code --- [/font] The upper code block is the actual wxMaxima code while the lower code block is the output. You will notice that we disagree on the sign convention for KVL. That's ok, it doesn't matter. However, if I go through a device from (-) to (+), I treat that as a voltage gain. If I go through a device from (+) to (-), I treat that as a loss. In this circuit, all of the resistors are losses and the only gain is the battery because both of my loops are clockwise. One through the inner loop on the left and the other around the outside. That's MY sign convention and it isn't required as long as you are consistent. |
| cjuried:
Thanks for your answers. I changed my syntax and things came to life. I have attached a screenshot of the slight modifications in which TI Nspire calculators seem to be accustom to. |
| Tom45:
And for us fossils from the slide rule era: Didn't even need to use a slide rule for this one. |
| Navigation |
| Message Index |
| Next page |