None ES103_Summary_Resource

Table of Contents

Definitions

What is a Model?

A model, or more precisely, an engineering model, is a representation of something we want to understand. The word representation here means that while a model represents something real, and can even predict the behavior of that real thing quite accurately, it is not the same as the real thing. A model airplaine is a good example of a physical model of what we would call a "true" airplane that carries people and cargo over long distances. While it shares some features of the real airplane, it is different in some fundamental ways, such as its power source, size, and flight time. It cannot do everything that a real airplane can do... but it does enough things similarly enough that we might better understand how real airplanes work and/or how they should be built by building a model.

An engineering model can be physical, like a model airplane, or it may not be. What makes a model an engineering model is its utility for designing and/or understanding the thing it is supposed to represent.

The engineering models we will be building in this class will rarely (if ever) be physical models. They will mostly be comprised of mathematical equations that help us predict the behavior of physical things or processes that we wish to build or understand. The mathematical equations representing the thing or process we wish to understand will, if we do our jobs correctly, allow us to predict what will happen when something changes.

This ability to "predict" using a model is fundamental to engineering. If engineers needed to simply change design elements randomly, building full-sized airplanes over and over until one worked "just right," engineering as a discipline would be incredibly dangerous, expensive, and inefficient. Using mathematical equations to tell us what will happen when we build a design or implement a policy can allow us to avoid many costly and dangerous mistakes that would result from a "trial and error" approach.

What is a System?

A system refers to any collection of items, pieces, or subprocesses that we call elements. These elements interact to produce a behavior we are interested in understanding and/or predicting. A system is generally described as an "isolated slice" of the universe. Anything inside that "slice" is part of the system. Anything outside of that "slice" is called the system's "environment," or its surroundings.

This means that while a system may exchange energy, material, and/or information with things that are outside of its boundaries, changes in the system's behavior are generally driven by its environment, rather than the other way around.

Elements are the "atomic units" of a system. They can be either processes, physical objects, or collections of physical objects. Their relevant behavior can be represented completely by an equation or set of equations describing how they interact with either other elements in the system or with the system's surroundings.

Elements could, in theory, be modeled as "systems" themselves, with their own sets of interacting elements. However, when we declare that something is to be considered an "element" in a system, it means that we are not interested in unpacking its behavior or construction any further.

For example, a bus could be considered an "element" in a transportation system. The bus itself could be modeled as a system comprised of elements like wheels, springs, an engine, and so on. However, when we say that the bus is an element in our transportation system, it means that we are considering the bus to be an irredicible building block in our definition of the transportation system. Perhaps this bus's behavior of interest could be modeled using only an equation relating the time of day and a "traffic congestion factor" to its position along a route.

It's true that this is a bold simplification of a bus's behavior. By making the declaration that this bus's position is the only thing we care about, and that this position can be known using only two independent variables, we are assuming a lot. We are ignoring a lot. What if the bus breaks down? Why don't we care about how it bounces over potholes, or how much fuel it uses?

Well, we can't model everything. When we decide to consider building a model of the "transportation system," we must immediately begin simplifying reality. We have to decide where the system (as we define it) begins and ends, and what level of complexity is required to know what we need to know about the system.

This leads us to a pair of fundamental truths about engineering models:

  1. All models are wrong because they do not include every nuance of every phenomenon that may impact a system's behavior
  2. Good models a useful because they sufficiently predict the system's behavior. They are still "wrong" in the sense that there are phenomena they will either ignore or predict inaccurately, but they are "accurate enough."

Building good models is the goal, and in ES103, we will use a simple three-step process to build a model.

What is a DYNAMIC System?

A "Dynamic System" is any system whose behavior varies significantly with time when one of its inputs or operating conditions changes. A bridge may be a system of composed of beams that interact with one another, but if we look on a short enough time scale (years rather than decades, perhaps), the bridge's behavior may or may not vary interestingly in time, even if its elements all play interacting roles to support the weight of passing traffic. At Lafayette, ES230 (Statics) considers "trusses" (like bridges) that fall into this category.

However, it is only our model of a bridge that may not display time-varying behavior. Real bridges do have behavior that varies in time; it's just that as engineers, our model scope may not always include time-varying behavior. For an example of an incorrectly scoped model of a bridge, you could read about what happened to the Tacoma Narrows Bridge), which collapsed due to vibration (time-varying behavior) that it was not designed to withstand, since the engineers' model scope did not consider that type of behavior.

In ES103, we will be almost exclusively considering models of dynamic systems, meaning that we are interested in how the system's behavior evolves over time. Dynamic Systems display many types of behavior when subjected to a sudden change in input conditions, but many will show behavior in their outputs (quantities of interest) that can be roughly grouped into one of the following categories:

image-2.png The categories of system behavior above are basic-- some complex systems exhibit combinations of these "prototypical" responses. Still, categorizing system behavior this way, and grouping systems into "families" that exhibit responses such as linear growth, exponential growth, exponential decay and/or approach, overshoot and oscillation, is often useful because it helps us develop expectations for and interpretations of a system's behavior when we observe it.

Disciplined Process

Disciplined Process for Model Building

In ES103, we will follow the following general procedure for building models of systems. Each of the steps in the diagram below is explained in more detail in the following sections.

image.png

At the beginning of the course, we will take a broad view of each of these steps. As we need more detail, we will develop more detail. However, the course is designed to get you using the whole process right away! For now, we will move through these steps in chronological order.

System Scoping

Model Scoping

When we attempt to model a phenomenon or series of interconnected phenomena as a "system," we are looking for a collection of elements that interact with each other and the system's surroundings to produce the behavior we are interested in understanding. Defining the boundary that indicates what is "inside" the system and what is not is what we will call model scoping. The process of "scoping" a system model involves drawing the system boundary, and answering the following three questions:

  1. What quantities (energy, material, information) go in to the system boundary that are relevant to the behavior we're interested in?
  2. What quantities (energy, material, information) go out of the system boundary that are relevant to the behavior we're interested in?
  3. What quantities (energy, material, information) are stored within the system boundary?

Energetic Diagrams

In ES103, an energetic diagram will be defined as a diagram that explicitly shows how we will model energy that is exchanged between the system (or a subsystem or an element) and its environment. "How we will model" is important here. In drawing certain arrows that represent energy transfer, we will often make assumptions about how this energy is transferred and with what. Because these will often be simplifications, it is important to keep in mind that the energetic diagram we end up with is not "truth" by default. It is a model.

Arrows pointing in to the system should reflect outside influence from the system's surroundings that would increase its energy in the absence of other factors. These influences could be in the form of either heat, energy associated with mass transfer, or work as a function of time. Arrows pointing out of the system should reflect work, energy associated with mass transfer, or heat that a system transfers to its environment. In the absence of other factors, an outward-pointing arrow would decrease the amount of energy stored within a system (internal energy, such as kinetic, potential, thermal, chemical, etc). Note that we draw the $\dot{E}_m$ terms with their arrows physically crossing the system boundary. This is to show explicitly that these arrows represent material going through our system boundary.

If we draw the energetic diagram to represent the first law's time derivative, arrows represent a flow of power between a system and its surroundings, which can either be a known subsystem that is also being modeled, or a system's unmodeled, external surroundings ('the universe,' for instance). An example for an arbitrary system is shown below:

image-5.png

Independent Energy Storage Elements and System Order

In a lumped-element model of an engineering system (such as those we have been building, where each element in the system scope either stores or dissipates energy), the number of significant, independent energy storage elements is equal to the number of derivatives required to model the system. The number of derivatives needed to represent a system's behavior is often called the system's "order."

For example, a single differential equation representing a model of a system that has 3 significant, independent energy storing elements would need to have a triple derivative of the dependent variable, a double derivative of the dependent variable, and a single derivative of the dependent variable in the equation in order to fully describe the system behavior. This is because each derivative is a representation of how the energy in the total system (consisting of 3 energy storage elements) can change. A single differential equation representing a system's dynamic behavior is often called an input-output model, because the single differential equation represents a relationship between the system's input (source of power from outside of the system scope) and its output (our dependent variable).

Representing your model as a single differential equation is not the only option. If your model is represented not as a single input-output differential equation but as a list of coupled first-order differential equations in State Space Form, the number of coupled, first-order differential equations you need to represent the model is equal to the number of independent energy storing elements in your scope.

Dependence and Independence of Energy Storage Elements

Two energy storing elements in a system model are independent of one another if the energy stored in one element cannot be directly written simply as a scaled version of the energy in another.

Two or more elements are dependent when Their energy storage equations can be directly related by a constant scale factor.

This often occurs if the two elements are directly in series (where the T-type variable is common between them but the A-type drop across each is different) or directly in parallel (where the A-type drop between them is common but the T-type variable in each is different) in an equivalent circuit representation, and in some cases when two energy storing elements are connected by a transducer with no dissipative elements in between them.

Model Construction

Model Construction

Model Construction is the process of building the equation(s) that represent the behavior of the system we defined in the "Model Scoping" step.

Model Construction varies a lot by sub-discipline in engineering, but it can be reduced to the following general procedure:

  1. Define the model's independent variables. These are quantities that are known before the model's equations are evaluated. They may be physical parameters like mass, they may be parameters that characterize a process, such as death rate. They may be quantities that vary in a known way, such as time or a spatial coordinate. A model's independent variables are often called "inputs" if they are quantities that may vary with space or time, and often called parameters if they are unchanging.
  2. Define the model's dependent variables. These are quantities that result from the interactions between system elements and either one another or the system's surroundings. The dependent variables nearly always describe the phenomena your system is supposed to predict. A model's dependent variables are often called "outputs."
  3. Use a disciplined process to relate the model's independent variables to its dependent variables.

Step 3 is probably the most complex of the three, and it is the one that can differ wildly from discipline to discipline. For example, the way an environmental engineer goes from a list of model inputs and outputs to a final equation will be quite different from the way a mechanical engineer might accomplish the same goal.

The processes used to actually relate a model's inputs to its outputs might be the use of an empirical relationship, or perhaps Newton's laws, or perhaps the conservation of energy. We will focus on only a small subset of the methods for model construction in this course, but for us, step 3 involves rigorously defining our system's elements, how each behaves, and how each interacts with the others.

It is in this step that you will need to decide what level of detail you will use to represent each of the elements in your system scope. Simple is often a good place to start! If, when you evaluate your model, you find its accuracy lacking, you may consider increasing the level of detail with which you represent each element, or whether the system scope you chose was appropriate.

Model Construction: Kinematics for translational motion

Kinematics refers to the study of motion. When we talk about translational motion, which means the motion of an object that is not rotating, we usually talk about an object's position, velocity, and acceleration. These quantities are related to one another! We often say that an object's velocity is how far it goes in a certain amount of time. Formally, an object's velocity is the instantaneous change in its position with respect to time. This is also referred to as the derivative of position with respect to time, and is written as follows:

$$\vec{v} = \frac{d}{dt} \vec{x}$$

We will save the formal definition of a derivative for later when the formality is warranted. What we need first is simply an intuitive understanding of the derivative. If you do not already have an intuitive understanding of derivatives (perhaps you have not yet had calculus!), just think of a derivative of $x$ with respect to time as an equation (or a second plot) representing the slope of the $x$ vs. $t$ plot. See the plot of position and velocity vs. time below.

image-2.png

notice that at $t_0$, $x$ is increasing from $x=0$. That means its velocity at time $t_0$ is positive. Notice that at $t_1$, even though position is some positive number, at that instant $x$ is not changing, so the plot of $v$ at $t_1$ shows that velocity there is 0. Similarly, at $t_2$, the object is back at a position of $x=0$, but it is decreasing rapidly, so its velocity is negative.

In a similar fashion, we can say that an object is accelerating if its velocity is changing. Therefore, we can also write acceleration's relationship to position as a derivative:

$$\vec{a} = \frac{d}{dt} \vec{v}$$

Once again, the derivative of velocity with respect to time represents the slope of the velocity vs. time plot at any particular time. Asking "what is my acceleration right now?" is the same as asking "at this very instant, how is my velocity changing?

Model Construction: Basics of 2-D Vectors in Cartesian Coordinates

In engineering, we represent any quantity that has both a size and a direction as a vector. Consider a boat traveling across the ocean from New York to London. If we represent East as the X direction, North as the Y direction, and look down on the boat from the sky, we might represent (or model) the boat's travel using the following picture.

image-2.png

The boat's speed relative to the water due to its engine is given by the scalar quantity $v_b$, which does not specify its direction but only how fast the boat is going. We write $\vec{v}_b$ to indicate the boat's velocity as a vector quantity that has a particular direction. The boat is also moved relative to a fixed location on earth by currents in the water. The contribution of those currents to the boat's overall velocity can be written as $\vec{v}_w$. So what is the boat's total velocity? It is: $$\vec{v}_t = \vec{v}_b + \vec{v}_w$$

But if you can imagine this scenario in your head, you probably can intuit that this is not the same as writing the scalar equation: $$v_t = v_b + v_w$$

Because the water's velocity and the boat's velocity relative to that water are in different directions, so the boat's actual direction of motion will be somewhere in between the direction of $v_w$ and the direction of $v_b$. So how do we add vectors? By definition, vectors can be added using the paralellogram law, which is shown graphically below.

image-2.png

While this allows us to draw $\vec{v}_t$ graphically, it does little do help us mathematically. If we needed to construct a model to tell us how the boat's X position would vary over time, we would need to know how the red velocity vector $\vec{v}_b$ relates to the boat's overall velocity in the X direction.

Thankfully, one of the fundamental consequences of paralellogram addition is that it allows us to break any vector up into components, or pieces, that are parallel to the axes we are interested in. In this case, that would be East (X) and North (Y). Let's try this for the velocity vector of the boat relative to the water, $\vec{v_b}$.

image.png

As the picture shows, we can imagine that the vector $\vec{v}_b$ is made up of two smaller vectors that are conveniently aligned with our X and Y axes. If we knew the magnitude $v_b$, we would then be able to see what the magnitudes of $\vec{v}_{bx}$ and $\vec{v}_{by}$ were by using the right triangle formed by aligning the component vectors "tip to tip" so that they end up at the arrow head of the total velocity of the boat relative to the water, $\vec{v}_b$. Using the mnemonic "SOH-CAH-TOA," reproduced to the right of our vector figure, we find that:

$$v_{bx} = v_b \cos \theta_{vb}$$$$v_{by} = v_b \sin \theta_{vb}$$

The pythagorean theorem combined with a quick trigonometric identity shows handily that the magnitude of $\vec{v}_b$, which we write as $v_b$, can be found as:

$$v_b = \sqrt{v_{bx}^2+v_{by}^2}$$

We can also write $\vec{v}_b$ in terms of these components when we consider that the "arrows" representing the size of the components can be expressed as vectors themselves:

$$\vec{v}_b = v_{bx}\hat{\imath} + v_{by} \hat{\jmath}$$

Where $\hat{\imath}$ is a "unit vector" of length 1 in the X-direction, which is scaled by $v_{bx}$, and $\hat{\jmath}$ is a "unit vector" of length 1 in the Y-direction, which is scaled by $v_{by}$. Generally speaking, the "hat" on top of a letter designates it as a unit vector (a vector with length 1).

Resolving all vectors of interest in our problem into components for a common set of axes in the fashion described above allows us to use scalar, rather than vector addition to find out what the components of $\vec{v}_t$ in the X and Y directions are. Once we have them, we could use them in a model to predict the boat's Northing and Easting position as functions of time. In this example, the total velocity for the boat, $\vec{v}_t$, can be written as follows:

$$ \vec{v}_t = v_{tx} \hat{\imath} + v_{ty} \hat{\jmath} $$

And each component can be found by summing the components of $\vec{v}_{b}$ and $\vec{v}_w$ in the X and Y directions:

$$v_{tx} = v_{bx} + v_{wx}$$$$v_{ty} = v_{by} + v_{wy}$$

Model Construction: Newton's Laws

One of the ways you are probably already familiar with building models for physical phenomena, perhaps from high school, is using Newton's Laws. We will actually use them extensively in this course as well! Newton's laws, applied to rectilinear motion and linear momentum are paraphrased below:

Newton's First Law

If a frame of reference is inertial, an object will either remain at rest or move at constant velocity unless it is subjected to a nonzero net force. This can be written as "A net zero force implies no acceleration," which is represented by the equation:

$$ \Sigma \vec{F} = 0 \rightarrow \frac{d}{dt} \vec{v} = \vec{a} = 0$$

Notice that Force $\vec{F}$ is a vector quantity, meaning that it has both a magnitude and a direction, just like velocity and acceleration do.

Newton's Second Law

The change in momentum of an object is directly proportional to the force applied. Changes in momentum occur in the direction of the net applied force. This can be written as the equation:

$$\Sigma \vec{F} = \frac{d}{dt} (m\vec{v})$$

If an object's mass is constant, the term $m$ can be pulled out of the derivative on the right-hand side, and the second law takes its more familiar form:

$$\Sigma \vec{F} = m\vec{a}$$

Newton's Third Law

Forces between objects are equal in magnitude, but opposite in direction. This is one of the most helpful things to remember when constructing free body diagrams of objects that you wish to apply the second law to. If body A exerts a force $\vec{F}_{AB}$ on body B, then this is equal and opposite to the force $\vec{F}_{BA}$ that body B exerts on body A. Thus, we can write:

$$\vec{F}_{AB} = - \vec{F}_{BA}$$

Model Construction: Free Body Diagrams (FBDs)

Using Newton's Laws for model construction often means determining the motion of an object when it is subjected to forces from the outside world, or in some cases, forces exerted on one element of a system by another. This can get complex very quickly, but the "Free Body Diagram" can help. A Free Body Diagram, or FBD, is a diagram in which one physical body is presented on its own, and all forces applied to the object are drawn on top of it as vectors.

image-2.png

Model Construction: Constructing a model for translational motion using an FBD

Newton's Second Law tells us that the net applied force on an object is what causes it to accelerate. Acceleration causes velocity to change, and velocity causes position to change. The FBD is what tells us what the net force on an object actually is, and to calculate it, we use the diagram to add up the vectors representing all forces applied to the object. This allows for a specific sum of forces to fill in the left-hand side of the Newton's second law equation:

$$\Sigma \vec{F} = m \vec{a}$$

Calculating position and velocity under constant acceleration

Because of the relationships between position, velocity, and acceleration:

$$\vec{a} = \frac{d}{dt} \vec{v}$$$$\vec{v} = \frac{d}{dt} \vec{x}$$

We can derive a special set of equations that can be used to calculate an object's position and velocity in situations where acceleration is constant in both magnitude and direction. These equations are based on the rules of integration. We will be more formal and deliberate with the concept of integration in a future discussion, but for now, think of an integral as an anti-derivative. In other words, if

$$\vec{a} = \frac{d}{dt} \vec{v}$$

Then, with the definition of the integral (which we denote by the symbol $\int$), we can say that: $$\vec{v} = \int \vec{a} dt$$ Likewise, if: $$\vec{v} = \frac{d}{dt} \vec{x}$$ Then, by the same definition, $$\vec{x} = \int \vec{v} dt$$

So computing the "double integral" of acceleration, $\int \int \vec{a} dt$, we can compute position. You may or may not remember how to do this from your calculus class, but we will leave the mechanics of the exercise out for now. Under constant acceleration in an $x$ direction that is part of an inertial frame of reference, we could, as a consequence of this double integral relationship, write:

$$v_x (t) = v_{x0} + a_x t$$$$x(t) = x_0 + v_{y0} t + \frac{1}{2} a_x t^2$$

Where the subscript "0" indicates the position or velocity of the object at time $t=0$. Using the same relationship and notation for the corresponding y-component of acceleration, we could write:

$$v_y (t) = v_{y0} + a_y t$$$$y(t) = y_0 + v_{y0} t + \frac{1}{2} a_y t^2$$

Torque or Moment

A torque (also called a 'moment') is applied to an object any time a force is applied at some distance from a reference point. An object to which an imbalanced torque is applied will tend to rotate.

If the distance from the reference point to the application point of the force is defined by a position vector $\vec{r}$, as shown below:

image.png

Then the magnitude of the torque applied with respect to the reference point is the product of the position vector's magnitude and the component of the force vector that is perpendicular to the position vector:

$$T = r\cdot F_\perp$$

Think about the picture above and imagine that you squeezed the object shown with your thumb and forefinger at the reference point. If the force $\vec{F}$ was pointed directly perpendicular to the position vector $\vec{r}$, it would be hard to keep the object from rotating... and harder yet if the position vector got larger! But if the force vector was pointed either directly towards or directly away from your grip, the object would not "want" to rotate at all! This is the intuitive definition of the mathematical equation above, relating $F_\perp$ and $r$.

The definition of the component $F_\perp$ depends on the specific geometry of a particular problem, but if the angle $\theta$ is defined as in the figure above, then we can compute that $F_\perp=F\sin\theta$, where $F$ is the magnitude of the force vector $\vec{F}$.

The direction of the torque is said to be perpendicular to the plane defined by the position and force vectors. Specifically, its direction can be surmised using the "right hand rule," in which one curls the fingers of the right hand from the position vector into the direction of the applied force. The direction of the torque is shown by the direction in which the thumb points. Note that this means that the applied torque will always point into or out of the page when considering planar motion.

image.png

If you've never heard of the right-hand rule, or you need a refresher, check out this video!

This rule for computing the magnitude and direction of a torque vector $\vec{T}$ is a description of what is called the vector cross product. In terms of the vector cross product, torque is written:

$$\vec{T} = \vec{r}\times \vec{F}$$

Many times, the method of computing the direction and magnitude of torque explained above, as the "distance times the perpendicular component of force," is the easiest way. However, in cases where oblique forces are applied at odd distances from a reference point, more formal methods for computing the cross product can be more useful. In ES103, we will stick with the simpler definition.

"Couples" or "Pure Torques (moments)"

We said that a force at some perpendicular distance from a reference point is said to produce a torque about that reference point. However, an object with a single resultant force applied to it at some offset from its center of gravity will tend to both translate and rotate. It is possible to have a situation in which a Pure Torque, also called a couple), is applied. A couple occurs when an object is subjected to two or more forces that sum to zero via Newton's second law, but together produce a net torque. An example is shown below, in which a cylindrical body is subjected to two forces tangent to the cylinder (and thus perpendicular to the radius $r$).

image.png

If the two forces $\vec{F}_1$ and $\vec{F}_2$ have a common magnitude $F$, we could see that their vector sum would be $0$, meaning that the cylinder will not have any translational acceleration. However, these two forces each produce a TORQUE of $F\cdot r$ that, according to the right-hand rule, will be facing into the page and are clockwise torques, meaning that the net torque applied to the cylinder will be $T = 2\cdot Fr$.

In situations like these, we will often just represent the cylinder as being exposed to a known Pure Torque, which is often shown using an arc-like symbol like the one in the figure below that indicates its direction. In planar problems, counter-clockwise torques are positive, and clockwise torques are negative. This is also due to the right-hand rule, which can be used to show us the directions of positive $x,y,z$ axes as shown below.

<a href=" ../Reading_07/Reading_07.html#"Couples"-or-"Pure-Torques-(moments)"" > Link to Original Context in: Reading_07</a>

image-2.png

Newton's Second Law applied to angular momentum for a rigid body rotating about its center of mass in a plane

Newton's second law, a statement about the conservation of momentum, applies to angular as well as linear momentum. For a rigid body moving in a plane, angular momentum is defined as:

$$\vec{H} = J \omega \hat{k}$$

Where $\omega$ is the magnitude of the rigid body's angular velocity (radians/second), and $J$ is the mass moment of inertia of the rigid body. Think of the mass moment of inertia like a "mass for rotation." The larger this number is, the harder it is to accelerate an object in rotation. Notice that the angular velocity $\omega$ points in the $\hat{k}$ direction for an object moving in a plane. This is because of the right-hand rule. When we curl our right-hand fingers in the direction of rotation, our thumb points in the direction of the rotation vector. Some more details about angular velocity can be found here if desired.

Mass moment of inertia is a scalar quantity that is related to how mass is distributed in an object. A list of mass moments of inertia is available here, and the formal definition is given as:

$$J = \int r^2dm$$

Where "dm" represents an infinitesimal piece of mass that makes up the rigid body. It is rare that one needs to calculate a mass moment of inertia using this formula-- tables of mass moments of inertia for most common shapes are widely available, and most modern computer-aided design software can compute mass moments of inertia for parts you design. However, looking at the equation is helpful for understanding what moment of inertia really is. Imagine an object with all of its mass concentrated at a point. We could calculate that mass's moment of inertia with respect to some arbitrary axis as $J = mr^2$. By contrast, a wheel or a cube would have a different moment of inertia, since the mass of those objects is distributed in space.

Angular velocity, which has units of $\frac{rad}{s}$ in the SI system, has a direction either into or out of the plane of motion, according to the right-hand rule. with a standard coordinate system defined on a page as $x$ right and $y$ up, counterclockwise rotation is positive (out of the page), and clockwise rotation is negative (into the page). Newton's second law deals with the derivative of momentum. For a rotational system in a non-accelerating (also called "Newtonian") reference frame, we can write:

$$\sum \vec{T} =\frac{d\vec{H}}{dt}$$

Where The angular momentum is computed about a rigid body's center of mass. If moments (torques) are to be summed about an arbitrary point, this formula does not, in general, apply. There are special exceptions to this rule, but we will not treat them here.

As with a translational system, if the rotational inertia of a rigid body is constant, the right-hand side of the above equation can be written as $\frac{d\vec{H}}{dt} = J \dot{\vec{\omega}}$. In making this simplification, and considering only motion in one plane, we can write Newton's second law for a rigid body rotating about its center of mass as:

$$\sum \vec{T} = J \vec{\dot{\omega}}$$

You will often see this equation written as a scalar equation for objects that rotate only in one plane (such as a wheel functioning normally. If you imagine a wheel flying off of a car, wobbling and bouncing down the road, you can see that it might have angular velocity about more than one axis of rotation). This scalar version of Newton's second law comes from the fact that if a body rotates only about one axis, its angular velocity (and thus, the torques that produce it) must all be going either into or out of the plane.

In summary, summing the torques about an object's center of mass to see how its rotational velocity changes over time is analagous to summing the forces applied to an object to see how its velocity will change over time.

Idealized Rotational and Translational Dampers: Force and Torque

Idealized rotational and translational dampers are fictitious single elements in a dynamic system that have insignificant translational and rotational inertia, but that produce a force or torque that resists motion proportionally to the velocity difference between each part of the damper. "True" idealized dampers do not exist, because nothing is massless, and almost nothing has a purely linear relationship between force and velocity (or torque and angular velocity). However, empirical observations have led scientists and engineers to model many "real" system elements as if they were idealized dampers.

For example, rotational bearings and lubricated sliding contacts are often modeled as idealized dampers, as are translational "shock absorbers" such as those found on a car's suspension. Dampers are often indicated on a drawing using a shorthand sketch of their free body diagrams.

image-2.png

Because idealized rotational and translational dampers do not have significant mass, the torque or force (respectively) on each end of the damper must be equal and opposite.

The magnitude of the torque on a rotational damper, as drawn above, is given by:

$$ T_b = b(\omega_1 - \omega_2)$$

Where $b$ is the damper's "damping coefficient." $\omega_1$ represents the angular velocity of one race of the damper, and $\omega_2$ represents the angular velocity of the other race. The damping coefficient $b$ is often experimentally determined, and its units are $\frac{N\cdot m \cdot s}{rad}$ in SI units so that multiplying the coefficient with an angular velocity in $\frac{rad}{s}$ yields a torque in $N\cdot m$. Note that using the right-hand rule, we can confirm that if $\omega_1$ is larger than $\omega_2$, the torque will point "outwards" from each end of the damper.

Similarly, for a translational damper (such as a shock absorber in a car), the equation for the force produced by the damper is given by:

$$ F_b = b(v_1-v_2)$$

The damping coefficient $b$ for a translational damper has units of $\frac{N\cdot s}{m}$ such that multiplying the coefficient by a velocity in $\frac{m}{s}$ produces a force in $N$.

Disciplined Process: relating rotational to translational motion under the assumption of roll without slip

When wheels roll without slip, we can use the arc length formula, which says that an arc length $s = r\theta$, where "r" is the radius of a circle and $\theta$ is the subtended angle, to help relate rotational and translational motion. This is helpful for analysis of belts, chains, pulleys, and wheels (when they are not skidding). To understand the arc-length formula, refer to the following figure, which shows string wrapped around a wheel unraveling as the wheel rolls along the ground.

image-2.png

In this image, we can see that the amount of string that has unrolled is equal to the distance $x_w$ that the wheel's center has translated. This amount of string, $s$, is the "arc length" along the circle's surface that is swept by the angle $\theta$ that the wheel rolls. The way we've defined our coordinate system $x$ and $y$, we can use the right-hand rule to determine that counterclockwise angles $\theta$ are positive, while clockwise angles are negative. Noting that the wheel must roll clockwise to produce a positive $x_w$, we can write the equation:

$$x_w = -r\theta$$

If the circle's radius is a constant, we can take the time derivative of this equation to see that we can relate the wheel's velocity $v_w$ to the wheel's angular velocity $\omega$:

$$v_w = -r\omega$$

And again to see that we can relate the wheel's acceleration $a_w$ to the wheel's angular acceleration $\dot{\omega}$:

$$a_w = -r\dot{\omega}$$

Disciplined Process: Using Newton's laws to obtain a mechanical system model

Step 3 of our disciplined process for Model Construction is to relate our model's independent and dependent variables. If we choose to use Newton's Laws to perform this step, we can create a differential equation to serve as a model for a system comprised of "idealized elements" such as masses and dampers by:

  1. Drawing the FBD for each individual element in the system, indicating whether it meets the requirements for an idealized damper or an idealized mass.
  2. Writing Newton's second law for each individual element in the system, using sums of forces ($\sum \vec{F} = m\vec{a}$) and/or torques ($\sum \vec{T} = J\vec{\dot{\omega}}$) as appropriate given the motion of your system. Be sure to apply Newton's 3rd law to link forces and torques between components (free bodies) in your system.
  3. Eliminate all motion and force terms other than terms multiplied by the system's dependent variables (and their derivatives, as appropriate) using algebraic manipulation. Solving an equation for an unwanted term and substituting into another equation is a good way to eliminate the unwanted term.
  4. Check to make sure that all terms multiplied by your model's dependent variables contain only known or measurable quantities (independent variables).
  5. Check the model for internal validity by confirming that the units of each term are correct, that the signs match your intuition, and that the equation has the correct overall form.

Empirical Models

A purely empirical model is one that is derived using data. The inner workings of the relationships between system inputs and outputs may be unknown, but using past knowledge of the behavior of a system (or sometimes, just one element in a system), the future of the same system or element can be predicted.

Empirical models are often used in the early stages of modeling, when the behavior of a system or element is mysterious. They can also be used in situations where it is unlikely that a principled physical model for a system or element's behavior will be accurate, or when it is practically impossible to obtain.

Empirical Models: Lookup Table

The simplest form of a "model" that is based on past experience is what we call a lookup table. This is no different than the original, collected data itself. The idea is that "if the system acted this way once, perhaps it will act similarly the next time we run the experiment." Let's look at an example in the MATLAB/Octave language. Say you had data for a model that related time $t$ to some output $y$. You collected data in a table that looks like the following:

$t$ $y$
0 10
0.5 10.09
1 10.264
1.5 10.442
2 10.594
2.5 10.713
3 10.801
3.5 10.864
4 10.908
4.5 10.939
5 10.96
5.5 10.973
6 10.983
6.5 10.989
7 10.993
7.5 10.995
8 10.997

You can plot the data in MATLAB quite easily, as shown in the cell below.

In [1]:
t = [0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6  6.5 7 7.5 8]'; %the ' at the end means 'transpose,' or turn rows into columns. Makes this a "tall" array.
y = [ 10 10.09 10.264 10.442 10.594 10.713 10.801 10.864 10.908 10.939 10.96 10.973 10.983 10.989 10.993 10.995 10.997]'; %see comment above.

plot(t,y,'kx-','linewidth',4)
xlabel('t')
ylabel('y')

Then, let's say I suspected that this behavior would be the same every time I collected similar data.

If these assumptions were correct, and I needed to answer the question:

If $y$ begins at 10.594 in a new experiment, what will the value of $y$ be three seconds later?

I could do this. If I look at either the table of data or the plot itself, I can see that in my original data, $y=10.594$ when $t=2.0$. To find out what $y$ would be three seconds later than that, I would simply need to look at my table to see what value $y$ takes at $t=5$ in my original table (three seconds later than $t=2$). If I looked in the table, I could plainly see that the answer I'm looking for is $y=10.96$!

This is the basic idea of a lookup table. These are actually used in practice in many branches of engineering, including thermodynamics and heat transfer. They're also used in your car, to tell the computer how much fuel is needed for a given combination of RPM and throttle position. They are helpful when a "closed form" mathematical equation is either practically impossible or too computationally intensive to obtain.

Linear Interpolation

interpolation is the process of inferring the value of a dependent variable (output) given a table of data consisting of independent and dependent variable pairs. Consider the following data set, in which pairs of time and y values were collected. We can infer what the value of would be in between two data points collected at times $t_4$ and $t_5$ by assuming that the value of $y$ varies linearly in between these two points. While this is probably not strictly true, it is often a good approximation if the time difference between $t_4$ and $t_5$ is small relative to how fast $y$ changes.

image-2.png

In the picture above, $t_q$ is a point in beytween $t_4$ and $t_5$ where we wish to approximate the corresponding value of the output $y$ by assuming that $y$ follows the shape of a line in between the two known data points $(t_4,y_4)$ and $(t_5,y_5)$.

Using the equation for a line in point-slope form where $(t_4,y_4)$ represents a known value of the dependent variable $y$ at a known value of the independent variable $t$, and $m$ represents the slope of the line, we can write the equation for the entire line (shown in red in the picture):

$$ y = m(t-t_4) + y_4$$

Where the slope $m$ is given by "rise over run" in the equation:

$$m = \frac{y_5-y_4}{t_5-t_4}$$

All together, this means that the value we wish to approximate can be found using:

$$ y(t_q) = \frac{y_5-y_4}{t_5-t_4}(t_q-t_4) + y_4 $$

This procedure can be implemented in code using MATLAB so that you can find the approximate value of $y$ for any time $t$ in between $t_0$ and $t_8$, as long as there is only ever one unique value of $y$ for each value of $t$. Formally, we say that this requirement means that the function $y(t)$ is single-valued.

In MATLAB/Octave, there is a function called "interp1" that does this procedure for you. To learn how to use it, type "help interp1" into a code cell in the Jupyter notebook or on a MATLAB command prompt.

Linear Extrapolation

Extrapolation is the act of estimating a variable's value beyond the variable's original observation range. The simplest way to do this is by assuming that after a system's behavior leaves the boundaries of the original lookup table, it continues to progress as a linear function with the equation of the line defined by the last two points in the table.

In linear interpolation, we used the slope of the line in between two points in our lookup table to infer the value of a dependent variable in between those two points. In linear extrapolation, we use the slope between two points on our plot to infer what lies beyond them. This is shown graphically below.

image-2.png

predicting the value of $y$ at time $t_p$ using linear extrapolation means using the values of $y(t_{k-1})$ (the second to last point in the dataset) and $y(t_k)$ (the last point in the dataset) to write the equation of a line between the two points. Then, following that line out to time $t_p$ gives us an estimate for $y(t_p)$. Mathematically, we can write this in point-slope form as:

$$ y(t_p) = y_p = m(t_p-t_k) + y(t_k)$$

Where the slope $m$ is given by: $$ m = \frac{y_k-y_{k-1}}{t_k-t_{k-1}}$$

Putting these two equations together yields our total equation for extrapolation as:

$$y(t_p) = y_p = \frac{y_k-y_{k-1}}{t_k-t_{k-1}}(t_p-t_k)+y(t_k)$$

Derivatives: Formal Definition

The derivative of y with respect to time, or $\frac{dy}{dt}$, is the slope of a line tangent to the y vs. time curve at a particular point. We will use the following formal definition of the derivative of some dependent variable $y$ with respect to some independent variable $t$ at some specific value of $t=a$ :

$$\frac{dy(t)}{dt}|_{t=a} = \lim_{h \rightarrow 0} \frac{y(a) - y(a-h)}{h}$$

You may also have seen a similar, but subtly different definition of the derivative:

$$\frac{dy(t)}{dt}|_{t=a} = \lim_{h \rightarrow 0} \frac{y(a+h)-y(a)}{h}$$

This is essentially equivalent. You could think of this version as approaching the "true" derivative from the right-hand side of the point "a," where the first definition approaches the "true" derivative from the left-hand side of "a." Because they will produce the same results in the situations we'll encounter in this course, we will stick with the first definition.

Importantly, this equation looks like a slope or "rise/run" equation. Using the interactive plot below, watch how this slope's accuracy changes as the value of $h$, or the time-difference between the two points used to calculate the derivative, gets larger or smaller. If the cell below shows up blank, click on it and hit Shift+Enter.

Backward finite difference approximation for a derivative

If the functional form of our data is unknown, making an exact derivative calculation impossible, or if approximating the derivative of data we collect is warranted, we can approximate the derivative of our output function $y(t)$ at some time $t = t(k)$, or the $k^{th}$ value of time $t$, by the following formula:

$$\left. \frac{d}{dt} y(t)\right|_{t=t(k)} \approx \frac{y(k)-y(k-1)}{t(k)-t(k-1)}$$

This approximation is not very good (see the definition of a derivative) unless the difference between times $t$ in our dataset is very small relative to how the output $y$ changes. This approximation is equivalent to a statement of the slope of the data in between times $t=t(k)$ and $t=t(k-1)$, which should be familiar from discussions of linear interpolation and linear extrapolation.

For-Loops in MATLAB/Octave

In MATLAB/Octave, a "for loop" can be used to perform repetitive calculations easily. The syntax looks like this:

for k=1:10
    (operations to be repeated 10 times go here)
end

the index k begins at 1. Then, whatever operations you need to perform go between the "for" and the "end" lines. Once the loop hits the "end" line, it goes back to the top of the "for" loop and increases k by 1. It does this until k=10. Then, the loop completes for the last time. Let's look at an example, in which we use a for-loop to create an array where each entry is equal to 2*k.

The output a(k) in the code below is unsuppressed, so you can see how the code "builds" the array a one column at a time. If you suppress that line using a semicolon, you will not have to see all of the "intermediate" actions of the code.

In [3]:
% initialize the array
a = zeros(1,5)% this creates an array of all zeros, with dimensions 1 row by 1 columns.

for k = 1:length(a) % notice length(a) here. This automatically sees how many times the loop should run (5 in this case)
    %print k so we can see what it is
    k
    %fill in this entry in a
    a(k) = 2*k
end
a =

   0   0   0   0   0

k =  1
a =

   2   0   0   0   0

k =  2
a =

   2   4   0   0   0

k =  3
a =

   2   4   6   0   0

k =  4
a =

   2   4   6   8   0

k =  5
a =

    2    4    6    8   10

Differential equations: Definition

A differential equation is any equation that relates one or more functions of interest to their derivatives. One of the simplest examples of this is an equation that relates some function $y$ to its first time derivative $\frac{dy}{dt}$ using some functional relationship $f$, in the absence of any external inputs: $$\frac{dy}{dt} = f(y)$$

The function $f$ can be anything, and could depend on more than just $y$, but many physical processes are well-described in certain regions of their behavior by linear differential equations, where the function $f$ is linear.

Integrals: Definition

For our purposes in this course, we will define the integral of a function $y(t)$, using the notation $\int y(t) dt$, as follows:

The function $Y(t)$ is the integral of a function $y(t)$ if $\frac{d}{dt} Y(t) = y(t)$ for all values of $t$.

This means, in simple terms, that the derivative of $Y(t)$ is $y(t)$. Integrals are often visualized or introduced in calculus classes as "the area under a curve," which is certainly a useful way to conceptualize them. Consider, for example, the scenario in the graphic below, which explains the relationship between a constant and its integral.

image.png

When the functional form of $y$ is known, it is possible to compute an indefinite integral for it, yielding the function $Y$ in our definition. However, for an arbitrary dataset, whose functional form may not be known, often the best we can do is to approximate the integral of a function.

Approximate Integration: Euler's Method

In Euler's method of approximate integration, also called the "rectangular approximation" of an integral, The area under a curve, $y(t)$, which yields $\int y(t) dt = Y(t)$, can be approximated by repeatedly summing the area of rectangles projected either forwards or backwards in time from each discrete measurement of $y$. The process begins with some initial, known value of the integral $Y_0$, the value of $Y(t)$ is incremented by the area of the corresponding rectangle on the plot of $y(t)$. The process is shown visually below.

image.png

