 If there are no questions what we will do is move on to systematic ways of analyzing circuits ok. We have now discussed the number of circuit elements and they can be interconnected in any way and we have to be able to find the solution to the network. That means that we have to be able to find the voltage across any branch, any component and the current through any component ok. And this process is known as circuit analysis ok. And as we know a circuit is an interconnection of number of elements ok. Now the elements that we know of are two terminal elements. You can have more than two terminals but for now let us stick to two terminal elements ok. So, as an example let me take this is just some example that I am going to show ok. So, you see a number of elements we have a number of current sources and resistors connected up like this. And when we are discussing circuits in general and not specifics of each component we use some terminology that is generally applicable to any element. Now the point of interconnection of many terminals this is called a node ok. Now how many nodes does this circuit have? This is a question for the participants. How many nodes does this circuit have? So, I see a number of answers here many of you say it is 4 and that is correct ok. So, we have we have one node here another node here another node here and this whole thing it is written as an extended line but of course this is a node ok. For convenience we write it like that but if you just have a wire that is a node ok. So, we have four nodes in the circuit. Now each element or whatever is connected between two nodes such as this resistance here ok this resistance is connected between this node and that node and that constitutes a branch ok. Now how many branches do we have in this circuit? Each element because we have only two terminal elements each element corresponds to a branch. So, how many branches do we have in the circuit? So, many of you again said gave the answer correctly that there are eight branches. Now sometimes you can combine two parallel elements into a single element and call that a single branch. Right now I will consider each of these things as a branch ok each of these elements that is a branch. So, is this and this this this so that is five six seven and eight ok. So, we have eight branches ok. Now when we say we have to solve a circuit that is we have to do circuit analysis what it means is that you have to find the voltage across every branch every element and the current through every branch or element ok. So, that is the meaning of the statement that I have solved for this circuit ok. Then you know everything about what each element is doing ok. For instance if you have a voltage source you can figure out whether it is dissipating power whether it is consuming power or how much power it is consuming or dissipating and so on same for a resistor. So, given that how many variables do we have to solve for? If we have eight branches how many variables do we have to solve for? Now I see a number of answers with numbers like 3, 4, 5 and so on, but my question is the following right. We have eight branches in the circuit ok. Now I want to know the current and voltage across every branch and those are the unknowns right. So, how many variables are there to be solved for? Perhaps the question is not clear maybe I will pose it as multiple choice so that everybody can take another shot at it. I have opened a poll with the choices please answer on that one. What is the number of variables to be solved for? 4, 8, 16 or 20? Ok now it appears that some of you have said 4 and some of you have said 16 and 16 is the correct answer of course because see if you have eight branches each branch has a voltage and a current and you have to find out all of it ok. Now some of that may be easy like for instance if you have a current source you already know the current through that but that was not the point of my question ok. The thing is there are 16 variables to be solved for and somehow or the other we have to find 16 equations from which we can solve these 16 variables ok. Now whether it is easy or difficult that is a different thing. So, finally when you say that I have solved for this circuit completely you have to specify the voltage and current in each branch voltage across each branch and current through each branch ok. So, that is what is meant by solving for a circuit. So, in general let us say you have a circuit with n nodes and b branches ok. You have 2 times b variables to be solved for ok. So, in our case b is 8 but whatever the number of branches you have you have to solve for 2 b variables ok. Is this fine? Now the question is what are the 2 b equations ok. So, this means that need 2 b equations ok. Now what are these what are the equations that will govern our circuit? First of all at every node we can write Kirchhoff's current law and around every loop we can write Kirchhoff's voltage law and finally we have V i relationships of each element ok. So, from these things we have to pick the appropriate set of equations and then solve for the circuit ok. I hope this is clear so far. Now so let us go through these things one by one. As all of you know to solve for 2 b variables we need to have 2 b independent equations ok because if you have some dependent equations they are useless right. I think all of you know what dependent and independent equations are. If you have a set of equations now if some equation can be generated as a linear combination of other equations then that is a dependent equation meaning it is not telling you anything that the other equations are not same ok. For instance you have one equation over here x plus y equal to 0 and let us say you have another equation which says 3 x plus 3 y equals 0. Clearly you can get this by multiplying the first equation by a factor 3 ok. Now if you do that then that means that this is not telling you anything that the first one did not tell you ok. So, this is dependent on first equation so this is not useful. Now if you had a second equation which was let us say 3 x plus 2 y equal to 0 clearly you cannot get this by multiplying this by any number ok. This is an independent equation of this one. So, using these two you would be able to solve for both variables x and y ok. So, now we have n nodes and we know that at every node we have KCL equations. So, my question is how many independent KCL equations do we have if we have n nodes. So, if we have n nodes how many independent KCL equations do we have? At every node we know that the sum of currents flowing out of the node is 0 ok that is always true, but how many independent KCL equations can we generate? So, some of you said n and many of you also said n minus 1 ok and this is the correct answers there are n minus 1 independent KCL equations and that is because let me take a simpler circuit than what I had before. These are some elements right while writing KCL I do not care what elements they are because I am only summing up the currents. Now let me call this n 0, n 1, n 2, n 3 ok and let me call these things i 1 0, i 1 2, i 2 3, i 2 0 and i 3 0. Now what I will do is I will write KCL equations at every node and my convention is to take the sum of all currents flowing away from the node ok, sum of currents flowing away from the node should be equal to 0. Now what is the equation for n 1? We have two branches i 1 0 and i 1 2 is currents which are flowing away. So, i 1 0 plus i 1 2 equals 0 ok and at node n 2 we have i 1 2 flowing in which is the same as minus i 1 2 flowing out, we have i 2 3 flowing out and i 2 0 flowing out ok minus i 1 2 plus i 2 3 plus i 2 0 equals 0. Finally, at node n 3 not finally, at node n 3 we have i 2 3 flowing in which is the same as minus i 2 3 flowing out and i 3 0 also flowing out. So, I have minus i 2 3 plus i 3 0 equal to 0 that is at node n 3 and finally, at node n 0 we will have i 1 0 plus i 2 0 plus i 3 0 equals 0 ok. So, at four nodes I have written the four equations, but you see that let me sum the first three. If I sum these three the equations resulting at resulting at n 1, n 2 and n 3 I sum the three equations what will I get? i 1 0 and i 1 2 will cancel with this minus i 1 2, i 2 3 will cancel with this minus i 2 3 and we will have i 2 0 plus i 3 0 equals 0 ok. So, the node at n 0 the KCL equation at node n 0 is the same as taking all the other KCL equations and summing them together ok. So, the KCL equation here dependent on the KCL equations at n 1, n 2 and n 3 ok. So, we do not have four independent equations we have only three independent equations. In general if you have n nodes KCL at one of the nodes will be dependent on all dependent on the equations at all the other nodes ok and this is quite easy to see. Now, this we have this circuit what do we mean by writing KCL at node n 0 essentially we take this closed surface and the sum of currents leaving this surface will be equal to 0 ok. By the way I have to change the notation on the last one my usual notation was to take the currents flowing away by this notation at n 0 the currents flowing away are minus i 1 0 minus i 2 0 and minus i 3 0 ok. So, this last one should have been minus i 1 0 minus i 2 0 and minus i 3 0 the equation I had written was correct, but the only thing was that the signs were reversed ok, but that does not change the fact that it is dependent on all the others ok. So, when I write KCL at equation n 0 I take this closed surface and say that sum of all of these currents equals 0 sum of all of the currents leaving this surface. Now, instead of looking at the looking at the surface surrounding node n 0 let me look at this surrounding the rest of the circuit ok. So, as it encloses this complete circuit the sum of currents flowing in all these wires that are cutting the surface will also be equal to 0 ok. Now, you see that the surface enclosing n 0 cuts these 3 wires and the surface enclosing the rest of the circuit also cuts the same wires. So, what you do what you get by writing KCL equations at n 1, n 2, n 3 and then summing them together is exactly the same as what you get by writing the KCL at n 0. So, in general if you have an n node circuit there will be n minus 1 independent KCL equations ok, is this clear? I hope this is clear if not please ask your questions ok. Now, I think it is quite simple the next thing is I have the same circuit with n nodes and b branches ok. How many independent KVL Kirchhoff's voltage law equations do we have ok? Please try to answer this one how many how many independent KVL equations do we have? That is you write KVL around every loop and you have to identify the independent loops. So, how many independent KVL equations do we have? There are lots of loops, but we have to identify independent loops. For instance, I take the same simple circuit I had before, I have a loop here, I have a loop here, I have a loop here ok. So, how many would I have? Now, some of you have given answers and the answer seems to depend only on the number of nodes and that is a little strange because you would think that the number of loops also would depend on the number of branches ok because if you do not have a branch then you cannot form a loop ok. Now, I am not talking about this specific circuit, if you have a circuit with n nodes and b branches how many independent KVL equations would we have? That is the question ok. So, it looks like you are not able to identify so, let us go step by step. Now, how do we know how many independent loops do we have? So, to do that I will define what is known as a tree ok. So, a tree is a set of branches that is out of all the branches we have in the of all the branches we have in the circuit, we will choose a set of branches which cover every node without forming a loop ok. That is what I mean is in this circuit I could choose this, this and this ok. Now, if they start from this node go to this one, this one and this one. So, if I draw only that part of the circuit ok n0, n1, n2, n3. Now, this will this set of branches covers all the four nodes n0, n1, n2, n3, but there is no loop that is formed ok that is very obvious from this. Now, this is not the only choice we can have some other choice like this and there are many choices I am not going to list all of them, but for instance you could have this and this one in the middle and this one ok that is this is n0, n1, n2, n3. So, there are many possible trees, but what each what all the trees have in common is that they cover all the nodes without first of all yeah without forming a loop ok. So, now this should be easier to answer how many branches are there in a tree how many branches would be there in a tree we have a circuit with n nodes and b branches. So, how many branches would be there in a tree again some of you are giving numerical answers I am now interested in general answer for a circuit with n nodes and b branches not for this specific circuit ok. I think this most of you are able to get it correctly there will be n minus one branches because if you have n nodes that is n0, n1 up to n, n minus one ok. So, you will have one branch from n0 to n1 and another from n1 to n2 and so on ok and you need n minus one branches to form a tree ok I think all of you most of you have got this correctly right. Now once you have a tree ok it is a very clear that if you add any more branches if you add one branch. So, you have a tree already. So, let me redo this by numbering the branches let me redraw the circuit I will label the nodes n0, n1, n2, n3 and I will call the branches a, b, c, d, e ok there are 5 branches in this circuit ok. Now I will identify a tree this is my tree ok n0, n1, n2, n3 and this particular tree I have chosen has these branches a, b and d ok. Now what I will do is so as I said first of all with if you have a circuit with n nodes and b branches any tree you choose will have n minus one branches ok. So, clearly the remaining branches will not be in the tree that is b minus n minus one branches not in the tree ok. We have a total of b branches and the tree has n minus one branches. So, the remaining b minus n minus one branches or b minus n plus one branches will not be in the tree. Now what I will do is I will take my tree which is shown here and I will add one of the branches that is not in the tree ok. So, in this case I added branch c and then I will add another branch which is not in the tree ok. So, for this specific circuit by the way the number of nodes is 4 and the number of branches is 5. So, n minus one is 3 we have three branches in the tree here and b minus n plus one equals 2 ok. So, I have a possibility here and I have another possibility there ok. Now clearly if I add a branch that is not in the tree to the tree I will form a loop ok that is very clear because I have gone through all the nodes going without forming a loop. Now if I add any extra branch it has to be between the same nodes I have already covered all the nodes. So, it has to form a loop ok. So, this forms one loop and this forms another loop ok. So, that means that the number of independent loops is b minus n plus one actually couple of you had already got the answer Rt and so on. So, we have b minus n plus one independent loops. Now I will just go through the argument once more for clarity. In a circuit with n nodes and b branches we will have n minus one branches in a tree b minus n plus one branches not in the tree ok. So, now adding a branch to a tree forms a loop and how many such possibilities are there we have b minus n plus one branches which are not in the tree. So, we go and add them on one by one to form each loop. So, that means that we will have from these two you can infer that there will be b minus n plus one independent loops ok. So, this is some involved argument. So, if you have any questions or any doubts if something is not clear please ask now. Now somebody asked what are branches any element is a branch something that is connected between two nodes ok. Now, we are discussing circuit at a more abstract level later we will go back to the specific circuit and put a resistor or a current source or a voltage source and discuss that, but right now any of those things can be a branch ok. Any questions? Ok it appears that there are no questions on what we discussed this far. So, now let us go on some of the other things will become clear as we move along. So far we have n minus one independent KCL equations we have b minus n plus one independent KVL equations that is b minus n plus one independent loops ok. So, we have a total of b equations ok, but we had two b variables right b branch voltages and b branch currents. So, we need b more equations where will they come from? The question is between the KCL equations and KVL equations together we have b equations. So, where will the remaining b equations come from? We have two b variables right if we have b branches we have b branch voltages and b branch currents. Where do you think the rest of the b equations come from? Because to solve for two b variables finally we need to have two b equations. Now one of you said it comes from the v i relationship of each element and that is correct some of you said Ohm's law, but Ohm's law is very specific to a resistor. So, we have b elements or b branches and each element will have its own v i relationship. So, we have b v i relationships ok and together we have two b equations ok. So, with this we can solve for the two b variables which are b branch voltages and b branch currents ok. So, I hope this part is clear right now we have discussed this analysis only at a high level that is we did not go and analyze any specific circuit, but we only discussed how to set up the equations right. Now there are many ways of going about this first we can look at some simple circuits see how to analyze them. Now I have chosen to go in the other direction I will first show you how to analyze any circuit this is applicable to circuits of any complexity ok. Now of course you will not if you have 100 nodes and so many branches you will not analyze them by hand you will not be doing hand calculations you will set up the equations on a computer and solve it, but this method will be applicable to those things as well ok. So, given this now we can go on start with specific methods of circuit analysis ok is this clear any questions ok. Now there are two methods of circuit analysis first is called nodal analysis in this what you do is you start with KCL equations at the nodes ok and once you put down the KCL equations you will solve for a number of things and then you solve the complete circuit. So, first thing you do is to write down the KCL equations and if you do that you are basically doing nodal analysis. The second method is loop analysis where you start with KVL equations at around the loops ok and if you do this you are doing loop analysis we will discuss this later and a subclass of this is known as mesh analysis ok. So, we will first start with nodal analysis and see what it is all about ok. So, let me write down the original circuit I had I had this circuit and let me call this I1 and I3 I will call this R11 R12 R13 sorry R23 R22 R33 R13 the reason for this naming will become very clear and let me call this node N0 this is N1 N2 N3 ok. Now, I said that we will start with KCL equations at the nodes ok. Now, if we have N nodes it means that we have N minus 1 independent KCL equations that is if you have N nodes you will write this KCL at N minus 1 nodes and at one of the nodes you will not be writing the equation ok. In this particular case we have 4 nodes and we will not be writing the equation at one of the nodes ok. Let me choose that to be this bottom node N0 ok. Now, such a node the node where you are not writing the KCL equation is called the reference node and again the reason for this terminology will become clear ok. So, what I am going to do is to write KCL equations at N1 N2 and N3 in this case. Now, I just arbitrarily chose not to write it at N0 you could have chosen not to write at N1 and write it at N0 N2 N3 or you can basically out of the N nodes you can choose any one node and then say that you are not going to write the equation at that node ok. So, in my case I will write KCL at N1 2 and 3 ok. Now, let me write the KCL at node N1 obviously the current in this branch plus the current in that branch plus the current in that branch plus the current in that branch equal 0 ok. Now, I will also because we are trying to do this systematically for very large circuits I will use certain conventions in writing these equations ok. That is what I will do is I will have all the unknowns on the left hand side and all the knowns on the right hand side ok and what are the knowns what I mean by that is are the independent sources ok independent sources in the circuit that is for instance if I write the KCL at this node the current through R13 is unknown current through R12 is unknown R11 is unknown all those things I will group on the left hand side and this current flowing out is due to a current source independent current source. So, that is a known quantity and I will push it to the right hand side. So, the way I will write these equations will be summation of currents leaving the node equals any independent current into the into the node ok. So, that is how I will write the equations. And finally, here I have taken a circuit with resistors and current sources later we will also add voltage sources and analyze them. Now, I have to write the current in each of these resistors ok and the resistor has a certain VI relationship. Now, while writing the KCL equations I will use that current voltage relationship for the currents through the resistors ok. So, for instance what is the current through this resistance R12 it will be the voltage across the resistor divided by the resistance value ok. So, let me label that for instance let me call this current through R12 as I12 ok in this direction going from left to right. Now, we know that I12 will be equal to V12 divided by R12 ok. The current through this resistor equals the voltage across the resistor divided by the resistance value. Also what I will do is I do not want to keep on writing this thing in the denominator. So, instead of this I will use the conductance form of Ohm's law which says that it is V12 times G12 ok. So, when I write this it is implicit that G12 is 1 by R12 ok that is the conductance of this resistance this resistor. So, I12 is the conductance G12 times the voltage V12. I will write it in this form because the equations will look neater that is all it is not nothing fundamental about that ok. And finally what is this V12 it is the voltage between voltage across the resistor or voltage at node 1 minus the voltage at node 2 ok. So, I have to use these voltages. So, what I will do is I will use the voltages at N1, 2 and 3. Now again while choosing voltages there are many ways of doing it. I could choose the voltage across R12 as the variable across R23 as the variable and so on. Now to be systematic and to have a clean structure to the equations what I will do is I will not use those things, but I will use the voltage between N1 and N0 between N2 and N0 between N3 and N0 ok. Now the definition of N0 is very clear that is the node at which I am not writing KCL ok. All other node voltages I express as the voltage between that node and the reference node that is between each node and the node where I am not writing KCL ok. So, that I will say voltages at node N1, 2 and 3 with respect to the node N0. I will call these voltages V1, V2 and V3 ok. So, now it is very common to say something like the voltage at node N1 is V1. What is meant is that the voltage between N1 and the reference node is V1. Similarly, when you say the voltage at node N2 is V2 it is with respect to reference node. Never forget that a voltage is always measured between 2 points, 2 nodes ok. So, again between N3 and N0 it is V3. So, I will say this is V3 and V2 and V1 ok. So, that is about the conventions. So, what did I just to summarize in this method which is called nodal analysis. I will start with KCL equations at N minus 1 nodes. I will choose some node and call that the reference node. I will not write KCL there. I will write KCL at the remaining nodes and what is KCL? It is the sum of currents flowing out of the node equal to 0. The way I will write it down as the sum of currents basically unknown currents going out of the node equals the sum of independent source currents that are coming into the node. So, if you have a current source connected to that node I will push it to the right hand side ok. Now, this is a very common thing to do. You have variables on the left hand side and independent things on the right hand side and you solve for the variable. This becomes very clear as we go along. And finally, the currents and resistors I will write them in terms of voltages across the resistors times the conductance ok. Current in each resistive branch equals the voltage across that branch times the conductance. Now, I have to write the voltages. Again I will choose the variables in a systematic way. I will choose the voltage at each node with respect to the reference node as the voltage variables ok. If you have any questions about these definitions please ask questions now so that we can go ahead with the circuit analysis in a smooth way. Any questions about any part of what I said so far? There is one question basically asking instead of current sources. If we have voltage sources what do we do? Right now let us not take that case. I will first do it with current sources and resistors and later we will consider the case of independent voltage sources ok. So, looks like things are clear so far. So, now let me go ahead and write the equations in the manner I described. Now, the KCL at node N1 will be the sum of these currents through R11, current through R12, current through R13. The sum of those equal the current flowing into this node which is I1 ok. So, first of all the current through this R11 is V1 divided by R11 or V1 times G11 ok and the current through this R12 is the voltage across it which is V1 minus V2 ok. We are always taking the current flowing away. So, you take the voltage at this node V1 minus the voltage at the wherever the resistor is connected that is V2 plus V1 minus V2 times G12 plus here we have V1 minus V3 as the voltage across R13 ok. Now, the voltage across R13 is V1 minus V3 and the conductance of that is G13. Now, if I was taking the currents going away from this node I would say minus I1 right because I1 is flowing in that would be minus I1, but so let me first write it like this minus I1 equal to 0. Like I said all the independent sources I will push to the right hand side. If I have to put it push it to the right hand side I have to look at the current flowing into the node ok. On the left hand side I have all the currents flowing out of the node and that has to be equal to the current flowing into the node ok. So, as I said I will put all the independent variables on the right hand side ok. Now, at node N2 I will write it similarly the current through R22 is V2 times G22 ok because the voltage across that is V2 voltage between this and the reference node and the voltage across R12 is V2 minus V1 ok. Now, note that while writing the equation for node 1 for R12 I took the current from left to right. Now, I will take it from right to left ok that is because for every node I will draw the I will write the equations in terms of current flowing outwards ok. And the current flowing from right to left is V2 minus V1 times G12 ok. I hope that is clear and finally, if I take this R23 then the voltage across that is V23 because I want to take the current V2 minus V3 where because I would like to find the current in that direction. So, plus V2 minus V3 times G23 equals that should be equal to all the independent current that is coming into this node and we I do not have any independent current source connected to this node. So, this will be equal to 0 ok. And finally, at node N3 I have the current through R33 which is V3 times G33 plus the current through R23 again I will take it flowing away from node N3 ok that is I will look at the current in this direction and that would be V3 minus V2 times G23 plus finally, the current through R13 that is equal to V3 minus V1 times G13 and this has to be equal to total current contributed by independent current sources flowing into the node and that is equal to I3 ok. So, basically I have written KCL at the three nodes and I have tried to I have followed the convention that I earlier described. All the independent sources on the right hand side and the variables on the left hand side and all the variables are basically the node voltages with respect to the reference node ok. Now, I understand that this analysis it is systematic analysis. So, there are many steps like I said earlier in the course also please be very systematic and be very careful about the science when you do these things especially in the initial parts when you do not yet have much practice. I will stop here and take any questions if any of you is not clear about any of these terms then please ask the question and I will answer them. Any questions at all? So, everything is clear there are no questions about how I wrote these things and all the every term of every equation is clear ok good. So, everything is clear to everybody now although I wrote the equations like this I will rearrange them slightly again remember the variables here are v1, v2 and v3 ok. The KCL equations are written in terms of the node voltages with respect to the reference node as the primary variables. So, when I say when we solve these equations we will be solving for v1, v2, v3 and from there you can solve for everything else ok. So, this is one of the equations this is the other equation and finally this is the third equation. Now, I will rearrange these slightly and what I will do is I will group the variables that is I have v1 here there and there I do not want to have it like that. So, I will write it as v1 times g11 plus g12 plus g13 minus v2 times g12 minus v3 times g13 equals i1 ok that is I grouped all the coefficients of v1 and v2 and v3 then v2 here I will again write the variables in the same order minus v1 times g12 plus v2 g12 plus g22 plus g23 minus v3 g23 equals 0 and finally for the last one minus v1 g13 minus v2 g23 plus v3 g13 plus g23 plus g33 equals i3 ok. So, all I have done is to rearrange the equation so that I will have the variables together ok that is each variable has all of its coefficients grouped together. I think this is pretty clear and probably there will be no questions about this. Now a very common way of writing out these equations is in the form of a matrix and this is because it just looks neat that is the main reason right and then on the computer we have methods of solving the matrix solving the inverse of the matrix and that is why we write it like that. So, now the variables v1 v2 v3 I will put it into a vector ok and a vector is nothing but in this case a 3 by 1 matrix or a 3 by 1 vector in general if you have n nodes you will have n minus 1 independent voltages so n minus 1 times 1 vector ok. And now I will write this whole thing as some matrix times this variable vector equal to the independent source vector. Now what is the matrix it is nothing but these coefficients which multiply v1 v2 and v3 ok. So, the first element of the first row will be g11 plus g12 plus g13 the second element would be whatever multiplies v2 ok you know that when you multiply matrices you multiply this first element by the first element here second one by second one and the third one by third one. So, we will have minus g12 minus g13 similarly for v2 this minus g12 is the coefficient of v1 and g12 plus g22 plus g23 is the coefficient of v2 and finally minus g23 is the coefficient of v3 ok and here minus g13 is the coefficient of v1 and minus g23 is the coefficient of v2 and g13 plus g23 plus g33 is the coefficient of v3 ok. It is exactly the same as what I have here each of these rows corresponds to each of these equations ok and this whole thing will be equal to whatever I have on the right hand side. So, for the first one the right hand side is i1 the second one it is 0 and the third one it is i3 ok. So, this part is called the conductance matrix obviously it consists of conductances and this part is the vector of node voltages I will call that v ok and finally this is the vector of independent current sources ok I will call that i. So, when we write this equations for the circuit based on Kirchhoff's current loss and express the currents as voltage times conductance we will get this equation of the form which is the conductance matrix G times the variable vector v equals the source of independent vectors i ok. So, conductance matrix times variable vector equals source vector. Now, if you want to solve for v this means that v equals you know how to do this you have matrix times vector equals another vector this is a square matrix it will be the inverse of this matrix times i ok. This is somewhat like if you had scalars let us say you had a times x equals y you would say that x is y divided by a or a inverse which is 1 by a times y and now we have it in terms of matrices so this is the solution ok. Now, this whole thing it is basically about setting up the equations correctly as I said this is scalable to very large circuits. So, whatever the size of circuit you have you will be able to do it like this obviously in exams and in tests and by hand you will not be solving for anything more than a circuit with two nodes or at most three nodes because you will not be calculating inverses of 2 by I mean more than 3 by 3 matrix by hand ok. But right now the point is to understand how to set this up without any errors and with confidence for any sized circuit ok. Any questions on anything that we have done so far what I have done is to set up the KCL equations at n minus 1 nodes and I have chosen the voltage at these n minus 1 nodes with respect to the reference node as the primary variables ok. Ok, it appears that it is pretty clear so right now I do not want to solve this I am not going to solve it for any particular circuit but I just want to focus on the structure of these structure of the matrix here ok. Let me copy this over now the way I have written it is the first row corresponds to KCL at node 1 and the next is at node 2 and node 3 and I have chosen the same order for the voltages in the vector ok because I can write these in any order and I can also reorder these and change the order of the entries in the matrix. But the important thing is that I choose to have the KCL equations in some order n1 first then n2 and then n3 then I will also have the voltages in the same order v1, v2 and v3 ok and this is the kind of conductance matrix that I get. So now my question for you is what do you see about this matrix what properties do you observe in the matrix as it is written ok. I think many of you very easily observed that it is a symmetric matrix that is we have minus g12 here minus g12 there minus g23 minus g23 and minus g13 minus g13 ok. So clearly it is a symmetric matrix ok. Now let us focus on the diagonal the diagonal is this right what do you observe about the diagonal elements it is a symmetric matrix what do you observe about the diagonal elements for instance the very first entry of the matrix right the element 1 1 what is what is that clearly I think this also all of you are able to figure out correctly that the diagonal elements are some of conductances at that node when I say that node the matrix entry this is the element a11 if I call this a matrix a11 is the sum of conductance conductances at node 1. Similarly this a22 is the sum of conductances at node 2 and this is at node 3 ok. Now what are the off diagonal entries what is this let us say I call this element a12 I think you know the matrix notation you have a11 a12 a13 and so on what is the what is this element a12 yeah again I think it is pretty clear the off diagonal elements are if I take the element aij it is the conductance or the negative of the conductance between the node i i and j ok. So that is how we have that is why this entry a12 is minus g12 that is the conductance between conductance connected between node 1 and node 2 and it is also why the matrix is symmetric this is the conductance connected between node 2 and node 1 obviously that is the same as the conductance between node 1 and node 2. So that is how we have symmetry but to get the symmetric structure please note that the ordering of the node equations and the ordering of the vector has to be exactly the same ok. For instance if I could interchange these two equations ok this row will come here and this row will go there and similarly on the right hand side it will change but then the symmetry is lost you will have the symmetric structure only if the ordering of the equations is the same as the ordering of elements in the vector ok just clear. So now this can be extended to circuits of any size right the only restrictions we have so far are that we have only independent current sources and conductances ok we have only independent current sources and conductances in the circuit with that we have all these nice properties that we get a symmetric matrix with the diagonal elements being the sum of conductances at that node and off diagonal elements being the conductance between two nodes ok the negative of that ok. Any questions so far and to solve for this you will have to invert the matrix G and multiply the source vector with the inverse of the matrix G ok. So in summary nodal analysis consists of first of all writing KCL at n minus 1 nodes first before this let us say you choose a reference node you write the KCL at n minus 1 nodes in the form of sum of currents flowing out equals independent source currents flowing in ok and also this current is written in terms of node voltages with respect to the reference node ok. Now what this will give you you will get an equation of the type G matrix times V vector equals the source vector ok and solving this will give you the node voltages G inverse times I ok. Now we have not yet solved for the complete circuit like I said earlier the complete solution consists of solving for every branch voltage and every branch current but the hard part is done now ok we have a complicated network and we have found all the node voltages ok. Now if you want to find all the branch voltages that is very easy ok for instance the voltage across R11 is nothing but the voltage between node 1 and node 0 ok. So let me see let me call this I have already called this V1 that is the voltage between N1 and N0 is V1 N2 and N0 is V2 and N3 and N0 is V3. So the voltage across R11 is V1, R22 is V2, R33 is V3 ok across R12 it is V1 minus V2 in this direction across R23 it is V2 minus V3 and across R13 it is V1 minus V3 and also across this current source in this direction it is minus V1 and in this direction it is minus V3. The reason I wrote down all these things is just to show that all the branch voltages come out of some trivial manipulation of the node voltages ok. So generally when you say solve for this we will solve for the node voltages and leave it there and if there are any other specific questions that are asked like the branch voltage of a specific branch you can easily construct it by taking the voltages across that branch that is taking the difference of two voltages or maybe in some cases like R11 the node voltage itself is the branch voltage ok and similarly now for branch currents you have to go to every branch and look at the current voltage relationships you know the voltage of every branch so you will be able to tell the current of any branch ok for resistors the current is proportional to the voltage and for these independent current sources the current is already known they are independent of the voltages ok. So what I want to point out is that after this there are a couple of steps to get all the branch voltages and all the branch currents but at this point we say the circuit is solved because the rest of the steps are kind of trivial ok because you just take the difference between some two node voltages to get the branch voltage and you multiply that by conductance to get the resistor currents ok. So we have come to the end of this lecture in the next one we see that our circuit has some limitations we have not analyzed a circuit that is universal we only have current sources and resistors obviously we will also have independent voltage sources as well as control sources that is dependent sources ok so that we will take up in the next class onwards now before we leave a couple of quick questions so let me first say that to this circuit I will add a current source ok yet another current source let me call it Ix just for simplicity now please answer the question how will this matrix be changed ok hope you remember what I wrote maybe I will copy that over let me copy over this whole thing what I did was to add this current source in blue ok and my question is I have set up these equations in the matrix form how will this be changed ok that is please answer the question in terms of what will change is it the first of all is it the right hand side that is going to change or the left hand side yeah I think it is pretty clear because we have added an independent current source that has to appear on the right hand side so the right hand side will change ok this will influence the right hand side now how will it change ok which will change which of the entries will change so the right hand side has a vector with three elements so which ones will change again it is pretty clear this is connected to node 1 and node 3 obviously it is only the equations at node 1 and node 3 that will change ok now what has happened is that node 2 we have not changed it at all so the middle row remains exactly as it is if you look at node 1 this current source I x is pointing towards node 1 so it adds to the current flowing into node 1 so instead of this I 1 it will become this I 1 will become I 1 plus I x and if you look at this node 3 I 3 is flowing in and this I x is flowing out so this part will become I 3 minus I x ok and similarly if I add I 2 in this direction this will be minus I 2 ok so by now you should have enough confidence to write down this matrix and set it up for any circuit like I said for arbitrary large circuits you are not expected to solve it by hand but solve it on a computer but you should be able to set up the equation for any sized circuits as long as they have only conduct answers and current sources ok so if you have any questions I will answer them I will otherwise we will wind up the session and meet on Thursday ok thanks for coming I will see you on Thursday bye