Circuit Theory


Every now and then I write or modify a matlab function that I need for my research, and will post them to this blog here and there, with the hopes that they will be useful to someone doing antenna/microwave design.  I know, there is the Matlab File Exchange (which is very useful!) , but hey, this is my blog, I want to post my content here.

Below is a function I used to plot smith chart results in matlab.  I used basic plotting code to generate the chart itself, and added a simply plot function to add the impedance locus and constant VSWR circles.  Hope this is helpeful!  Please let me know if anyone finds a bug.  I will note that there is no safeguard in the function for s-parameters that are greater than 1, which if you are plotting the active S-parameters of a multiport device, are possible.  This isn’t a big deal when the S-parameter goes slightly above 1, but if it swings well above 1 you end up with a tiny smith chart and these erratic line segments…it’s a mess.  For passive applications I haven’t come across a bug yet.

smithchart.m


Ok, so my last post talked about the hits I have been getting from the xckd comic that is similar to a challenge problem I posted. So, I solved the same problem as on the xkcd comic:
link!

This solution is heavily based on the work I did for this solution, so you should review this before looking at this one if you haven’t seen this solution before, as it explains what the impedances shown below are and how I reasoned them out.

So here is my solution. I took a block of resistors around the two points, and the following rewriting of the circuit follows:
This is a true representation of the circuit. The T-Delta circuit transformation is a standard circuit theory technique. From here the circuit then looks as shown below, with the circuit theory solution then of the thevanin equivalent resistance.
I haven’t computed the R thevenin yet, which I will at a later date. However, knowing from this solution that Zin = (2/3)R, the new equivalent resistance can be solved by substituting this into the T-Delta equations and then into the final equation. Again, this will be posted when I get around to doing this.

Please let me know if you find any errors in my work…

Solution #1 (my solution I posted on the chalkboard)

First I stood there looking at the picture, and thought that if it is infinite in extent, all the square grid is essentially a repeating pattern of squares, then the input impedance looking into a side of one of the squares must also be periodic and symmetric in all directions. Therefore I said that if inside one of the squares, looking toward any of the sides of the square must be the same impedance, which I called Zin. As a result, the input impedace looking out of the box on any side is the same as looking into any one of the sides. Finally, I said if I look into the box from any one side, I can say the other 3 sides look like Zin in series all in parallel with a resistor “R”, as shown below:

So from the last sketch on the right, I believe this first step to be the trick — because from here on out is simple circuit analysis theory. Another way to think of it is that since it’s periodic, addind or subtracting a box should not affect things, so remove the box to the left of the box and then look along the Zin path.

So next, redraw the circuit like a normal circuit and solve for Zin as shown below:
This is not the answer, just yet. This is what the resistance looks like looking out of or into one side of the box.

In order to get the actual thevenin resistnace, now solve for the inpedance looking into the terminal set a-b, as shown below:
SO, the answer turns out to be that Rth is equal to one half of R, as shown above. This was the mathematical solution.

Solution #2 -
Here’s the cool, clever solution! (that I did not think of but that I found on google — what can’t you find on google?!)

This solution is so much simpler. It requires not thought about periodic impedances or input impedances looking this way and that way. It relies on symmetry, Ohm’s law and Kirchoff’s Current Law.

The first step here is to look at node “a” and “b” separately:
The next step is to apply a current source of 1A to terminal “a”, leaving terminal “b” alone. The current can be setup flowing into node “a”, as shown. The consequence is that since this huge grid is symmetric and infinite in extent, the current branches off into 4 equal currents, or 1/4 of an amp. Also, the other side of the current source can be said to be placed at infinity.
So, from the source at “a”, 1/4A will flow into the branch between node “a” and “b”. Now take away that source and apply another 1A source to node “b”, only this time flowing out of the node:
Once again 1/4A flows through each branch. Using the superposition theorem, the total current when both sources are applied will be the sum of the current from the source at “a” and the source at “b”, giving 1/2A flowing between node “a” and “b”.
Since one end of each current at infinity is moving 1A through the node at infinity (at node “a” source 1A is extracted whereas at node “b” source 1A is injected) then the two ends of the current sources can be thought of as connected, and therefore replaced by a single 1A current source.
Now, by definition of the thevenin equivalent circuit theorem, driving two terminals with 1A of current and then dividing the voltage that developes across the terminals by 1A, you get the equivalent resistance. This is shown above. The voltage is equal to the resistance “R” times the total current flowing through it, and diving this voltage by 1A gives the final equivalent resistance.

What an elegant solution. It takes explaining, but math-wise it is simple and it is very intuitive, using addition, basically.

So, I was walking through the engineering building here and came accross a chalk board that often has random stuff on it. Its basically a chalkboard for whatever you want to write. Sometime’s there are quotes written there, sometimes tick-tac-toe games, and sometimes some funny drawings. Today there was a brainteaser — specifically a circuit analysis brain teaser. Here’s a sketch of what was on the board:
This is an infinite grid of resistors (all of value “R”) - the elipsis implying that in all directions the circuit continues indefinitely, and the n is just saying this goes on til some “nth” resistor at infinity.
TASK:
Find the thevenin equivalent circuit across terminals a and b (essentially whats the thevenin resistance looking into those terminals).

I would like to be able to say this is an incredibly hard problem that I found the solution to, all Good Will Hunting style, but its just a brainteaser for circuit theory — there is a trick to it, and its neat, but other than that it’s not really anything all that impressive.

It took me a few minutes of thinking but I came up with a solution and it is now posted on the board.

I will state up from that there is a very easy, intuitive, almost no math solution to this problem. There is also a second, more complicated, mathematical solution. I was not clever enough to think of the elegant simple solution, and instead found the more complicated solution. Wasted work, if you ask me. I only found out about the simple solution because when I got back to lab I googled the problem to see if there were any solutions i could check my answer off of (and to see if there were more solutions). Thursday I will post both solutions. Best of luck.

EDIT: I drew only one “cell” of the grid, and drew elipsis to show it goes on forever in all directions, but to make it clear, the overall topology is a huge square grid that is infinite in extent in all directions, as shown below: