Jeffrey Phillips Freeman discussing Bioalgorithms, Machine Learning, Computer Science, Electrical Engineering, HAM Radio and everything science.

Nodal Analysis Tutorial

Nodal Analysis is a technique for circuit analysis where each node (A point where two or more components are connected) is interpreted individually. This analysis can be used to determine the voltage, or any other variable, at any point in the circuit, sometimes as a function of time. It is based on the fact that at any node all the current that enters the node will be equal to all the current leaving that same node. By doing this we are able to reduce each node to an equation, and then, the entire circuit to a set of simultaneous equations.

Identifying nodes

First you need to learn how to identify nodes in a circuit. A node is simply the junction where two or more components are connected by wire. The following diagram shows a circuit where the nodes are circled in red:

Analyzing a node

The next step is to represent each node in your circuit as an equation. If you are doing an analysis in the time domain then this is usually represented as voltage as a function of time \(V(t)\). This can also be done in the frequency domain using Phasors. For this example we will work in the time domain. Let’s use the same circuit as the one above:

First we need to assign arbitrary directions for the current flow in and out of each component on the circuit. It doesn’t need to match the direction the actual current flows because if we reverse it then the values we get for the current through that component will just come out to be negative. What is important is that if current goes in one side of a component it goes out the other side. Other than that it’s completely arbitrary. So lets pick some random directions for the current flow in our diagram:

You probably also noticed the ground point. This is also arbitrary, you can pick any node in the circuit as your ground. Mathematically you represent whatever node you pick as ground to be 0 volts. Depending on which point you pick as ground it will effect the voltage values you get for the other nodes, but they will all be the same relative to each other.

Lets assume \(I_{1}\) varies with time. Therefore it will be represented as a mathematical function: \(I_{1}(t)\). Now lets look at each node individually and represent them as mathematical functions. In addition let’s assign a variable to each node representing that node’s voltage.

First let’s look at the upper left node labeled \(V_{1}\), the one connecting \(I_{1}\), \(R_{1}\), and \(C_{1}\). It has three paths for current to flow in/out from each of the three components. We know these three currents will add up to zero because all the current coming into the node (positive values) must equal all the current exiting the node (negative values). With this knowledge we can represent the node mathematically.

The current coming in from \(I_{1}\) is easy, since this is a current source that varies with time it is simply \(I_{1}(t)\).

We then need to consider the current coming into the node from \(R_{1}\). Since we know Ohm’s Law which states \(I=V/R\) we can represent the current flowing through \(R_{1}\) in these terms. Since \(V_{4}\) is our ground point it will always have a voltage of 0. Therefore the current flowing through \(R_{1}\) is simply:

Now the current through \(C_{1}\) is a bit more tricky since we need to use differential equations to model a capacitor in the time domain. The differential equation representing the current flowing through a capacitor is:

Therefore we represent the current through \(C_{1}\) as:

Remembering that the sum of these three currents will equal zero we come up with the equation:

The final step is to get this into a function representing the node’s voltage as a function of time, in other words \(V_{1}(t)\). To do this we just use some calculus and differential math to solve for \(V_{1}(t)\) in the above equation. Teaching calculus is outside the scope of this document so we will leave it to the reader to solve for \(V_{1}(t)\). Once we solve for \(V_{1}\) we get the following:

We now know the voltage of this node (\(V_{1}\)) as a function of time. The only problem is that this function also seems to depend on the voltage functions for the other 3 nodes. That’s why the next step is to obtain the voltage as a function of time for the other 3 nodes in the same way we did for this node. Once we do that we will have 4 simultaneous equations and we will have what we need to solve for any variable we want.

Lets quickly go through and perform nodal analysis on the other 3 nodes starting with node \(V_{2}\):

Solve for \(V_{2}(t)\) to get:

The last two nodes will be much simpler since they don’t connect to the capacitor, therefore we don’t need to deal with differential equations. For \(V_{3}\) we get:

Solve for \(V_{3}(t)\) and you get:

For node \(V_{4}\) we already know its value is 0 so we can skip this node all together.

We now have 3 simultaneous equations, one for each node of the circuit (except ground). In the next section we will use them to solve for the voltage at any point as a function of time.

Bringing it all together

The rest of the process should be pretty apparent right now if you’re familiar with solving for simultaneous equations. Since this isn’t meant to be a math tutorial we won’t go into the details on how to solve simultaneous equations.

There are basically two approaches to simultaneous equations. Either substitution, which is more tedious but doesn’t require any advanced math, or linear algebra matrices. Generally if you aren’t familiar with linear algebra and are doing it by hand you’re gonna want to use substitution, which is the same as the process in basic algebra. However if you are familiar with linear algebra and plan to use a calculator to get your answer then matrices are much easier to work with.

The first step is to assign some values to our components (normally this is done for you of course):

