None Reading_11

Challenge

In this reading, our challenge is to understand the basics of energy storage and energy transfer as heat in electrical circuits. Understanding electrical circuits is important for anyone interested in environment and energy, those interested in robotics, and even those interested in bio-engineering. Some context for why electrical energy storage and transfer is important for providing all of us with renewable energy is shown in the video below.

While you may have a goal to eventually work on sustainable energy grids like the ones mentioned in the video above, we will start small. To begin studying electrical systems, we will look at the circuit below, which includes a power supply capable of providing constant voltage, a capacitor, a resistor, and a small LED light.

As shown in the video, pressing the yellow button "charges" the circuit, and then pressing the blue button allows energy stored in the capacitor to flow through the second resistor and the LED light. Without the capacitor in the circuit, the system seems to store no energy, and can only light the LED when the power supply is connected by pressing both the yellow and the blue button at once. A schematic circuit diagram of the system above is shown below. Schematic diagrams indicate what components in a circuit are connected electrically using simplified symbols for each component. They usually do not show how the elements are physically laid out. Note the differences between the circuit in the video and the diagram below. In this way, electrical schematics are partially useful for scoping an electrical system.

image-2.png

Eventually, we'd like to understand this whole circuit, because it is a decent candidate for analogy to a small electrical grid. The voltage source, $V_{in}$, could be a decent model of an intermittent electrical generation source such as wind or solar, active whenever the yellow button is pressed. The blue button could represent energy use by consumers, and whenever it is pressed, houses "load" the electrical grid as lights are turned on or appliances are used. However, to start with, let's look only at the left half of the circuit so that we might understand how electricity is stored in the capacitor. For reference, we'll be using the following, simplified version of the diagram below:

image-2.png

As we have done before, we will analyze the system by first scoping it according to our system's physical boundaries, its energy inputs (sources), its energy outputs (sinks), and its stored energy. We will consider the "generation source," $V_{in}$, to be our system's energy input, and the voltage that is available on the grid will be our model's dependent variable. An energetic scoping diagram representing the system as a whole is shown below. We won't cross much out just yet, because we will need to understand how electrical energy storage, work, and heat generation occur in our system. We'll do this by studying each component of the grid individually.

image-3.png

To proceed with modeling, it seems that we have to get some idea of how each of the two elements in this system scope, the resistor and the capacitor, will act to store energy, transfer energy to the environment as heat, and do work on one another and/or the environment. In order to begin this process, it is necessary to understand what we mean by work and energy in the context of electrical systems.

Electrical Work

$$\require{cancel}$$

Electrical work is done by moving charged particles. Electrical work is mechanical work, so its definition is fundamentally the same as the definition for work used in a mechanical system: $$W = \int \vec{F}\cdot d\vec{s}$$

Charged particles can be moved by an electric field that exerts force on those particles. While it is possible to compute work exerted on individual particles due to an electric field, the turn of the 19th century saw the first definitions of a quantity that we now call "Voltage." Today, we recognize a Voltage, or "electric potential," as something that is capable of doing work on a particular quantity of charged particles. Our definition of work, which is consistent with a few others that can be derived, is:

$$V = \frac{W}{Q_e}$$

Where $Q_e$ is electric charge (not to be confused with a quantity of heat $Q$.)

In SI units, multiplying a 1 Volt by 1 Coulomb of charge yields 1 Joule of work done.

This definition was inspired by early work with electrochemical sources of energy, which evolved into the modern battery. Batteries store chemical energy, and when a path for electrical charge exists between a battery's positive and negative terminals, this energy is transferred to whatever system the battery is intended to do work on. Batteries generally have a relatively constant voltage while their level of stored charge is near its maximum, as long as the power requiremments of the system are low.

Electrical Power

As with power in fluid and mechanical systems, electrical power is the time derivative of energy transfer. Given a particular voltage (not to be confused with volume) between two points in an electrical system, this time derivative can be computed for electrical work as:

$$\dot{W} = V \frac{dQ_e}{dt}$$

The time derivative of charge moving through an electrical system or element has a special name: Current, which we denote with a lowercase $i$.

$$\frac{dQ_e}{dt} = i$$

In SI units, current has units of Amperes, or $A$. 1 Ampere is, by definition, equivalent to 1 Coulomb per second of charge. This allows us to write electrical power as:

$$\dot{W} = Vi$$

First Law analysis of a Capacitor

Capacitors are electrical components specifically designed to store electrical potential energy by storing charge. A video explaining their operation is shown below:

As usual, to analyze a capacitor, we will write the first law of thermodynamics to understand how energy is stored and transferred.

image-4.png

Because capacitors were specifically designed to store energy without losses, it is common to assume that there is no heat transfer associated with energy storage and transfer in the capacitor. There is also not any significant (relative to the amount of energy it stores) mass flow into or out of the capacitor. This means that the first law of thermodynamics can be written:

$$ \dot{E} = \dot{W}_{in} - \dot{W}_{out} + \cancel{\dot{Q}}_{in} - \cancel{\dot{Q}_{out}}+ \cancel{\dot{E}}_{m,in} - \cancel{\dot{E}_{m,out}}$$

We also know that $\dot{W}$ for an electrical system is equal to $Vi$. Like a tank of water, the capacitor can only be either "filling" or "emptying," so there can only be one net current through terminals 1 and 2 in the figure above. However, like a tank of water, there might be different voltages (like pressures) at each end. For a tank of water, we always talk about gauge pressure which is the pressure at the bottom of the tank (terminal 1 of the tank) relative to the atmosphere (terminal 2 of the tank). We can thus write that the net power on the capacitor is:

$$\dot{E} = \dot{W}_{in} - \dot{W}_{out} = V_1 i - V_2 i = V_{12}i$$

The notation $V_{12} = V_{1}-V_{2}$ is common shorthand in electrical circuit analysis, and represents the "voltage drop" (like a relative pressure drop) from one end of a capacitor to the other.

But we still don't have an equation for how the capacitor stores energy. As it turns out, we can calculate this based on the capcacitance value of the capacitor, which is listed on capacitors that are commercially available. Capacitance, which has units of Farads (F) or Coulombs/Volt in SI units, is defined as: $$C = \frac{Q_e}{V_{12}}$$

Then, because of our assumptions re: the first law, we can actually calculate the energy stored in the capacitor by using the definition of electrical work. The amount of energy stored in the capacitor should, by the first law, be equivalent to the amount of net work done on it.

$$E_{stored} = W_{net} = \int_0^{Q_e} V_{12} dq_e = \int_0^{Q_e} \frac{q_e}{C} dq_e = \frac{Q_e^2}{2C} = \frac{1}{2} V_{12}Q_e = \frac{1}{2}CV_{12}^2$$

The traditional form in which to write this equation is that last one, where the energy stored in the capacitor is:

$$E = \frac{1}{2} CV_{12}^2$$

Remember that $V_{12}$ in this equation means the voltage across the capacitor, which is actually the difference in voltage (pressure) between terminals 1 and 2.

With this knowledge, we can actually re-write our first law equation for the capacitor as:

$$\dot{E} = CV_{12}\dot{V}_{12} = V_1 i - V_2 i = V_{12} i$$

With this expression for the first law of thermodynamics applied to a capacitor, which makes assumptions that the capacitor transfers no energy to the environment as heat, we can use the capacitor in a larger system model.

Similarity between capacitors and water tanks

Take a moment to note the similarity between the energy storage equation for a capacitor and the equation we derived for a tank:

$$\dot{E} = \rho g h A \dot{h} = P_t \dot{\mathcal{V}}$$

The pressures in the tank equation are like the voltages in the capacitor, while volumetric flow rate into the tank is analagous to current into the capacitor.

Note that we could write $\dot{P}_{t} = \rho g \dot{h}$, which changes the first law equation to:

$$\dot{E} = h A \dot{P}_t = P_t \dot{\mathcal{V}}$$

In fact, many engineers define that "capacitance" of a water tank as:

$$C_{tank} = \frac{A}{\rho g} = \frac{A h}{\rho g h} = \frac{\mathcal{V}}{P}$$

Compare this with the definition of capacitance in a capacitor, which is $C = \frac{Q_e}{V}$. Again, see the similarities between pressure and voltage (and charge and volume) here.

With this substitution, we can rearrange the first law of thermodynamics for the tank as:

$$\dot{E} = C \dot{P}_t P_t = P_t \dot{\mathcal{V}}$$

First Law analysis of a Resistor