As you can see in the second plot, the idea is to use one, known value of our integral, $Y$, at the very start of the procedure. This is often called the initial value of $Y$. Then, the area under the derivative plot from $y(t_1)$ to $y(t_2)$ is added to our estimate of $Y$, and this value, when added to $Y_0$, becomes $Y(t_2)$. Formally, this can be written as:

$Y(t_2) = Y_0 + y(t_1)\cdot(t_2-t_1)$

Aside: Compare this to what you know about point-slope form for a line: $y = m(x-x_0) + y_0$, with $x_0$ and $y_0$ describing a known point on the $y$ (dependent variable) vs. $x$ (independent variable) plot. It's the same equation!

From $t_2$ to $t_3$, the procedure is repeated. In other words, the rectangle defined by the value of $y(t_2)$ is used to add "a little more" to our estimate to produce $Y(t_3)$. Formally,

$Y(t_3) = Y_0 + y(t_1)\cdot(t_2-t_1) + y_(t_2)\cdot(t_3-t_2)$

Using a "recursive formulation," we could equivalently write:

$Y(t_3) = Y(t_2) + y(t_2)\cdot(t_3-t_2)$

And so on. In this description, we projected the value of $y$ forwards in the creation of our approximate rectangles. Therefore, this particular variant of Euler integration is called "Forward Euler" integration. "Backward Euler" integration is also possible. As with approximations of derivatives, the smaller the differences between times we use in the projection of the rectangles, the better our approximation of the derivative will be.

Because approximate integration is often performed on data arranged as arrays, we can use the counting index $k$ to write this as an equation that could be built into a "for loop" and computed efficiently in code. Considering arrays representing time $t$, derivative $y$, and integral $Y$, we could write an equation for any entry in the output array $Y(k)$ as:

$Y(k) = Y(k-1) + y(k-1)\cdot(t(k)-t(k-1))$

This should look similar to the equation for a line that you might use for linear extrapolation. Indeed, this equation is an equation for a line in point-slope form. We use each estimate for $Y(k-1)$ to produce an estimate for the next value of our integral $Y(k)$ using linear extrapolation. This is shown visually on the right panel of the plot above.

An example of how to implement approximate Euler integration in MATLAB/Octave is shown below, given a vector of known values for $y$. The approximate integral is compared with the "true" integral of the function to show its accuracy. Try changing the timestep $T$ in the code cell below to see how accuracy is affected by the size of the time step used for extrapolation/integration. A large value of $T$ is problematic for the same reason large extrapolations were problematic in Reading 4.

In [4]:
T = 0.01; %timestep
t = 0:T:1; %time vector
y = cos(10*t); %function we wish to integrate. This may come from data rather than a known function of t.

Y_estimate = zeros(size(t)); %initialize an array to hold our estimates for Y, the integral of y.
Y0 = 0; %some initial, known value for the integral at the beginning.
Y_estimate(1) = Y0; %place this value in the first entry of our array

Y_true = 0.1*sin(10*t); %for this example, we know that d/dt(sin(t)) = cos(t). 
%We will use this "exact" solution to the integral to allow us to see how accurate Euler integration is.

%now set up a for-loop starting at the second entry in Y_estimate, since we already know Y_estimate(1)=Y0
for k=2:length(t) %automatically set up the for-loop to be the right length
    %now implement Euler's formula. remember that here, y is dY/dt.
    Y_estimate(k) = Y_estimate(k-1) + y(k-1)*(t(k)-t(k-1));
end

%now we will compare our approximate integral with our "true" value to see if Euler integration works.

figure
plot(t,Y_true,'k.',t,Y_estimate,'r')
xlabel('Time (s)')
ylabel('Y(t)')
legend('true','Forward Euler Integration')

Euler's method for differential equations

Introduction

To perform Euler integration to solve a differential equation, the process is exactly the same, except that we do not have a vector of known values for $y$! We will instead use the differential equation to get the "slope estimates" we need for numerical integration.

Imagine that you produced a model $\frac{dy}{dt} = -4y +2$, where your dependent variable was $y$ and your independent variables were the parameters "4" and "2," along with time $t$.

Feedback in differential equations

As we can see, $\frac{dy}{dt}$ depends on the value of $y$ itself, which makes Euler's method slightly more complex. How? If we were to visualize this relationship using a special flow chart called a "block diagram," we might draw: image-2.png The block diagram is a visual representation of the fact that information about the value of $y$ is "fed back" into the computation of $\frac{dy}{dt}$. The round circle represents addition, and rectangles represent "operations" like multiplication and integration. This means that we can see that the equation: $$\frac{dy}{dt} = -4y + 2$$ Is represented in the diagram, with the result of the addition of $-4y$ and $2$, which is $\frac{dy}{dt}$, being sent into an integration function.

Euler's method for differential equations: implementation

The feedback in our differential equation means that in our "for loop" for integration, we have to use our most recent estimate for $y$ when computing our derivative $\frac{dy}{dt}$. This has to happen at every time step! See the example below, which uses Euler's method to solve our differential equation.

In [5]:
clear all
%create a time vector
t = 0:.001:1;
%create a vector of zeros to hold our y estimates
y = zeros(size(t));
%declare the first element in "y" as our best guess for the FIRST value of y (could be from a dataset, or knowledge of an experiment)
y(1) = 0.2;

%loop through time values to perform integration. start at the second value of time, since we already have a guess for y at the first value!
for k=2:length(t)
    %first use the differential equation to compute dy/dt (slope) based on our best guess for y at the previous time
    dydt = -4*y(k-1) + 2; %2 is a constant, but it doesn't have to be. I could have a vector of known values for 2 as well.
    %now extrapolate (integrate) to our current time to get a new estimate for y!
    y(k) = dydt*(t(k)-t(k-1)) + y(k-1);
end

figure
plot(t,y,'k')
xlabel('Time (s)')
ylabel('y')

Empirical Models: fitting polynomials in MATLAB/Octave

MATLAB/Octave can be used to estimate a "best fit" polynomial function to match a dataset. The term "best fit," in this context, means that the sum of the squared error between the model and the data is minimized. The command used to produce the set of coefficients is "polyfit." An example of how to use the "polyfit" command to produce the best-fit line for a dataset is shown below.

In [6]:
% first, create some fake "data" we will fit a line to, in order to see how "polyfit" works.
xfakedata = 0:.1:10;
yfakedata = -3*xfakedata + 4 + .5*randn(size(xfakedata)); %the randn() on the end produces some random "noise" on our fake data.
%this simulates the effect of having error in our measurements. If polyfit does its job, we should get the line y = -3x+4 back!

%now we will actually use polyfit. The array "coefficients" will contain [m b] in the equation y = m*x+b.
%the second argument to the polyfit() function is the ORDER of the polynomial. A line is a polynomial of order 1. 
%for reference, a quadratic is a polynomial of order 2.
coefficients = polyfit(xfakedata,yfakedata,1); 
%was m=-3 and b=4?
m_estimate = coefficients(1)
b_estimate = coefficients(2)

%now, these coefficients fully define a "model" of our relationship y = m*x+b. Let's produce predictions based on this model
ymodel = m_estimate*xfakedata + b_estimate;

%now plot the data and the model together to evaluate.
figure
plot(xfakedata,yfakedata,'ks',xfakedata,ymodel,'r')
xlabel('x')
ylabel('y')
legend('data','model')
m_estimate = -3.0021
b_estimate =  4.0824

Energy

In one of his famous lectures, now available online, Nobel Prize-winning physicist Richard Feynman stated:

"It is important to realize that in physics today, we have no knowledge of what energy is."

What does he mean? Well, the human-made concept of "energy" has a long and storied history. In essence, the concept was created to describe what scientists reliably observe when conducting experiments.

Let's proceed by example. If you rub your hands together, this involves "doing work." what is the result of this work? Your hands increase in temperature. If you place a ball on top of a hill, and let it roll down, it will have a predictable amount of velocity when it reaches the bottom of the hill. If I apply heat to a balloon full of air, it will expand. Energy is something "we" have come up with to link the relationships between the work done on a system and the heat a system exchanges with its environment. Specifically, based on repeated observation through the centuries, scientists accept the following about energy:

  • Energy is neither created nor destroyed.

This empirical relationship, which we now accept as a "law," began with experiments. Its authority derives largely from the fact that no matter what we do, we can't seem to disprove it. Liebniz saw that slowing a mass down through friction produced heat, and posited that the amount of heat produced in the act of slowing the mass must be equal to the "energy" the mass posessed before beginning to decelerate. Later, during the industrial revolution, the development of steam engines and other thermodynamic systems led to experiments that tried to quantify how much "work" could be done by heating something up. All of these experiments led to conclusions supporting the above three points. If a system is taken from one "state" of energy to another, it must be because either heat was transferred between the system and its surroundings, because the mass inside the system changed, or because work was exchanged between the system and its environment. If the system was then brought back to its original energy state, the amount of work done on the system, and the amount of heat transferred to the environment would always balance out. This law, which we call "the conservation of energy," has been complemented with the following, empirical observation about how the energy "stored" in a system (also called its energy state) changes:

  • Work and Heat describe the only two ways we know of that a closed system (a system in which no mass crosses the system boundary) can exchange energy with its surroundings. If the mass contained in a system's boundaries changes, the system is called an "open system," and this change of mass can also result in a transport of energy if the material entering or leaving a system's boundary carries energy with it.

To understand how to use these observations about "energy," we must first be specific about what we mean by "energy stored within a system," as well as what we mean when we describe how a system exchanges that energy with its surroundings.

Work

Work, in the thermodynamic sense, is what occurs when a system exerts forces on its surroundings whose effects can be measured. Work can be produced by a pressure applied in order to change a system's volume, or by a force that physically moves a rigid body, or by an electric field that moves a charged particle. Work is usually expressed as a capital $W$, and has SI units of $Nm$ or "Joules."

Mechanical Work via a Force

Mechanical work is the product of a force and a distance. Specifically, work is the integral of force applied along a path.

$$W_{a\rightarrow b} = \int _\vec{a}^{\vec{b}} \vec{F}\cdot d\vec{S}$$

Consider a situation in which you are pushing a block of wood around on a table. By modeling the interaction between the block and the table using dry friction, where $F_f = \mu m g$, we can imagine that if the block of wood is moving at all times, the friction force applied to resist us pushing it around is constant, and always opposing motion. Imagine that you could choose to push the block along two possible paths, $S_1$ or $S_2$. The destination is the same, but $S_1$ is much longer.

image-2.png

you might imagine that path $S_1$ would colloquially "take more work" to achieve, or "drain more of your energy." This is consistent with the formal definition of work!

Mechanical Work via a Torque

In an analagous sense to the definition of mechanical work via a force, mechanical work is produced when a torque is applied to an object which moves through some angle. Formally, we can say:

$$W_{\theta_1 \rightarrow \theta_2} = \int_{\theta_1}^{\theta_2} T d\theta$$

Because torque has units of $Nm$, we find that in SI units, with radians as our measure of angle, mechanical work has the same units as it does for translation: $\frac{kgm^2}{s^2}$, which is equivalent to $Nm$ or Joules.

Heat

When people think of "heat," they usually think of temperature. Temperature is certainly a measure of the intensity of heat, but the way that we measure the quantity of heat is in terms of how much energy it takes to raise a closed system's internal temperature. Because not all systems' temperatures can be changed with the same ease, temperature itself is not enough to describe the magnitude of "heat." For example, we could imagine that while a candle will burn our fingers almost immediately, it could not be expected to raise a large pot of water to its boiling point just as quickly.

In general, raising temperature is accomplished by either transferring heat from a hot object to a cold object, or by doing work that is converted to heat, such as when you rub your hands together to warm them up. In most of thermodynamics, the quantity of heat is denoted with the letter $Q$. Heat, in base SI units, does not have units of calories-- like work, and like measures of kinetic and potential energy, it has units of "Joules," or $Nm$.

Translational and Rotational Kinetic Energy in a Rigid Body

When a rigid body is moving, we say that it "stores" translational kinetic energy, which it can then exchange with its surroundings. The translational kinetic energy in a rigid body is:

$$E_k = \frac{1}{2}mv^2$$

Where $v$ is the scalar magnitude of its overall velocity. In SI units, this energy has units of Joules, or $\frac{kgm^2}{s^2}$.

When a rigid body rotates, it stores rotational kinetic energy. Rotational kinetic energy, which also has units of Joules, is given by:

$$E_k = \frac{1}{2}J\Omega^2$$

Where $\Omega$ is the magnitude of the angular velocity of the object (in $\frac{rad}{s}$ for SI units) about its center of mass, and $J$ is the mass moment of inertia of the object about its center of mass (in $kgm^2$ in SI units).

The First Law of Thermodynamics: The conservation of Energy

The first law of thermodynamics, also called "the conservation of energy," states that energy is never created nor destroyed... merely exchanged between a system and its surroundings. It is this law that tells us that perpetual motion machines cannot exist, as they produce work without the input of energy from outside of the system.

Because energy can only be transferred through either work, mass transfer, or heat transfer across a system boundary, we can draw the relationship between a system of interest and its surroundings using the following diagram:

image-4.png

You may notice that this looks like our "system scope" diagram, but it deals with energy only. We represent internal (stored) energy $E$, work done on the system from the external environment $W_{in}$, work done by the system on its external environment $W_{out}$, heat applied to the system from the external environment $Q_{in}$, heat applied by the system to its external environment $Q_{out}$ explicitly. We also explicitly call out terms $E_{m}$, which represent energy transfer due to mass crossing the system boundary (either into our out of the system).

Formally, we can write the change in energy stored inside the system from some "initial state" 1 to some "later state" 2 using the following equation, which is a statement of the first law:

$$ E_2 - E_1 = \Delta E = \delta W_{in} - \delta W_{out} + \delta Q_{in} - \delta Q_{out} + \delta E_{m,in} - \delta E_{m,out}$$