Similarly we need to define the function governing the current source. We will use a simple sinusoidal current source:

Since the scope of this tutorial doesn’t include calculus we will show the quick way to do this in maple. To solve for multiple simultaneous equations in maple simply use the dsolve command like this:

dsolve({<equation 1>,<equation 2>,...<equation n>},[<unknown 1>, <unknown 2>,...<unknown n>])

Maple will now produce the three independent functions for the 4 nodes. When we plug the values for the components in and solve for the various nodes simultaneously we get the following equations:

Thats all there is to analyzing a circuit in the time domain!

Frequency Domain Circuit Analysis Tutorial

Some time back I started writing a book in an attempt to help explain how to do circuit analysis by hand. Originally it was going to include both time-domain analysis as well as frequency-domain analysis. The book is incomplete and I never got to cover the time-domain but has several complete examples showing frequency-domain analysis on many common circuits. I’ve gotten some compliments over the years, particularly from HAM radio operators, on how useful the book has been to them. I’d like to share here what I have so far in case anyone might find it useful.

As a side note if anyone would like to revive the project and work with me on expanding and completing the book it would be most welcome. Please feel free to contact me. In the meantime here is the compiled book in its current form. I don’t currently have the latex source code published anywhere but if there is any interest I will happily publish it and open-source it on github.

My New High Frequency Vertical Antenna

For several years now I wanted to replace my older High Frequency antenna which had partially fallen down; it was a G5RV Jr. However it never really worked right; it used a metal mast which had detuned the antenna and after about a year it started to fall down and became completely inoperative anyway. Throughout the years it got me some DX, but overall it really never performed that well.

I am in a rather unique situation when it comes to antenna options. I live in south Philadelphia; that means there aren’t many sky-scrappers immediately around my house, however, I am surrounded by a sea of row homes as far as the eye can see. Since a tower of any reasonable size is clearly off limits that meant my backyard wouldn’t be a particularly useful place for an antenna. That left me with just one option, my roof. This of course has the advantage of being 25 feet off the ground and giving me a reasonably decent view of the horizon. Of course it also has the disadvantage of having very little room to work with.

In the end a vertical type antenna, with coil traps to make the size manageable, was selected; Specifically the Hustler BTV-6 antenna which is designed to work everything from 80m to 6m. A balanced dipole type antenna wouldn’t work too well since I would have had very little control over the takeoff angle since the ground plane for such an antenna would be 25 feet down, and through my house. That meant a dipole type balanced antenna would be very hard to configure effectively. With a Vertical type antenna, however, the radials act as the ground plane, so seemed like a far better choice.

One other advantage to using the roof is that the distance to run the coaxial feed line from the radio to the antenna is very short. With only 10 to 15 feet of coax that means feed line loss will be very low even when the Standing Wave Ratio is high. I tried to position the coax on the roof such that the run is as short as possible. This should help prevent common mode current which could occur if the shielding of the coax becomes inductively coupled with active element of the antenna. Since the coax is significantly shorter than the wavelength being transmitted this effect should be minimized. Of course when putting a vertical in a yard you can actually dig a trench for the feed line placing it beneath the radials. Since this wasn’t an option in my setup it became critical to keep the coax line as short as possible.

Here are some pictures of the newly installed antenna including all the radials.

Hustler BTV-6 Active Element Hustler BTV-6 Base Radials Towards Front of House Radials Towards Back of House

As you can see in the last picture the antenna occasionally made contact with the metal mast which supported it. When this happened it would create a short to ground and completely detune the antenna. As such I added some insulating foam to the supporting mast to ensure it wouldn’t be able to make conductive contact with the antenna.

Mast Insulated

Finally to top everything off I added a new 8 foot by 5/8 inch ground rod to the system. For that I chipped a hole in the cement in my back yard and hammered it into the ground just outside the radio shack’s window. I then attached a ground clamp to it and ran some solid bare copper wire (4 AWG) to the window on the second floor.

Ground Rod Groudn Rod Wide Angle

For now I have the coax and grounding cable coming directly through an open window. But I have a window panel to be installed to fix that. The ground cable must be connected with the house’s electrical ground or else dangerous ground loops can occur; this connection was made in the shack and an additional connection will be added in the basement to ensure it is up to electrical code. Inside the shack at the window I installed an automatic remote tuner. The ground wire connects to the Tuner as well as running to a junction box which connects together all the radio equipment in the shack.

Remote Tuner

Ground Junction

It is important you use a grounding junction such as the one above rather than daisy chaining your ground together between devices. This ensures that even if one connection becomes loose all the others still maintain their connection to ground.

By having additional paths to ground it reduces the impedance as well as resistance for the path from the radio and antenna to the ground rod. This can and has had a noticeable effect on reducing unwanted effects and RF Interference.

And finally a picture of the entire shack just for completeness.

HAM Radio Shack