Resistance is a property that all electrical conductors have. An electrical element that has "resistance" requires work to move charge through it... if all conductors did not have resistance, it would be possible to move charge "for free," which we know violates the first law of thermodynamics!! Therefore, it is important to remember that the assumptions leading to the equations for an idealized capacitor above are just that... assumptions! Most wires and other electrical conductors have very small resistances.... so small that we often say that they are negligible.

Ohm's Law

The concept of "resistance" comes from early experiments by Georg Ohm in 1827. Ohm found that, when testing various conductive materials, the current through the material was proportional to the voltage drop across the material (the difference in voltage between two points). Like the empirical relationships we found for idealized viscous damping and fluid resistance, you could imagine that Ohm's experiments produced a plot that looks something like this:

image.png

Today, we write Ohm's law as:

$$V_1 - V_2 = V_{12}= iR$$

Where $V_1$ and $V_2$ are the voltages at each "end" of a conductor. The slope of the plot, $R$, is the resistance of the conductor in Ohms ($\Omega$) for SI units. The notation $V_1 - V_2 = V_{12}$ is often used to denote the "voltage drop" from one end of the resistor to the other. If we think about voltage like pressure, and current like fluid flow rate, it helps us intuit that the "downstream pressure" will be lower.

Although all conductive materials can be assigned a value for resistance, many times it is necessary to limit the amount of current that passes through an electrical circuit. There is a special electrical component that is designed to do just that, and it's called a resistor. A typical resistor is shown below, although they come in many different shapes and sizes:

image.png

The schematic symbol for a resistor, with voltages and currents labeled, is shown below:

image-2.png

If, in the diagram above, $V_1>V_2$, current will flow in the direction shown. Again, thinking about voltage the way you think about pressure in a fluid system is helpful here. Looking at an energetic diagram for a resistor, we can begin to understand what its first law of thermodynamics equation might be.

image-3.png

Writing the first law for a resistor, once again assuming that no significant mass flows into or out of the resistor, yields:

$$\dot{E} = \dot{W}_{in} - \dot{W}_{out} + \dot{Q}_{in} - \dot{Q}_{out}+ + \cancel{\dot{E}}_{m,in} - \cancel{\dot{E}_{m,out}}$$

A resistor that one buys commercially is specifically designed not to store any energy! Many other materials that conduct some electricity also will not store energy, and can be modeled as if they do not. If an element has qualities of an "idealized" resistor, but also stores or converts energy, it is often modeled as two components-- one that is an ideal resistor, and one that is an ideal energy storage or conversion device.

Because commercial resistors and many other electrical devices do not store significant energy, we can model many of them as idealized resistors. For an idealized resistor, we can say that:

$$\dot{E} = 0$$

This allows us to write the first law as:

$$\dot{W}_{net} = - \dot{Q}_{net}$$

Ias we did for idealized dampers and fluid resistors. Substituting Ohm's law into the equation, we can find that the power transferred to heat by the resistor is:

$$\dot{W}_{net} = -\dot{Q}_{net} = i^2 R = \frac{(V_1 - V_2)^2}{R} = \frac{V_{12}^2}{R}$$

All of the forms above are equivalent, due to Ohm's law. The power transferred by the resistor as heat to the environment can be written either in terms of voltage or in terms of pressure.

Challenge in practice: Modeling a charging capacitor

System Scoping

We are looking for a system with the power supply's voltage as an independent variable (known source of power into the system boundary) and the capacitor's voltage as our dependent variable, since the capacitor's voltage can be used directly to calculate how much energy it stores. The system-level energetic diagram was provided above as a scoping step. We know that there is no significant heat flow into or change of mass within the system boundaries, so $\dot{E}_m$ terms and $\dot{Q}_{in}$ can be crossed out as insignificant at the system level.

Model Construction

Having performed steps 1 and 2 in our disciplined process in the sections above as we performed first law analyses on the resistor and capacitor, we now turn our attention back to the whole charging system to work step 3. If we look at the two first law equations, modifying subscripts slightly (for example, so that $V_{1,c}$ would represent $V_1$ for the capacitor), we now have:

Capacitor $$\dot{E} = C(V_{1,c} - V_{2,c})(\dot{V}_{1,c} - \dot{V}_{2,c}) = V_{1,c} i - V_{2,c} i $$