This says that if the balance of energy transfer between our system and its environment can be interpreted as the environment "doing work" on, contributing energy via mass transfer to, or "transferring heat to" our system of interest, it will increase the amount of energy stored inside our system if our system did not do work on its environment, contribute energy via mass transfer to, or exchange heat with its environment.

In the opposite scenario, if balance of energy transfer between our system and its environment can be interpreted as our system "doing work" on its surroundings or "transmitting heat to" its surroundings, we say that the amount of energy stored in our system goes down.

If we consider that bringing our system from "energy state 1" to "energy state 2" requires time (which it always will), we can say that the rate of change in energy in our system can be written as:

$$ \frac{E_2 - E_1}{t_2-t_1} = \frac{\Delta E }{\delta t}= \frac{\delta W_{in}}{\delta t} - \frac{\delta W_{out}}{\delta t} + \frac{\delta Q_{in}}{\delta t} - \frac{\delta Q_{out}}{\delta t}+ \frac{\delta E_{m,in}}{\delta t} - \frac{\delta E_{m,out}}{\delta t}$$

Shrinking $\delta t$ to an infinitesimal value leads to the derivative of our original first law equation, which is a totally equivalent statement about the conservation of energy:

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

The derivative of energy (and thus, the derivatives of power and heat) have units of $\frac{J}{s} = \frac{kgm^2}{s^3}$, which are commonly called "Watts" in SI units. There is also a very special name for the time-derivative of energy, and it is power.

Power

Power is the time derivative of energy. In SI units, power has units of "Watts," or Joules per second. Power can take many forms, including thermal, mechanical, and electrical.

Disciplined Process for Model Construction for a dynamic system using the first law of thermodynamics

After completing steps 1 and 2 of our overall process for model construction, you will have a list of independent and dependent variables. To use the conservation of energy to relate the two sets of variables and obtain your final model, you can:

  1. Draw an energetic diagram for each element in your model scope, crossing off any terms you are assuming to be insignificant. When you do this, justify each assumption clearly in writing. Making an assumption is always a deliberate risk; the model evaluation step of our overall disciplined process for ES103 will guide you in determining the quality of the assumptions you make.
  2. Write the time-derivative of the first law of thermodynamics for each element to describe how the element transfers energy between itself and its surroundings. Take care to substitute what you know about the energy, work, and heat terms for each element into the equation.
  3. Write equations that indicate how each element in your scope exchanges energy between itself and other elements in the scope, or between itself and the overall system's surroundings. Use physical connections between elements in your system to guide you here.
  4. Using algebraic manipulation, combine your equations from steps 2 and 3 to obtain a final system model.
  5. Check your final system model for internal validity, including the signs and units of each term, and the overall form of the equation.

Gravitational Potential Energy

Gravitational "potential energy" is defined by how much work gravity "could do" on an object. Consider the following drawing of a ball at the "top" and at the "bottom" of a hill, at two different energy states, 1 and 2.

image-2.png

We know from Newton's second law that gravity will "pull" the ball down the slope. In doing so, gravity "does work" by applying its force on the ball over the distance its center of gravity moves. We find that the amount of work gravity can do on the ball is simply a function of the difference in height between where the ball started and our "zero reference point," or the bottom of the hill. Formally, gravitational potential energy can be written:

$$E_g = mgh$$

The height "h" is always a choice. It is possible to define it, for instance, from the center of the earth, but usually it is defined relative to a convenient plane of "zero" gravitational potential energy. "Zero" is in quotes there because it's not really zero... it's really just the place, in our system definition, where gravity can no longer do work on our system.

Pressure in a fluid

Because fluids conform to their surroundings, the idea of a force applied at a "point" is less useful for fluids than it is for solid bodies. When we talk about fluids, we usually talk about pressure. Pressure is defined as normal force per unit area. This applies to solid bodies as well, but pressure is a key concept in the study of how fluids move (or don't). If $F$ is force normal to the surface of an arbitrary "fluid element" with area $A$, the pressure applied to that surface is defined as:

$$P = \frac{F}{A}$$

In SI units, pressure has units of $\frac{N}{m^2}$, which is also called a "Pascal," abbreviated $Pa$.

Pressure in a fluid is usually measured as a difference from atmospheric pressure. This is called "gauge pressure." Gauge pressure is different from "absolute pressure," which is measured relative to a perfect vacuum.

Hydrostatic Pressure

If you have ever been in a pool, you probably know that when you dive deep, you feel increased pressure on your eardrums. Why is this? Well, if we were to look at a rectangular prismatic "chunk" of fluid, also called a "fluid element" with a width $\Delta x$, a height $\Delta z$, and a thickness into the page of $\Delta y$, we could draw its free body diagram as follows:

image-3.png

The gravitational force on this fluid element is $mg$, where mass $m$ can be calculated from the volume of the chunk multiplied by its density $\rho$. This means:

$$ mg = \rho V g$$

Where $V = \Delta x \Delta y \Delta z$. If we imagine that the element is in equillibrium, we could actually write Newton's second law for it in the z-direction.

$$\sum F_z = P_2 \Delta x \Delta y - P_1 \Delta x \Delta y - \rho \Delta x \Delta y \Delta z g = 0$$

After cancaling $\Delta x \Delta y$ from all terms, we can see that:

$$P_2 - P_1 = \rho g \Delta z$$

This means that the pressure in a fluid increases linearly with depth, which leads to the standard equation for hydrostatic pressure expressed as a gauge pressure, meaning $P_{atm}=0$:

$$P_2-P_1 = P - P_{atm} = P = \rho g h$$

Work done via fluid flow

Like moving a solid body, moving a fluid takes work. Our definition of mechanical work was:

$$W = \int \vec{F} \cdot d\vec{s}$$

In a fluid, pressure is defined as force normal to a fluid surface per unit area. If a fluid flows through a thin "slice" of pipe, perhaps with thickness $dx$ and cross sectional area $A$, we can say that the work done in pushing fluid through this section of pipe could be written:

$$W = P A dx = P \mathcal{V}$$

image-2.png

If we take the time derivative of this expression, we can get an expression for the power that is expended when moving a fluid at a certain velocity using a certain pressure.

$$\dot{W} = P\dot{\mathcal{V}}$$

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$$

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}}$$

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:

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:

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

Nodes

In system dynamics, a "node" is a fictitious element in your system through which power is transferred without energy storage or "losses" (energy transfer to outside the system boundary). In the case of an electrical, fluid, or mechanical system, we could say that a "node" represents a fictitious place where no heat transfer occurs from the system to its environment and no energy is stored.

Nodes in electrical systems

The easiest place to look for an almost literal representation of a node is in an electrical schematic, where two or more "ideal wires" (wires with negligible resistance) join together at a point. See the example below for a node joining three wires.

image-2.png

With our assumptions of no heat transfer, no mass transfer, and no energy storage in place, Writing the First Law of Thermodynamics for the electrical node yields:

$$\require{cancel}$$$$\cancel{\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}$$

Rewriting, we see that $\dot{W}_{in} = \dot{W}_{out}$. If our "node" represents an infinitesimal junction between wires with negligible resistance, the voltage that exists at each "end" of the node cannot be different. Therefore, we can make the assumption that at an electrical node, there can be only one voltage, $V_1$.

Then, Adopting the sign convention that currents flowing out of the node correspond with work flowing 'out' of the node, we can then write our first law of thermodynamics as:

$$ V_1 i_1 = V_1i_2 + V_1 i_3$$

Because we have only one voltage at the node, it is common to cancel it and write:

$$ i_1 = i_2 + i_3$$

Which is simply a re-statement of the first law of thermodynamics under specific conditions and assumptions. Because there is only one voltage, the currents must "split" in a way that conserves energy. Here, the conservation of energy boils down to a conservation of charged particles that can neither be created nor destroyed via the law of conservation of mass. The equation above, in electrical systems, is often called "Kirchoff's Current Law" or "KCL."

Nodes in Fluid Systems

In fluid systems, a node has a very similar meaning. Imagine that two pipes, each of which may have non-negligible fluid resistance, are joined with a tank, which is filled by flow from both pipes. We might draw the junction between the two inlet pipes and the tank as follows:

If we define a system boundary around the node as shown in red, and make the assumption that the junction is very small in volume, we can make the assumption that no energy is stored because there is no significant mass contained in the node boundary. If we assume that its size also means that it has negligible fluid resistance, we can also say that no energy is transferred as heat across the system boundary. Finally, both because the node doesn't store energy and because there is no energy loss inside the node, the net energy carried out of the system by mass will equal the energy brought in by mass. Thus, we can write the first law of thermodynamics for this junction as:

$$\cancel{\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}$$

Rewriting, we see that $\dot{W}_{in} = \dot{W}_{out}$. If our "node" represents an infinitesimal junction between pipes, and if this junction has negligible resistance, the pressure that exists at each "end" of the node cannot be different. Therefore, we can make the assumption that at a fluid node, there can be only one pressure, $P_1$. Then, adopting the same sign convention as we did for the electrical system with inflows and outflows, we can write the first law of thermodynamics as:

$$P_1(\dot{\mathcal{V}}_2 + \dot{\mathcal{V}}_3) = P_1 \mathcal{\dot{V}}_1$$

Cancelling the extra power of $P_1$, the first law reduces to a simple conservation of flow rate equation, or:

$$\dot{\mathcal{V}}_2 + \dot{\mathcal{V}}_3 = \mathcal{\dot{V}}_1$$

Nodes in Mechanical Systems

The concept of a node for a mechanical system is a little trickier, but only because we have two sets of tools with which to analyze mechanical systems: Newton's laws and the first law of thermodynamics. But the concept of a node is still the same: it is a point in our system at which we could say that no energy is transferred outside of the system boundary (no "losses"), no mass transfer occurs, and no energy is stored. Consider the following system, in which a large mass, connected to ground through a damper, is connected to a second mass through a damper.

image-3.png

Now, one approach to studying this problem might be to simply draw energetic diagrams for the two dampers and the mass separately. Doing so using the standard assumptions for "idealized" masses and dampers might look like this:

image-2.png

But how does one know how the power $\dot{W}_{out}$ from $m_1$ "splits" to yield the input powers $\dot{W}_{in}$ for $b_1$ and $b_2$? Well, you might say that $\dot{W}_{out,m1} = \dot{W}_{in,b1}+\dot{W}_{in,b2}$ by inspection, but how do we know this is the case? Is there a more formal statement we can make?

Consider the dotted red box in the first picture. If we consider a tiny "slice" of the system that represents the physical connection between the mass and the two dampers, we could say that this slice has both negligible mass and negligible transfer of energy through the system boundary as heat. We could draw this in as another energetic element in our system as follows:

image-2.png

Zooming in on this new element and looking at the power (forces and velocities) "flowing" in and out of it, we could draw:

image-3.png

In this drawing, the blue line shows the node's single velocity $v_2$, and the forces are not drawn as vectors-- we are drawing them like currents, and assuming that the forces act parallel to the direction of $v_1$ so that the forces' magnitudes are fully "doing work" on the node.

As before, we could use these assumptions to write a simplified version of the first law of thermodynamics in derivative (power) form for this element.

$$\cancel{\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 can then re-write this as $\dot{W}_{in} = \dot{W}_{out}$ for this fictitious element, which we'll call a node. To write the power terms in the first law more explicitly as the product of force and velocity, we could say that the "effective" or "net" force from the mass, which we'll call $F_m$, does work on the node, while the forces acting on the dampers are work "out" from the node. We can also say that because the node is a rigid element (it is the connection between the mass and its two dampers, in this example), there is only one velocity at the node! In this case, that velocity is $v_1$, or the velocity of $m_1$. Then, we could write the first law of thermodynamics for this node as:

$$F_m v_1 = F_{b1}v_1 + F_{b2} v_1$$

Cancelling the extra power of $v_1$ yields:

$$F_m = F_{b1} + F_{b2}$$

This, incidentally is a reduced statement of the first law of thermodynamics in derivative (power) form if we do not cancel $v_1$. If we do cancel that term, the equation is a restatement of Newton's 2nd law, where for the node, $\sum F = \cancel{m_{node}}\dot{v}_1 = 0$ since the node's mass is negligible. Analyzing this system with Newton's laws would show us that $F_m$ in the diagram above represents the "total force" of the two dampers on the mass-- in this representation, with the node "in between" the mass and the two dampers, we are simply saying that the node is the only "thing" exerting force on the mass (sort of like a middleman).

The principle of Continuity

The principle of continuity is a re-statement of the first law of thermodynamics with specific assumptions. For many types of systems, the assumptions boil the first law of thermodynamics down to a simple statement about conservation of mass. In these cases, the principle of continuity states:

"flows into a node must balance with flows out of a node,"

Where the definition of "flows" depends on the type of system at hand. For electrical systems, the principle of continuity at a node boils down to a "conservation of current," or Kirchoff's Current Law:

$$\sum i _{node} = 0$$

With currents into a node considered positive, and currents out of a node considered negative.

For a mechanical system, Force is the quantity that "flows through" elements via Newton's 3rd law (making an imaginary cut anywhere along a rigid body and drawing a free body diagram will confirm this). Thus, a "node" in a mechanical system is an imaginary element with "no" mass. Writing the first law of thermodynamics for a node in a mechanical system, and canceling that its (single) velocty from the first law equation, one obtains:

$$\sum {F}_{node} = 0$$

For a fluid system (incompressible), a "node" might represent an infinitesimal junction between two pipes or valves, or a junction between a valve and a tank. Writing the first law of thermodynamics for this "infinitely thin" element in which only one pressure exists (and can thus be canceled), one obtains:

$$\sum \dot{\mathcal{V}}_{node} = 0$$

With volumetric flows into the node being considered positive, and flows out of the node negative.

Generalized Fluid Capacitors

While a simple tank storing energy in gravitational potential is one example of a fluid "capacitor," or ideal fluid potential energy storage element, working against gravitational potential is not the only way a vessel full of fluid can store energy. In many cases, a fluid storage vessel can store potential energy by "stretching" or increasing its volume elastically as it is filled (like a balloon). Sometimes, hydraulic accumulators use air pressure to act as a "spring" making a cavity harder to fill with fluid as fluid volume increases. Sometimes, literal spring-loaded pistons are used.

In fact, the concept of the "fluid capacitor" can be applied to any fluid element that can be reasonably modeled as storing fluid potential energy without heat transfer, which means there is no significant resistance at the inlet to the vessel. Consider the following drawing, which represents a "balloon-like" fluid capacitor that stretches to store fluid as flow work is done on the element to result in an influx of fluid, $\dot{\mathcal{V}}_c$.

image-2.png

Writing the first law of thermodynamics for this element, assuming no heat transfer at the inlet, no significant kinetic energy storage, and no internal energy carried by mass, yields:

$$\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}$$

This means that the energy stored in the capacitor will go up if the net work $\dot{W}_{net} = \dot{W}_{in}-\dot{W}_{out}$ is positive. This work is flow work, where, defined using gauge pressure, we see:

$$\dot{W}_{net} = (P_c - \cancel{P_{atm}})\dot{\mathcal{V}} = P_c \dot{\mathcal{V}}_c$$

Now, it is true that knowing just how much work needs to be done to fill the capacitor with more fluid can be tricky, especially for "balloon-like" capacitors. To actually stretch the vessel, work must be done to increase the pressure inside the vessel with respect to atmospheric pressure, and this usually involves complex calculations how how stiff the vessel's material is.

Many times, a physics-based calculation of this work is intractible. Therefore, the effective "compliance" of a fluid capacitor is often studied empirically, and is characterized by defining a "fluid capacitance" for the vessel. Defining the capacitance of the element as $C\equiv \frac{ \mathcal{V}}{ P}$ allows us to develop an equation that is very similar to that of the electrical capacitor, as seen in Reading 11. Specifically, we can define the capacitor's stored energy by saying that "all of the work done on the element is stored energy," according to the first law equation we wrote above. Formally, that looks like this:

$$E_{stored} = W_{net} = \int_0^{\mathcal{V}_c} P_c(\mathcal{V}_c) d\mathcal{V}_c = \int_0^{\mathcal{V}_c} \frac{\mathcal{V}_c}{C} d\mathcal{V}_c = \frac{\mathcal{V}_c^2}{2C} = \frac{ P^2_c C^2}{2C} = \frac{1}{2}CP_c^2$$

Using this definition, we can write the first law of thermodynamics for a generalized fluid capacitor as:

$$\dot{E} = \dot{W}_{net} = CP_c \dot{P}_c = P_c \dot{\mathcal{V}}_c$$

The Principle of Compatibility (Kirchoff's Voltage Law)

The principle of continuity states that the sum of the voltage drops around any closed "loop" in a circuit-like network must be zero. This is a direct consequence of the first law of thermodynamics. Consider the following circuit, for which 3 closed loops exist:

image-3.png

For Loop 1, the principle of compatibility states: $$\require{cancel}$$ $$ V_{41} + V_{12} + V_{23} + V_{34} = 0$$

Which, given the definition of $V_a - V_b = V_{ab}$, could be re-written as:

$$ \cancel{V}_{4} - V_1 + V_1 - V_2 + V_2 - V_3 + V_3 - \cancel{V}_{4} = 0$$

Similarly, for Loop 2, the principle of compatibility states:

$$V_{41} + V_{12} + V_{24} = 0$$

And for Loop 3, the principle of compatibility states:

$$V_{42} + V_{23} + V_{34} = 0$$

Compatibility can also be appled to fluid systems (replacing voltages with pressures) and to mechanical systems (replacing voltages with velocities or angular velocities).

Updated Disciplined Process for using Energy Conservation to Construct a Model inclusive of Kirchoff's Current Law (KCL) and Kirchoff's Voltage Law (KVL)

Now that we have a "new tools" (KCL/KVL) to help us with model construction, we can update our "step 3" in the general discplined process for Model Construction to include the use of nodes in our process. Our update of the disciplined process is as follows:

  1. Draw an energetic diagram for each element in your model scope, crossing off any terms you are assuming to be insignificant. When you do this, justify each assumption clearly in writing. Making an assumption is always a deliberate risk; the model evaluation step of our overall disciplined process for ES103 will guide you in determining the quality of the assumptions you make.
    1. You may reference the assumptions in the "standard" lumped element table in your justification, but you must still give a reason for assuming that an element acts like one of these "standard" element.
  2. Write the time-derivative of the first law of thermodynamics for each element to describe how the element transfers energy between itself and its surroundings. Take care to substitute what you know about the energy, work, and heat terms for each element into the equation.
    1. You may cross out any "extra" power variables in each final first-law equation for each element (e.g. $V_{12} i = i^2R \rightarrow V_{12} = iR$)
  3. Write equations that indicate how each element in your scope exchanges energy between itself and other elements in the scope, or between itself and the overall system's surroundings. Use physical connections between elements in your system to guide you here. Specifically, power linkges between elements can be written using Krichoff's Current Law (continuity) and Kirchoff's Voltage Law (compatibility):
    1. Identify "nodes" in your system and write the principle of continuity for these nodes (e.g. $i_1 - i_2 - i_3 = 0$).
    2. Identify "loops" in your system and write the principle of compatibility for each loop (e.g. $V_{12}+V_{23}+V_{34}=0$.
  4. Using algebraic manipulation, combine your equations from steps 2 and 3 to obtain a final system model.
  5. Check your final system model for internal validity, including the signs and units of each term, and the overall form of the equation.

Power Variable Types

In all three of the types of systems we've studied, it is possible to write an equation for how power flows between elements. For example:

  1. In a mechanical system, power is $F\cdot v$ for translational systems and $T\cdot \Omega$ for rotational systems
  2. In an electrical system, power is $V \cdot i$
  3. In a fluid system, power is $P \cdot \dot{\mathcal{V}}$.

If the first law of thermodynamics tells us that one of these two variables is conserved at a "node," we interpret this as a statement that it represents a quantity flowing "through" the node. We call this type of variable a "through type variable." In mechanical, electrical, and fluid systems, these are force, current, and flow rate, respectively.

If a variable must be measured with respect to some fixed reference in order to have meaning, and is different from one node in our model to the next, it is called an "across type variable."

For example, velocity must be measured with respect to an inertial reference frame, and varies from one end of an idealized damper to the other. Voltage must be measured with respect to some reference "ground" voltage, and varies from one end of a resistor to another. Pressure must be measured by a gauge which references some environmental (atmospheric) reference pressure, and varies from one end of a valve to the other.

Generalized Idealized Elements

All of the "idealized" system element types we have talked about thus far, by the assumptions applied to their first law equations, either store energy or transfer it to the surrounding environment. This means that all of the elements we've discussed (other than "nodes") have different amounts of power flowing into and out of them. These elements are often visualized as having two "ports," one into which power flows, and one out of which power flows. A drawing is shown below:

image-2.png

The generalized element above will have two distinct values of the A-type variable at each "end" (some systems textbooks call these 'ports'), either because the element is accumulating energy (like a mass, capacitor, or tank does), or because it is transferring energy to outside the system boundaries (like a resistor, damper, or valve). We will typically label the inside this element with the independent variable that dictates its ability to store energy (e.g. $C$, $m$, $J$) or dissipate energy (e.g. $b$,$R$).

Visualizing elements in this general way allows us to connect elements of our systems together into generalized "equivalent circuits." Doing this provides operational efficiency in using energy conservation (the first law) to build models for our systems.

Assuming no significant net energy transfer via mass flow (as we have in all of our 'standard' elements so far), the first law of thermodynamics for this element could be written:

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

Then, recognizing that $\dot{W} = A\cdot T$, we could write the power portion of the first law equation as:

$$\dot{E} = A_1T - A_2T + \dot{Q}_{in} - \dot{Q}_{out}$$

note that the visualization of our generalized element does not show whether the element stores energy or transfers it to the element's surroundings as heat. As such this is not a complete energetic diagram. We need to know what the $\dot{Q}$ terms and the $\dot{E}$ term should be for our element. These terms are often based on similar sorts of assumptions, and yield two common types of "generalized elements."

Energy Storage Elements

If an element stores energy, but does not transfer a significant amount to its surroundings via heat, it is generally called an "energy storage element." If it stores energy via its across-type variable, it is called an "A-type storage element." Masses, rotational inertias, capacitors, and fluid capacitors are all A-type storage elements. If the element stores energy via its through-type variable, it is called a "T-type storage element." For energy storage elements, zero heat transfer to the element's surroundings is often assumed, which reduces the first law equation to:

$$\dot{E} = A_1 T - A_2 T$$

Dissipative Elements

If an element does not store significant energy, but does transfer significant energy to the element's surroundings via heat, we call that element a "dissipative element." Dissipative elements include electrical resistors, valves, and idealized dampers. The assumption of no energy storage for dissipative elements yields the generalized first law balance of:

$$\dot{Q}_{out} = A_1 T - A_2 T$$

Do all physical things fall into one of these two categories?

No. It may not be reasonable to represent every physical "part" of every system as one of these two things. However, Elements that display significant energy storage and energy dissipative behavior can, under many circumstances, be represented by a combination of a dissipative and a storage element. We call this a "lumped element" approximation, where a "real" element is broken down into a combination of idealized storage and dissipative elements.

Generalized Equivalent Circuits

By conceptualizing each of our idealized elements as having two ports through which power flows, much like an electrical component has, we can arrange the elements into an equivalent circuit that shows us how power flows from one element to another. An example is shown below.

image-2.png

This circuit has a source (which we often model as having a defined, known value for either the T-type or A-type power variable, and thus "infinite" power potential), and 5 idealized elements. Distinct values of the across-type power variable are shown in blue, and distinct values of the through-type variable are shown in red. This circuit-like network allows us to write compatibility relations (loops relating the A type variables) and continuity relations (nodal equations for the T type variables) to aid in model construction.

Note that while this configuration allows for easy use of the first law of thermodynamics for studying how power flows from one element in our system to the others (compatibility and continuity relationships), it does not tell us explicitly about energy storage or dissipation for each element. Individual first law balances for each element are required, along with the construction of loop and node equations, to use the equivalent circuit for model construction.

Note that typically, the blank box used to denote each element would include the element's primary parameter. For example, a damper might be drawn as a box with a "b" in it to represent its damping coefficient. A mass might be drawn as a box with an "m" in it. A capacitor might be labeled "C."

Disciplined Process for using Energy Conservation and Equivalent Circuits to Construct a Model

Now that we have "new tools" (KCL/KVL and equivalent circuits) to help us with model construction, we can update our "step 3" in the general discplined process for Model Construction. The use of equivalent circuits means that we can take explicit advantage of two particular forms of the energy conservation equation: node equations (KCL) and loop equations (KVL). KCL lets us represent power transfer between elements when the T-type power variable splits and the A-type variable is constant. KVL lets us represent power transfer elements when the T-type variable is constant but the A-type variable is not.

  1. Draw an energetic diagram for each element in your model scope, crossing off any terms you are assuming to be insignificant. When you do this, justify each assumption clearly in writing. Making an assumption is always a deliberate risk; the model evaluation step of our overall disciplined process for ES103 will guide you in determining the quality of the assumptions you make.
    1. You may reference the assumptions in the "standard" lumped element table in your justification, but you must still give a reason for assuming that an element acts like one of these "standard" element.
    2. Represent (if possible) each of your elements as a generalized circuit element.
  2. Write the time-derivative of the first law of thermodynamics for each element to describe how the element transfers energy between itself and its surroundings. Take care to substitute what you know about the energy, work, and heat terms for each element into the equation.
    1. You may cross out any "extra" power variables in each final first-law equation for each element (e.g. $V_{12} i = i^2R \rightarrow V_{12} = iR$)
  3. Represent connections between your system's elements by drawing the system as an equivalent circuit. Use physical connections between elements in your system to guide you here. Write equations that indicate how each element in your scope exchanges energy between itself and other elements in the scope, or between itself and the overall system's surroundings. Specifically, power linkges between elements can be written using Krichoff's Current Law (continuity) and Kirchoff's Voltage Law (compatibility):
    1. Construct and label your "equivalent circuit." This may be an iterative process as you identify nodes and loops in your system (see below).
    2. Identify "nodes" in your system and write the principle of continuity for these nodes (e.g. $i_1 - i_2 - i_3 = 0$).
    3. Identify "loops" in your system and write the principle of compatibility for each loop (e.g. $V_{41}+V_{12}+V_{23}+V_{34}=0$.
  4. Using algebraic manipulation, combine your equations from steps 2 and 3 to obtain a final system model that includes only independent variables, dependent variables, and their derivatives.
  5. Check your final system model for internal validity, including the signs and units of each term, and the overall form of the equation.

Idealized Power-Converting Transducers

An idealized, power-converting transducer, like all of the other physical system elements we have studied, obeys the conservation of energy. However, like the other idealized element types we've talked about, the power-converting transducer only does "one job," and that is power conversion. Therefore, if something can be said to be adequately modeled as a power-converting transducer, it cannot store energy or transfer it to the system's surroundings. In other words, its first law of thermodynamics equation in power form looks like this: $$\require{cancel}$$ $$\cancel{\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}}$$

Simplified, we find the fundamental equation that defines an idealized power-converting transducer: image-2.png $$\dot{W}_{in} = \dot{W}_{out}$$

While this looks a bit like the equation we used to define a "node," for a transducer, $\dot{W}_{in}$ and $\dot{W}_{out}$ will always represent a change in the power variables from the "input" side to the "output" side of the element.

Representing Power-Converting Transducers in Equivalent Circuits

There is no grand universal symbol used for representing power-converting transducers in equivalent circuit diagrams. We will simply pick a symbol with the knowledge that others are possible, but all must have four "ports" in order to connect two equivalent circuits that show two different types of power flow.

image-2.png

In this diagram, $A_1$ and $T_1$ represent the across and through type variables that drive the transducer ($\dot{W}_{in}$) before conversion of power, while $A_2$ and $T_2$ represent the across and through type variables generated by the transducer as it converts the input power into a different form. The double-ended arrow between the two circular "circuit elements" indicates that power is equal on each side, even though there is not a physical "wire" connecting them.

Idealized Rotational Mechanical to Translational Mechanical Power Transducers

Wheels, Pulleys, and rack-and-pinion gears that represent contact between a translating body and a rotating body can be modeled as idealized power-converting transducers as long as there is no slip at the point of contact. Examples are shown below:

image-2.png

For these idealized elements, The first law of thermodynamics in power form can be written:

$$F v = T \Omega$$

and the power variables between each side of the idealized transducer can be linked by the following two equations:

$$Fr = T$$$$r\Omega = v$$

Signs may have to be adjusted given positive directions defined by the engineer. Inertias and damping effects must be included as separate elements by the engineer if they are determined to be significant in the context of the system.

Idealized Electrical- Rotational Mechanical Power Transducers

If their armature (coils of wire) do not store significant magnetic field energy, DC motors and DC generators are sometimes modeled as idealized transducers with added armature resistance on the electrical side along with motor shaft inertia and viscous damping on the mechanical side. An example is shown below. The motor model's physical layout of idealized components is shown on the left, and the total equivalent circuit is shown on the right.

image-6.png

Notice that the left half of the equivalent circuit shows power transfer as the product of voltage (across) and current (through), while the right side shows power transfer as the product of angular velocity (across) and torque (through). The idealized transducer encompasses the motor's conversion of electrical to rotational mechanical power. Assuming no significant heat transfer, mass transfer, or energy storage, the idealized part of the motor has a first law of thermodynamics equation that can be written:

$$V_{2g} i = T\Omega$$

With the following two equations relating torque with current and angular velocity with voltage drop:

$$T = k i $$$$V_{2g} = k \Omega$$

Idealized Fluid- Rotational Mechanical Power Transducers

For pumps and turbines that can be modeled as idealized power transducers that convert flow work to rotational mechanical work without significant losses or energy storage, we can write the first law of thermodynamics with the assumption of no energy storage or heat transfer as:

$$P_{12}\dot{\mathcal{V}} = T \Omega $$

The physical linkage between mechanical and fluid power variables is due first to the translation between fluid pressure on the turbine/pump blade(s) and torque about the turbine/pump axis according to Newton's second law. Generally, a single empirically-derived parameter is used for this conversion:

$$T = D P_{12}$$

The other piece of the conversion has to do with how the volumetric flow rate of fluid passing through the turbine or pump is related to its angular velocity:

$$D\Omega = \dot{\mathcal{V}}$$

This coupling coefficient "D" for a pump is often conceptualized as the volume displaced per unit motion of the pump/turbine (so for a rotating pump/turbine, it would have units of $\frac{m^3}{rad}$.

Input-Output Differential Equation Models

An input-output differential equation model is a single differential equation represents a relationship between the system's input (source of power from outside of the system scope) and its output (our dependent variable). Generally speaking, this type of model can be written as:

$$ \frac{d^n y}{dt^n} = f\left(y,\frac{dy}{dt},\frac{d^2 y}{dt^2},\cdots,\frac{d^{n-1} y}{dt^{n-1}},u,\frac{du}{dt},\frac{d^2 u}{dt^2},\cdots,\frac{d^{m-1} u}{dt^{m-1}}, \frac{d^{m} u}{dt^{m}}\right)$$

Don't let the notation scare you. This just means that the highest derivative of our output $y$ is a function of or depends on the output and its derivatives (up to a highest order $n-1$, along with the input and any of its derivatives that are relevant (up to a highest order $m$). You have already been doing this all semester! Your models have mostly been in the form:

$$ \frac{dy}{dt} = \square y + \square u$$

Which is an input-output model as defined above!! As you can see, the equation above is an input-output differential equation with $n=1$ and $m=0$, where the first derivative of our dependent variable $y$ is a function of $y$ itself, and our input $u$ . The "order" of a differential equation is equal to $n$, the number of derivatives of the output (dependent variable) $y$ present in the equation.

Building Input-Output differential equation models

Deriving input-output models for "higher-order" systems is done using our disciplined process from Reading 15. There are essentially no modifications to this process for finding input-output models for systems with an order higher than 1. As you work through the algebraic reduction of your model from the "menu" of elemental, node, and loop equations, expect to take the derivative of one or more intermediate equations as you strive to eliminate unknowns.

Differential Equation Models in "State Space" Form

<a href=" ../Reading_17/Reading_17.html#Differential-Equation-Models-in-"State-Space"-Form" > Link to Original Context in: Reading_17</a>

Sometimes, building a model of a differential equation model that has an order of 2 or higher in input-output form is algebraically difficult and cumbersome. Luckily, there is a simpler way to represent a differential equation model that may represent a system with multiple independent energy storing elements. It is called a "state space" model.

The term "state space" comes from the fact that the model fully describes the system's energetic "state," or the total energy inside the system. If we pick multiple dependent variables rather than one, and that set of dependent variables can fully describe the system's total energy, then we can write a list of coupled differential equations that represent our system. While the study of state space systems is often reserved for late undergraduate or even graduate study, the concept is fairly simple.

Assume we have a list of $n$ dependent variables for our system because our system has $n$ independent energy storing elements. Let's make their names general to avoid putting ourselves in a box and call these $x_1$, $x_2$, $x_3\ldots,x_n$. Most of the time, these will be either T-type or A-type power variables in a physical system. Let's also assume that, together, these variables fully describes the system's energy storage. Lastly, we will assume that our system has a single external source of power that is described by a known input $u$.

We can then manipulate our system's element, loop, and node equations to get the following list of first order differential equations that describe our system's behavior:

$$ \left\{ \begin{matrix} \frac{dx_1}{dt} &=& f(x_1,x_2,\ldots,x_n,u) \\ \frac{dx_2}{dt} &=& f(x_1,x_2,\ldots,x_n,u) \\ \vdots &=& \vdots \\ \frac{dx_n}{dt} &=& f(x_1,x_2,\ldots,x_n,u) \end{matrix} \right. $$

To read this, a few clarifications will be helpful. What this list says is that the first derivative of each of our states $x_1,x_2,\ldots,x_n$ MAY DEPEND on any or all of the other system states, and/or the input $u$. It does not state that each equation MUST depend on all of these. Any dependence between one state derivative equation and the other system states is called "coupling." This list is a list of coupled first-order differential equations. Later in your career, you may see this written compactly in vector form:

$$\frac{d\vec{x}}{dt} = f(\vec{x},u)$$

Which saves a bit of writing if we just consider the "state vector" $\vec{x}$ to contain all of our system's states. A state space model is, in its most general form, a "vector differential equation," which unlocks a whole set of analysis tools that are unfortunately beyond the scope of this course. For now, we will continue to need to simulate our model numerically to investigate its behavior.

This concept may seem a little more complicated than input-output form at first glance, but building a state space model is really in many ways easier than building an input-output model. Note that technically, all of the first-order models you built this year are already in state space form, just with $n=1$.

Choosing state variables for a state space model

You may be wondering how to know what to choose as your set of dependent variables in a state space model. When you take differential equations, and possibly a higher-level systems course, you will likely learn that there is no one answer to this question. State space models are not unique, and any set of variables that can, in its whole, describe the system's current total stored energy is acceptable.

However, for this course, we will simplify our lives and stick with one approach, which is to choose a state variable that describes the energy storage in each independent energy storing element in your system. For an electrical system, you might choose to use the voltage across each independent capacitor, since they store energy as $E_c = \frac{1}{2}CV_{12}^2$. For a fluid system, you might do the same but with pressures across each fluid capacitor. For a mechanical system, you might choose the velocity or angular velocity of a mass or rotational inertia respectively, since $E_m = \frac{1}{2}mv^2$ and $E_J = \frac{1}{2}J\Omega^2$.

Reducing a "menu" of element, node, and loop equations to a suitable state space model

To build a state space model, first analyze the system's components individually, and analyze how power flows within the system boundaries using loop and node equations.

Then, you would do well to begin by solving each independent energy storage element's equation for the derivative of its power variable. This is a great first step because the power variable for each energy storage element is probably one of your "state variables!"

If you follow the two steps above, you already have your "state space form" started. Then, using substitution, eliminate all unknowns by substitution.

TIP: If you have a few "dependent" energy storage elements in your system, try to eliminate the "extra" power variables associated with these early on. An example would be a system with a rack-and-pinion gear: your "state" for that part of the system might be velocity, so you'd want to eliminate angular velocity early on to help with algebra.

Mechanical Springs

Mechanical springs come in all shapes and sizes. If the spring is linear, which many are (at least for small values of spring deflection), it follows Hooke's Law, which states that there is a linear relationship between force (for a translational spring) or torque (for a torsional spring) and the spring's deflection.

A diagram representing an "ideal" spring, which has negligible mass and dissipates negligible heat to the environment when it is deformed, is often drawn as follows. Both a torsional (rotational) spring and a translational spring are represented in the diagram below. Use the right hand rule to imagine the torques, angles, and angular velocities exerted upon the rotational spring.

image-3.png

As drawn, Hooke's Law can be written for the translational spring as:

$$F_k = K(x_1-x_2) = Kx_{12}$$

If you imagine the scenario in which $x_{12}>0$, or $x_1>x_2$, it is clear that the spring would be in compression as shown. If the sign of $x_{12}$ were to flip, Hooke's Law would predict a negative force, meaning that the spring would be in tension with $F_k$ pointing outwards from each end. For a translational spring, spring constant "K" can be represented in SI units of $\frac{N}{m}$.

The expression of Hooke's Law for a torsional spring is similar:

$$T_k = K(\theta_1 - \theta_2) = K\theta_{12}$$

For a torsional spring, the spring constant $K$ can be expressed in base SI units of $\frac{Nm}{rad}$.

The picture above shows a free-body diagram on each type of spring. If a spring's mass is negligible, Newton's second law for the spring indicates that the force on each end of the spring must be an equal $F_k$ for a translational spring, and $T_k$ for a torsional spring.

From an energetic perspective, if a spring is considered massless, it ONLY stores elastic potential energy, and stores no kinetic energy. If it is also assumed that the spring does not, by itself, dissipate significant energy across the system boundaries through heat transfer, and has a constant mass, then the first law tells us that any work done on the spring will cause it to store potential energy.

$$\require{cancel}$$$$E = W_{net} + \cancel{Q_{net}}+ \cancel{E_{m,net}}$$

Similarly, for a torsional spring, we can write: $$E = W_{net} + \cancel{Q_{net}}+ \cancel{E_{m,net}}$$

because mechanical work is $F\cdot x$ for a translational system and $T\cdot \theta$ for a rotational system, the spring's energy storage can be expressed for a translational spring as: $$\require{cancel}$$ $$E = W_{net} + \cancel{Q_{net}}+ \cancel{E_{m,net}} = \int F_k dx_{12} = \frac{1}{2} K x_{12}^2$$ Similarly, for a torsional spring, we can write: $$E = W_{net} + \cancel{Q_{net}}+ \cancel{E_{m,net}} = \int F_k d\theta_{12} = \frac{1}{2} K \theta_{12}^2$$

These equations represent the stored Elastic Potential Energy in the spring. However, the issue with both of these forms of the energy storage equation for springs is that they don't include a power variable. This means that writing the first law of thermodynamics for the spring in power form doesn't produce a clean statement about power variables. Without a direct statement about how the spring's power variables interact, applying continuity and compatibility equations to a mechanical system with a spring would be difficult.

for this reason, the energy in a translational spring is often re-written as:

$$E = \frac{1}{2K} F_k^2$$

and for a torsional spring as:

$$E = \frac{1}{2K} T_k^2$$

A quick algebraic substitution of $F_k= K x_{12}$ for the translational spring or $T_k = K \theta_{12}$ for the torsional spring will show that the two types of expressions for stored energy are equivalent.

Th expression for stored spring energy in terms of power variables shows us that unlike a mass, which stores kinetic energy by accumulating the across type power variables $v$ or $\Omega$, a spring stores energy by accumulating the through type power variables $F$ or $T$. For this reason, springs are often called "Through Type" energy storage elements.

Using the power-variable form of the energy storage equation, we can write the first law of thermodynamics in power form for a translational spring as:

$$\dot{E} = \frac{1}{K} F_k \dot{F}_k = \dot{W}_{in}-\dot{W}_{out} = F_k v_{12}$$

and for a torsional spring, we find a similar relationship:

$$\dot{E} = \frac{1}{K} T_k \dot{T}_k = \dot{W}_{in}-\dot{W}_{out} = T_k \Omega_{12}$$

Cancelling the extra appearance of the through-type variables in each of these equations, we find that for a translational spring, we have:

$$\dot{F}_k = Kv_{12}$$

and for a torsional spring, we have:

$$\dot{T}_k = K\Omega_{12}$$

Where "1" and "2" represent the two "ends" of each spring. With these equations, springs are easy to include in equivalent-circuit representations of mechanical systems.

Fluid Inertors

One of the things you may have noticed when we've dealt with fluid systems in the past is that we had to assume that elements in our fluid systems did not store a significant amount of kinetic energy, and thus we did not include kinetic energy in our derivations of fluid capacitors and/or fluid resistors.

Well as it turns out, this is a poor assumption for many pipes with high volumetric flow rates carrying incompressible fluid, especially if the pipes carry a large volume of fluid. Imagine a long pipe as shown in the diagram below with length $L$ and cross-sectional area $A$. EVEN IF the pipe does not lose significant energy to heat, it may show a pressure drop from one end of the pipe to the other!

image-2.png

If we were to assume that the flow in the fluid is uniform, we can write the total mass of the fluid inside the pipe as $m = \rho A L$, with $A$ the cross sectional area, $\rho$ the density, and $L$ the pipe length. Then, the kinetic energy inside the pipe can be written $E = \frac{1}{2}mv^2 = \frac{1}{2}\rho A L v^2$. Replacing $v$ to expose our T-type power variable $\dot{\mathcal{V}}$, we can write $v = \frac{\dot{\mathcal{V}}}{A}$. Then, our kinetic energy equation becomes:

$$E = \frac{1}{2} \frac{\rho L}{A} \dot{\mathcal{V}}^2$$

We can group the constants to uncover what is commonly called "fluid inertance" $I = \frac{\rho L}{A}$ for uniform flow in a pipe. We can then write:

$$E = \frac{1}{2} I \dot{\mathcal{V}}^2$$

Note that this formula for $I$ will over-predict stored kinetic energy for non-uniform flow, but it is a decent first approximation.

So, to capture kinetic energy storage in a pipe, system modelers will often include an "idealized fluid inertor" as part of their model. It is a fictitional element that has no losses, so it is often combined in series with a resistor to represent heat loss due to friction in the pipe flow. For an "idealized fluid inertor," we say that energy carried in by mass transfer is the same as energy carried out by mass transfer, so $\dot{E}_{m,net}=0$, and we say that pipe flow losses are negligible, so $\dot{Q}_{net}=0$. Then the first law in power form becomes:

$$\dot{E} = \dot{W}_{net} + \cancel{\dot{Q}_{net}}+ \cancel{\dot{E}_{m,net}}$$

Which, when rewritten with $\dot{E} = I \dot{\mathcal{V}} \ddot{\mathcal{V}}$ and $\dot{W}_{net} = (P_1-P_2)\dot{\mathcal{V}}$, becomes:

$$\dot{W}_{net} = (P_1-P_2)\dot{\mathcal{V}}=I \dot{\mathcal{V}} \ddot{\mathcal{V}}$$

Which can be simplified to:

$$P_{12} = I \ddot{\mathcal{V}}$$

Once again, idealized fluid inertors are fictitious-- they are almost always combined with some kind of idealized resistor to represent losses in pipe flow.

Electrical Inductors

Like a fluid inertor and a mechanical spring, an idealized electrical inductor is an element that stores energy in a T-type power variable; for electrical systems, this means current!!

Coils of wire tend to produce magnetic fields when current passes through them, as we have already learned in Reading 16. If the coil of wire is big enough, this magnetic field stores energy! For example, the "transduceyness" of electric motors relies on magnetic fields interacting with current to transform power from mechanical to electrical and back. However, most small motors and generators do not produce enough of a magnetic field for their "inductance" (capacity to store magnetic field energy) to be relevant in a system model. You will also rarely find motor inductance on a specification sheet unless the motor is very large.

An introduction to inductors, which are specially designed electrical components that have a known capacity to store energy in magnetic field, is given in the YouTube video below. Note that in the water analogy, the author uses a "water wheel" to describe the energy storage-- you could easily replace this analogy with "fluid inertance" instead of the needlessly complex mechanical energy storage associated with a water wheel.

Inductors that are commercially available are sold with a certain "inductance," which represents its capacity to store energy. Their electrical symbol is shown below. image.png

Magnetic field energy stored in an inductor is commonly written:

$$E = \frac{1}{2}Li^2$$

If we consider an "idealized inductor," which only stores energy in this way, and loses none, we can write the first law in power form as follows, considering that there is no mass flow across the boundaries of the inductor:

$$\dot{E} = \dot{W}_{net} + \cancel{\dot{Q}_{net}}+ \cancel{\dot{E}_{m,net}}$$

Subbing in the derivative of our energy equation $\dot{E} = L i \dot{i}$ and our electrical power equation $\dot{W}_{net} = (V_1-V_2)i$, we obtain a power-form energy balance of:

$$V_{12}i = Li \dot{i}$$

Which can be simplified to:

$$V_{12} = L \dot{i}$$

Like fluid inertors, "real" electrical inductors are often represented in a system model by a combination of an idealized inductor and an idealized resistor, since true inductors often have a significant amount of electrical resistance (they are just wires, after all).

ES103 Final List of Standard Elements and Assumptions

With our last three energy storage elements taken care of, we can produce a complete list of all of ES103's standard assumptions and elements for physical systems.

image.png

Model Evaluation

Model Evaluation

Once a model is constructed, it must be evaluated to see how well it matches the system it is supposed to represent. This is typically done by conducting an experiment on the real system if possible, collecting data, and comparing those data to the output(s) of the model. It is important that if data were used in the construction phase to determine relationships between elements in the model, new data under different conditions are collected for the evaluation phase. This will help inform us about how well the model generalizes, or represents the behavior of the model under new circumstances.

Basic Operations in the MATLAB/Octave Programming Language

Octave, which is the open-source version of MATLAB, can be used as a simple calculator. Operations are performed one line at at time. See the "cell" below, which defines two variables, adds their values on one line, and then multiplies them on the next. More information about basic arithmetic operations can be found at this link. To "run" or execute the code in this cell, select it, and then hit Shift+Enter (Hold Shift, then hold Enter as well).

If you are very new to computer programming, and even if you are not, you will probably benefit from reading section 1 of The ES103 Programming Resource, especially if what follows seems a little confusing to you. We will be learning programming skills by needing them a little at a time to solve particular problems, so you should not approach reading the programming resource (or any other document) as a "how-to" of computer programming. Many spoken and written languages are learned effectively by immersion, and programming languages are no different. You will learn by trying, struggling, and self-correcting, because your learning is itself a dynamic system!

In [8]:
% a comment, which is not executed, is noted by a %. In Jupyter, make sure this % is followed by a space.
% use comments to tell the reader what we are doing. First, we "define" a variable a to be the number 2.
a = 2; % the semicolon at the end of the line means "don't show me this when you execute the code."
% now, we will define a second variable. Variable names should be descriptive when possible.
b = 3.02;
% now we will add them together. 
c = a+b % note there is no semicolon, which means the code will "Show" us the result
d = a*b %same here. When you run this cell, think about what you expect to see!
c =  5.0200
d =  6.0400

Often we need "arrays" or lists of numbers in order to plot data. MATLAB can also perform arithmetic on these, as shown below.

More detailed information about accessing and manipulating arrays in MATLAB can be found here and here.

If you have trouble understanding what is happening in the cell below, I suggest you visit both of these links.

In [9]:
% let's create a matrix (an array) of numbers. One column will represent time, and the other will represent "f," which we have computed as some function of time.
% arrays are defined by row. a semicolon inside the definition of the array, which begins and ends with [], means "create a new row"
data = [ 1  10; 2 11; 3 10; 4 9; 5 8] %no semicolon at the end... we should see this one when we execute.

% let's subtract 1 second from all of the times in 'data.' We can access the "times" in our data, or the first column only, as follows:
data(:,1) = data(:,1)-1 %notice that we have UPDATED all values in the first column of the array. the colon : in data(:,1) represents "all rows" in the "first column"

% Now, let's say we need to convert the units of column 2 from meters to centimeters. We could do this by multiplying all elements in the second column by 100.
data(:,2) = data(:,2)*100

%when you run this cell, you will see "Data" printed three times, with the updates we made as we made them.
data =

    1   10
    2   11
    3   10
    4    9
    5    8

data =

    0   10
    1   11
    2   10
    3    9
    4    8

data =

      0   1000
      1   1100
      2   1000
      3    900
      4    800

One of the major advantages of MATLAB/Octave as a language is its built-in data visualization (plotting) capability. Let's imagine that we wanted to plot "f" vs. time for the fictitious data above. We could do this using the functionality in the following cell. Note that the Jupyter notebook (this document) "stores" the values of our variables from cell to cell, so we can access "data" in the cell below to plot it. more information about plotting and line styles is available here.

In [10]:
% first, let's "pull out" time and "f" from our data matrix, so that each is a simple, nx1 (n rows by 1 column) array.
t = data(:,1); % we don't need to see it, do we? If you want to look at it, remove the semicolon.
f = data(:,2); 
%now use the "figure" and plot" commands to create a new figure, and then plot x (time) vs. y (f) on a set of axes.
figure %just call this to create a new figure
plot(t,f,'k-x') %this command tells Octave to plot f vs. t in black with x at each data point and a line connecting them (color codes available at the link above)
xlabel('Time (s)') % a proper plot has x and y axes labeled!
ylabel('f (units)')
axis([0 max(t) 0 max(f)]) % this is optional, but allows us to set the scale of the plot. Format is axes([ min_x max_x min_y max_y])

Because we often want to make comparisons between predictions and data in MATLAB/Octave, we often need to plot more than one thing on one figure. This is shown below.

In [11]:
% consider that, in addition to plotting "f" above, we want to plot "g," which is a second array of values we create using an EQUATION
% that represents g(t). We will use MATLAB to implement this function and plot its results on top of "f"
% recall that 'data' and 't' should still be defined from when we executed the cells above. If they are not, we will see a descriptive error message. 

% let's define 'g' as our function of time. note that element-wise multiplication and power operations (raising each element to a power, for instance) require a period before the operator symbol.
g = -1000 * (0.005.*(t-2).^2) + 1000; % also note the parentheses here to make the order of operations very explicit. 

%now plot g and f both versus time.
figure
plot(t,data(:,2),'k-x',t,g,'r')
xlabel('Time (s)')
ylabel('output')
%note the new command here, which produces a LEGEND telling us which color is which thing.
legend('f','g')

Internal Validity of Input-Output Differential Equation Models

So far in this course, we have been assessing internal validity using the following tools:

  1. Check that the form of the model is appropriate given our system scope.
  2. Check the signs of all terms in the differential equation to ensure that the system reaches a steady state (dependent variable reaches a constant value as $t\rightarrow \infty$).
  3. Compute the model's steady state value by setting derivatives of the dependent variable equal to 0 to confirm that it meets expectations.
  4. Check the units of each term in the model.

For question 1, we have been asking "Is my model a differential equation, and should it be?" Recall that it "should be" if the system stores energy. The same reasoning applies for higher-order input-output differential equation models. You can further confirm that the number of derivatives in your model is equal to the number of independent energy storing elements in your scope.

For question 2, things get a little more complicated for systems where $n>1$. For systems with $n=2$, we can still check whether the model reaches a steady state by ensuring that all terms multiplied by our dependent variable $y$ on the right-hand side are $<0$, which tells us that the system's energy will decrease more rapidly as the dependent variable (and its first derivative) increase. HOWEVER, the situation is much more complicated for systems where $n>2$, and we do not have (and will not learn) the tools for checking the stability of systems with order greater than 2 in this course. You will learn these tools in your differential equations course.

For question 3, our process is to perform dimensional analysis on each term in your differential equation to confirm that both sides of the equals sign have the same units, and that terms that are added or subtracted have consistent units as well.

Internal Validity for State Space Differential Equation Models

We will use the same steps here as we used above for input-output models. However, determining whether our system will reach a steady state is possibly even more difficult for a state space model of higher order. This is because of the coupling between the equations. Steps 2 and 3 are thus much more difficult, and you are not expected to be able to perform this step for higher-order models in ES103.

Simulating Second Order Differential Equations in Input-Output Form Using Euler Integration

To simulate a second order differential equation using Euler integration, consider how we thought of Euler integration in Reading 6. Computing the integral of a function was visualized as a process of repeated linear extrapolation over small timesteps.

If we consider a system model that is a second order input-output differential equation that takes the form:

$$\ddot{y} = f(\dot{y},y,u)$$

where $u$ is our system's input (source of power from outside of our scope), $y$ is our system's output (dependent variable), and "$f$" represents our model equation relating $\ddot{y}$ to $\dot{y}$ and $y$ and $u$, numerically integrating our function for $\ddot{y}$ could be used to produce an estimate of $\dot{y}$. Then, numerically integrating $\dot{y}$ one more time could be used to produce an estimate of $y$.

This process of integrating $\ddot{y}$ once, then another time, to produce our final estimate of our model's output is attractive, and could be represented by the figure below, in which $\ddot{y}(k-1)$ is used to extrapolate an estimate for $\dot{y}$, and $\dot{y}(k-1)$ is used to extrapolate an estimate for $y(k)$.

image-2.png

The difficulty with this approach is that $\ddot{y}$ depends on our last estimate of $\dot{y}$, $\dot{y}(k-1)$ as well as our last estimate of $y$, $y(k-1)$ and our last input $u(k-1)$. This means that the two integration operations have to occur in the same loop. The structure of such a loop can be summarized as follows, where yd represents $\dot{y}$ and ydd represents $\ddot{y}$:

for k=2:length(t)
    % compute second derivative of output based on model equation, represented here by "f."
    ydd(k-1) = f(yd(k-1),y(k-1),u(k-1));
    % now extrapolate once to get our new estimate of the first derivative of y
    yd(k) = yd(k-1) + (t(k)-t(k-1))*ydd(k-1);
    % now extrapolate a second time to get our new estimate of y itself.
    y(k) = y(k-1) + (t(k)-t(k-1))*yd(k-1);
end

Notice that we are are not using the new estimate of $\dot{y}$ in the second integration! See the figure above to see why-- we are calculating the slope of each function one timestep behind where we would like to predict to.

Also note that for this approach to work, an initial condition for $y$ is needed along with an initial condition for $\dot{y}$ so that the values y(1) and yd(1) are known, and can be used as the starting point for extrapolation on the first iteration of the loop.