Resistor $$\dot{W}_{in} - \dot{W}_{out} = \dot{W}_{net} = -\dot{Q}_{net} = i^2 R = \frac{(V_{1,r} - V_{2,r})^2}{R}$$

We are equipped to look at how power is transferred into and between each element. We can represent the flow of power using the following energetic diagram.

image-4.png

As we can see, all of the work done on the capacitor must come from the resistor-- there is no other source of current into the capacitor, and no other element between the resistor and the capacitor that has the potential to transfer any energy to the environment as heat (the wires, we will assume, have negligible resistance). We also see from the circuit diagram (and this could be verified with a voltmeter) that: $$V_{2,c}=0$$

We can also surmise that because no (negligible) power is transferred as heat by the wire connecting the resistor to the capacitor, all of the work that comes out of the resistor goes into the capacitor.

Because current is the time-derivative of charge, and charge is carried by individual charged particles that are neither created nor destroyed (think conservation of mass), we find that there is only one current in our system-- the current that is pushed through the resistor into the capacitor by the power supply. This tells us that in our above energetic diagram for the system, that:

$$i = i_r = i_c$$

Because we already made the argument that all of the work done by the resisor on the capacitor is conserved... in other words, that $\dot{W}_{out,r} = \dot{W}_{in,C}$, we can also say that because the currents through the two elements are the same that:

$$V_{2,r}=V_{1,c}$$

This allows us to re-write our components' first law equations only in terms of our known input voltage from the power supply, $V_{in}$, our independent variables $R,C$, and our dependent variable $V_{1,c}$.

Capacitor $$\dot{E_{c}} = C(V_{1,c} - \cancel{V_{2,c}})(\dot{V}_{1,c} - \cancel{\dot{V}_{2,c}})) = V_{1,c} i - \cancel{V_{2,c} i} = \dot{W}_{out,r} $$

Resistor $$V_{in}i - \dot{W}_{out,r} = \dot{Q}_{out,r} = i_r^2 R = \frac{(V_{1,r} - V_{2,r})^2}{R}$$

Solving the two equations for $\dot{W}_{out,r}$, setting them equal, and solving the result for $\dot{V}_{1,c}$ yields:

$$\dot{V}_{1,c} = \frac{1}{RC} ( V_{in} - V_{1,c})$$

Model Evaluation

Having collected data for a $100\mu F$ capacitor and a $5K\Omega$ resistor as they were charged by a $5V$ power supply, we can evaluate our model's effectiveness by comparing a simulation to data.

In [4]:
% load data
data = load('capchargedata.txt');
td = data(:,1);
Vd = data(:,2);

%set up simulation time
dt = 0.01;
simtime = 3.5;
t = 0:dt:simtime;

%set up model parameters
R = 5000; %ohms
C = 100e-6; %100 microfarad
Vin = 5; %volts, input
%initialize voltage for cap
V1c = zeros(size(t));%capacitor voltage... starts at 0!

%simulate using Euler
for k = 2:length(t)
    V1cdot = 1/(R*C)*(Vin-V1c(k-1));
    V1c(k) = V1c(k-1)+dt*V1cdot;
end
%compare data and simulation
figure
plot(td,Vd,'r',t,V1c,'k')
xlabel('Time (s)')
ylabel('Cap Voltage (V)')
legend('Data','Model')

As you can see, our model does a very good job! In subsequent notebooks, we will be able to study the behavior of the whole system inclusive of the second resistor and light, which would have to "share" the output power from the resistor.

Analogies between Fluid, Electrical, and Mechanical Systems

Having gone through the model building process above, you may notice that the result looks familiar! The assumptions we made about energy transfer and storage for each component in our electrical system that mirror assumptions we made about mechanical and fluid components in earlier readings! As it turns out, the types of assumptions we've been making are common in what is called "lumped parameter modeling," where we make assumptions that lead to a particular element only "doing one job," either storing energy (in one form) or dissipating energy without storage. A summary of the elements we've studied and their first law assumptions is given below.

First Law Assumptions for Common System Elements

We often make similar assumptions about elements in physical systems. Below you'll find a chart that summarizes these assumptions for the elements we've considered so far in ES103. Note that these assumptions should still be justified in your work for your particular system and/or element.

image-3.png

In [ ]: