Latest / Mechanical Engineering Made Simple / (#122) The Engineering Bridge. Power, The Universal Language of State Variables.
Transcript
- 0:00Welcome back design junkies to Mechanical Engineering Made
- 0:02Simple. If the podcast brings you value
- 0:05help, support the show with a like a follow or leave a comment
- 0:08below. Always appreciate the support,
- 0:10yeah. So, you know, usually when we
- 0:12talk about engineering with the general public, there is this,
- 0:15well, this prevailing expectation of absolute
- 0:18infallible precision. Cool for sure.
- 0:20It's treated almost like a medical diagnosis.
- 0:22Exactly like you break your arm right?
- 0:25The X-ray shows that jagged white line on the bone and the
- 0:28doctor just points at it and says there it is.
- 0:30That is the problem. Right, it's viewed as completely
- 0:32binary. The bone is either broken or it
- 0:35is not broken. It's just a clean, observable
- 0:38fact. And I mean, it is incredibly
- 0:40comforting to think that way. As human beings, we like things
- 0:43to be visible. We like them to be perfectly
- 0:45categorized. It makes us feel safe.
- 0:47Yeah, exactly. We want to believe that when we
- 0:49sit down to design A complex machine like a drone or a car
- 0:53suspension or a rocket nozzle, the mathematics will just give
- 0:56us this absolute infallible blueprint that perfectly mirrors
- 1:00reality. Which is a nice thought.
- 1:03But then you step into the actual physical world of dynamic
- 1:06systems. You step into this chaotic real
- 1:09world mess of mechanical, electrical and fluid engineering
- 1:14and suddenly, well, that X-ray machine is broken.
- 1:17The blueprint lies to you. It totally lies.
- 1:19We are looking at a design landscape that is, to put it
- 1:22bluntly, incredibly murky. It is the absolute definition of
- 1:26diagnostic Muddy Waters. And you know, that is exactly
- 1:30why we are pulling from a incredibly comprehensive manual
- 1:34for today's deep dive. Right, the manual on
- 1:36mathematical models. Yeah, mathematical daughters of
- 1:39dynamic physical systems. It is a dense, rigorous, and I
- 1:44mean completely essential breakdown of how we actually
- 1:47model systems that move, change and react overtime.
- 1:50Because if you don't understand the modeling, you really don't
- 1:51understand the system. Exactly.
- 1:53OK, so let's unpack this right out of the gate because our
- 1:55mission for you today listening to this is exploring the
- 1:58ultimate pain point in mechanical engineering.
- 2:00The nightmare scenario. Right, the nightmare scenario,
- 2:03building physical systems that just vibrate to pieces or
- 2:06overheat or simply fail the very second they leave the CAD
- 2:11software and enter the physical world.
- 2:13Which happens way more often than people think.
- 2:15All the time. And why does this happen?
- 2:17Usually it's because the mathematical models driving the
- 2:20design were completely misunderstood from day one.
- 2:23From the very beginning, yeah. So today we aren't just
- 2:25memorizing equations, we are breaking down the massive
- 2:28misconceptions that screw up designs.
- 2:30We're going to walk through step by step fixes.
- 2:32And we are showing how to actually optimize a system
- 2:35before you spend a single cent on physical prototypes.
- 2:38And what's really fascinating here is the sheer cost of
- 2:41ignoring this foundational step. I mean, formulating mathematical
- 2:46models of dynamic systems isn't just some academic exercise that
- 2:49your professors force you to do. It feels like it when you're in
- 2:52school though. Oh.
- 2:53Definitely, but in the real world, mathematical modeling is
- 2:56significantly less costly, incredibly less dangerous, and
- 3:01fundamentally faster than building real world test rigs.
- 3:04I mean, a good model let's you answer what if questions that
- 3:07current technology might not even be able to realize yet.
- 3:10Exactly. You can test a spacecraft's
- 3:13thermal limits as it reenters the atmosphere.
- 3:15Without ever launching a rocket. Right, You can test a
- 3:18submarine's crushed depth without drowning a crew.
- 3:21Yeah, but the cat? The massive, unforgiving catch
- 3:24is that you have to model it correctly.
- 3:26And here is where we hit the very first trap that ruins so
- 3:30many projects. I like to call it the Build it
- 3:32first trap mixed heavily with the simplicity misconception.
- 3:37Oh, the simplicity misconception is a big one.
- 3:39It's a massive real world issue. Engineers, especially, you know,
- 3:43junior ones with access to incredibly powerful software,
- 3:47they assume that the absolute best model is always the most
- 3:50precise, most complex 1 you can possibly create.
- 3:54You see this all the time. They just throw every single
- 3:56variable into the simulation. Right, they are modeling the
- 3:59wind resistance, the micro friction of a single ball
- 4:02bearing the ambient humidity. Only the gravitational pull of
- 4:05the moon too. Literally.
- 4:07And they assume that because it is complex, it is good
- 4:09engineering. But if we connect this to the
- 4:11bigger picture, that instinct is completely backward.
- 4:16I mean it fundamentally misunderstands the purpose of a
- 4:18model. Oh so.
- 4:19Well, this brings us to the core modeling trade off, fidelity
- 4:23versus effort. A highly complex model requires
- 4:260 assumptions, right? It attempts to map reality
- 4:30almost perfect. Which sounds good on paper.
- 4:32It does, but here is the problem.
- 4:35A model that complex cannot be solved analytically.
- 4:39The math just becomes too tangled, too non linear, too
- 4:42heavy. So the computer just chokes on
- 4:44it. Exactly.
- 4:44It must be simulated experimentally by a computer,
- 4:47which takes enormous computing power, endless time, and
- 4:50honestly, it introduces entirely new avenues for digital errors.
- 4:54Because the actual best engineering model is not the
- 4:56most precise 1. The best model is simply the
- 4:59most basic, simple model that yields the exact information you
- 5:03need to make a specific design decision.
- 5:05I want to make sure you, the listener, really internalize
- 5:08this, because what does this actually mean for your workflow?
- 5:11It means you have to adopt A strict iterative loop.
- 5:14OK, step one. Step 1.
- 5:17You start by formulating A drastically simplified
- 5:20mathematical model. Keep it super simple.
- 5:22Right, Step 2, you translate that simple model to computer
- 5:26code. Step three, you simplify and
- 5:30linearize it even further to understand its core behavior.
- 5:34Wait. Further.
- 5:35Yeah, strip it down. Then Step 4, you analyze that
- 5:40model and then and only then do you simulate a slightly more
- 5:44complex version to test alternative designs.
- 5:47And finally you implement the control system.
- 5:49You got it. That's the loop.
- 5:51But wait, let me push back on this because I can hear the
- 5:53skeptics right now. Isn't engineering supposed to be
- 5:55an exact science? People love to say that.
- 5:57Right. If you build a quote UN quote
- 5:59simple model of a car suspension, let's when you
- 6:02intentionally ignore the complex friction of the rubber seals
- 6:05inside the shock absorber, aren't you just lying to
- 6:08yourself about how the car actually drives?
- 6:10That's a fairpoint. I mean, if you ignore reality,
- 6:13won't reality bite you when you actually build the car?
- 6:15It raises an important question, but no, you aren't lying to
- 6:18yourself. You are isolating the variables
- 6:21that actually matter for the specific problem you were trying
- 6:24to solve right now. OK, give me an example.
- 6:27Think about the car suspension you just mentioned if your
- 6:30immediate goal is simply to determine the required spring
- 6:33stiffness to keep the car's chassis from bottoming out when
- 6:36it hits a standard speed bump at 30 mph.
- 6:39Just a standard suspension check.
- 6:41Right. You absolutely do not need to
- 6:43model the thermal expansion of the damper fluid over a four
- 6:47hour road trip. The thermal expansion is real.
- 6:51Yes, the rubber seal friction is real, but their impact on the
- 6:54specific question of will the car bottom out on this bump is
- 6:58mathematically negligible. So they just don't matter for
- 7:02that specific test. Exactly.
- 7:04You add complexity only when the simple model fails to answer the
- 7:07question, or you know when you move to the next phase of design
- 7:10where thermal dynamics actually matter.
- 7:13OK, that makes perfect sense. You strip away the noise to see
- 7:15the signal. But to build these simple models
- 7:18without getting completely lost in the math, you really need a
- 7:22universal language. You absolutely do.
- 7:24Because let's face it, if you look under the hood of an
- 7:26electric vehicle today, modern systems aren't just mechanical
- 7:30anymore. They aren't just simple gears
- 7:32and levers. No, not at all.
- 7:34They are an absolute multi domain mess.
- 7:38Modern engineering is completely mechatronic.
- 7:41You are dealing with systems that are part mechanical, part
- 7:44electrical, part fluid, and part thermal, and they're all
- 7:47interacting simultaneously. Which sounds like a nightmare
- 7:50for the math. It is if you treat each domain
- 7:53with completely different math, like if your Mechanical
- 7:56Engineers are using one set of equations and your electrical
- 7:59engineers are using another. And your fluid dynamicists are
- 8:01off in their own world using a third set.
- 8:03Exactly. You create these massive,
- 8:06paralyzing bottlenecks in your design process.
- 8:09Because nobody can actually talk to each other.
- 8:12The electrical guy says the battery voltage is dropping and
- 8:15the mechanical guy says the motor torque is failing and they
- 8:17literally can't mathematically link the two in a single
- 8:21equation. Precisely, and the elegant
- 8:23solution to this multi domain mess is to unify the physics
- 8:26entirely using something called ideal elements.
- 8:30Ideal elements. OK, let's get into this.
- 8:32So in system dynamics, we can boil almost all of physical
- 8:35reality down to two primary physical variables.
- 8:38We call them through variables which we denote as F and across
- 8:41variables, which we denote as V. OK, let's slow down and really
- 8:45define these, because this is basically the Rosetta Stone for
- 8:48understanding complex engineering.
- 8:50It really is. Through variables are exactly
- 8:53what they sound like. They are quantities that are
- 8:56physically transmitted through an element, right?
- 8:59Like if I push on a spring, the mechanical force transmitted
- 9:02through that spring is a through variable.
- 9:04In an electrical circuit, the current flowing through a wire
- 9:07or a resistor is a through variable.
- 9:09And in a hydraulic system, the volume of fluid flowing through
- 9:13a pipe is a through variable. In a thermal system, the heat
- 9:18flowing through a conductor also a through variable.
- 9:21So that's the F and then we have the across variables, the V.
- 9:24Right, these are the differences measured across the terminals or
- 9:27the boundaries of the element. So if you have a mechanical
- 9:29damper, the velocity difference between the top of the damper
- 9:32and the bottom of the damper is your across variable.
- 9:35Yes, and in an electrical system it would be the voltage
- 9:38difference across the batteries, positive and negative terminals.
- 9:41OK. And for fluid?
- 9:42In a fluid system, the pressure drop from the entrance of a pipe
- 9:45to the exit is the across variable, and in a thermal
- 9:49system it's the temperature difference across an insulated
- 9:51wall. Here is where it gets absolutely
- 9:54incredible for me. Power, like the actual tangible
- 9:58flow of energy into an element, is universally defined across
- 10:02all these domains using these exact 2 variables.
- 10:05It's beautifully simple. Power is simply the product of
- 10:08the through variable and the across variable.
- 10:10You can read the universal equation as power equals F
- 10:14multiplied by the difference between V2 and V1 exactly.
- 10:17It literally does not matter if you are designing a mechanical
- 10:20gear train, an electrical circuit, or a hydraulic press.
- 10:24The math for power is identical. Which is incredibly elegant.
- 10:28It means a mechanical engineer and an electrical engineer are
- 10:31actually speaking the exact same language, just using different
- 10:34physical mediums. And using these unified
- 10:36variables, we can categorize all passive energy elements in the
- 10:40universe into three specific types.
- 10:42OK, what's the first one? 1st we have T type elements or
- 10:45inductive storage elements. These are components that store
- 10:48energy based on the through variable.
- 10:51Like what? Think of mechanical spring
- 10:53storing force, or electrical inductance storing current in
- 10:56the magnetic field, or fluid inertance storing momentum in a
- 10:59moving column of water. OK, so T type elements bank
- 11:03energy based on what is flowing through them.
- 11:05What is the second type? 2nd is a type elements or
- 11:08capacitive storage elements. These store energy by virtue of
- 11:13the across variable. So measuring across the
- 11:15boundaries. Right.
- 11:17This includes physical mechanical masses storing
- 11:19kinetic energy due to a velocity difference, electrical
- 11:22capacitance storing charge due to a voltage difference.
- 11:25Fluid capacitance, like a water tank storing energy due to
- 11:28pressure. Exactly, and thermal capacitance
- 11:30storing heat. But there is a very critical
- 11:32note here. For mechanical systems a mass
- 11:36must always be referenced to an inertial non accelerating frame.
- 11:41Meaning it's zero velocity reference is the ground.
- 11:44Yes. Right, because you can't measure
- 11:46the kinetic energy of a moving mass without knowing what it's
- 11:49moving relative to. I mean, if I'm holding a bowling
- 11:51ball on a moving train, the ball's kinetic energy relative
- 11:54to me is 0. But relative to the ground
- 11:57outside, it's massive. Exactly.
- 12:00You have to anchor the across variable to a non moving ground.
- 12:04That's a great way to picture. It and then we have the third
- 12:06type, the D type elements. These are the dissipators.
- 12:08Right, they don't store energy at all, they destroy it.
- 12:10Well technically they burn it off as heat.
- 12:12So mechanical bampers, electrical resistors, fluid
- 12:16friction in a pipe. Yeah, power always flows into AD
- 12:20type element. It never, ever gives power back
- 12:22to the system. A spring will bounce back, a
- 12:25capacitor will discharge, but a resistor just gets hot.
- 12:29Exactly, and beyond those 3 passive storage and dissipation
- 12:33elements, we also have multi port elements that connect
- 12:35different parts of a system together.
- 12:37Like Transformers? Right Transformers like
- 12:39mechanical levers, gear trains or electrical Transformers.
- 12:42They scale the variables up or down while maintaining power.
- 12:46And gyrator. Gyrators like gyroscopes or
- 12:48certain electrical components, they cross length of variables.
- 12:51They actually link a cross variable at one port to a
- 12:54through variable at the other. Oh.
- 12:55That's. Wild And finally transducers
- 12:58like an electric motor, which literally convert energy from
- 13:01one physical medium, like electrical current directly into
- 13:06another, like mechanical rotation.
- 13:07I feel like this is such a massive unlock for anyone
- 13:10listening who struggles to conceptualize different fields
- 13:13of engineering. It really bridges the gap.
- 13:15If you are struggling with a complex fluid piping system, you
- 13:18can literally draw it out and look at it like an electrical
- 13:21circuit. Water flow is your electrical
- 13:24current. That's the through variable.
- 13:26The pressure drop in the water is your voltage.
- 13:29That's the across variable. A narrow section of pipe is just
- 13:32a resistor. A large water storage tank is
- 13:35just a capacitor. They speak the exact same
- 13:38mathematical language. That is the beauty of ideal
- 13:41elements. You can translate any physical
- 13:44system into a unified network. But, and this is big, but,
- 13:48knowing the individual elements is only half the battle.
- 13:50Right, you have to actually wire them up.
- 13:52Now that you have these unified pieces, you have to connect them
- 13:55together to build a complete system without breaking the
- 13:58fundamental laws of physics. Which brings us seamlessly into
- 14:01the problem of wiring the system together and trying to escape
- 14:04what I like to call the infamous black box of engineering.
- 14:07Oh, the black box. Yeah, system structure and
- 14:10interconnection are governed by two vital unbreakable laws. 1st
- 14:14we have continuity equations. What do those say?
- 14:17This law states that the algebraic sum of all through
- 14:22variables entering any specific node or junction in your system
- 14:25must equal 0. So in classical mechanics, this
- 14:28is dynamic equilibrium, or basically Newton's laws of
- 14:32motion. Right.
- 14:33And in electronics, it's Kirchhoff's current law.
- 14:35The logic is simple. You cannot magically create or
- 14:38destroy force, current or fluid at a junction.
- 14:42What flows in must flow out. So if three pipes meet at a
- 14:46joint, the gallons per minute flowing into the joint must
- 14:49perfectly match the gallons per minute flowing out.
- 14:51The note itself can't store water.
- 14:53Exactly. And what is the second law?
- 14:55The second law deals with the compatibility equations.
- 14:57Right. This states that the algebraic
- 14:59sum of the remains across variable differences around any
- 15:03closed path or loop in the system must equal 0.
- 15:06OK, break that down. It simply means that distance or
- 15:09voltage or pressure is a scalar quantity tied to physical space.
- 15:13If you start at one specific point in your system, trace a
- 15:15path around a loop through various components, and come
- 15:17back to the exact same starting point.
- 15:19Your net change has to be 0. Your net change in elevation, or
- 15:23your net change in voltage, or your net change in pressure
- 15:26absolutely has to be 0. Because you can't walk around a
- 15:29staircase in a square and somehow end up higher than where
- 15:32you started unless you're in some MCS you're painting.
- 15:34Exactly. OK, so you have your TA and D
- 15:37components. You have your node and loop
- 15:39equations based on continuity and compatibility.
- 15:43Sit down and you start doing the math.
- 15:45And this is where it usually goes off the rails.
- 15:46Yes, this is the massive pain point engineers run into.
- 15:51For decades, engineers relied entirely on the classic input
- 15:55output form the IO form. They treat the entire system
- 15:59like a mysterious black box. Right where an input goes in,
- 16:03some mathematical magic happens inside the box and an output
- 16:06comes out governed by some terrifying massive NTH order
- 16:09differential equation. The black box approach is
- 16:11honestly a relic of classical control theory.
- 16:15It works for very simple things, but it fundamentally hides the
- 16:18internal reality of your system. So how do we optimize this?
- 16:22What's the modern approach? The optimization here, the way
- 16:25modern engineering is actually done, is moving entirely to the
- 16:28state variable form. State variable form.
- 16:32Yeah, instead of writing one massive, unwieldy equation
- 16:35linking the input to the output, modern control analysis breaks
- 16:39the system down into a set of state variables.
- 16:41Which we label as X1X2 up to XN. Right, and these variables
- 16:46represent the absolute minimum number of independent variables
- 16:49needed to define the total energy state of the system at
- 16:53any given moment in time. OK, I need to act as the
- 16:55surrogate for the audience here, because if we just start
- 16:58throwing around terms like state variables and vector matrices,
- 17:02eyes are going to glaze over. Fair enough, Let's ground it.
- 17:05Let's make this highly visual and step by step.
- 17:07If I'm building a drone, how do I actually find the state
- 17:11variables? What do I look for?
- 17:13It is actually beautifully intuitive once you know what to
- 17:15look for. You derive the natural state
- 17:17variables by simply counting your independent energy storage
- 17:20elements. Wait, that's it.
- 17:21That's it. Remember the T type and A type
- 17:23elements? We just talked about the.
- 17:24Springs, the masses, the capacitors.
- 17:27Exactly. For every independent T type
- 17:30storage element, like a spring in your drones landing gear, you
- 17:33write one equation for its shoe. It's your variable of the force.
- 17:37OK, For every independent A type storage element like the
- 17:40physical mass of the drone itself, you write one equation
- 17:43for it's together cross variable, its velocity.
- 17:46Chances. Link those up.
- 17:47You solve your continuity and compatibility equations to link
- 17:50them all together, and you formulate the entire system into
- 17:53a compact, standardized set of vector matrices, known
- 17:57universally as the ABC and D matrices.
- 18:00Whoa, back up right there. I know what a matrix is in
- 18:03standard Mat. It's basically an array of
- 18:04numbers, right? But when you say ABC and D
- 18:07matrices in this context, what are these four specific boxes
- 18:11actually doing? Like if I'm looking at the code
- 18:13for my drone, what goes into the A matrix versus the B matrix?
- 18:17That is a crucial distinction. The A matrix is the system
- 18:20matrix. It defines the internal physics
- 18:23of the drone itself, completely independent of the outside
- 18:25world. So it's just the drone's body?
- 18:27Yes, it maps how the drone's mass interacts with its own
- 18:32structural stiffness and damping.
- 18:34If you drop the drone out of the sky with no motors running, the
- 18:37A matrix dictates how it falls and flexes.
- 18:40Got it. And the B matrix.
- 18:41The B matrix is the input matrix.
- 18:44It maps how your steering controls your motor thrust.
- 18:47Actually connect to and influence that internal physics.
- 18:51So A is the physical body and B is the nervous system connecting
- 18:55the muscles to the body. Exactly.
- 18:56What about C&D? The C matrix is the output
- 18:59matrix. It defines what your sensors can
- 19:01actually see. Like the camera or the GPS?
- 19:04Right. You might have a complex A
- 19:05matrix with 20 internal states, but if you only have Agps and an
- 19:09altimeter on board, your C matrix maps those 20 states down
- 19:13to just position and height. That makes total sense.
- 19:15And the D matrix. Finally, the D matrix is the
- 19:18feed forward matrix. It represents a direct bypass
- 19:21where the input instantly affects the output without going
- 19:24through the physical state dynamics first.
- 19:26Which sounds rare. It is in most mechanical systems
- 19:29the D matrix is just 0. OK, that makes it incredibly
- 19:32clear. But I have to play devil's
- 19:34advocate here for a second. Go for it.
- 19:36Why should a practical hands on engineer care about setting up
- 19:41these four state variable matrices?
- 19:43It's. A common question.
- 19:45I mean, if the classical black box transfer function tells me
- 19:48that when I push the gas pedal down one inch the car goes
- 19:51forward at 20 miles an hour, why do I need to know the internal
- 19:55energy state of the transmission gears?
- 19:57The car moves, the client is happy.
- 20:00Why do the matrices matter? Because if you don't know the
- 20:03internal state, the system's behavior over time will
- 20:07completely blind side you. Blind side me how?
- 20:10Let's use your car example. Your black box equation simply
- 20:13says gas pedal input equals forward motion output.
- 20:16That's all it sees, right? But what if internally your
- 20:20transmission is absorbing massive amounts of kinetic
- 20:22energy and heating up due to friction?
- 20:24Oh man. The black box doesn't see the
- 20:26heat, It doesn't track like the energy stored in the
- 20:28transmission fluid. It just tells you the car is
- 20:31moving right up until the moment the transmission suddenly
- 20:34shatters into 1000 pieces on the highway.
- 20:38State variables track every single pool of energy in the
- 20:41system simultaneously. They tell you not just what the
- 20:44output is doing, but whether the internal components are secretly
- 20:48ripping themselves apart. That is a terrifying thought.
- 20:51The black box is basically driving blindfolded, just
- 20:53waiting to hit a wall. And that perfectly transitions
- 20:57us into the absolute nightmare of the time domain.
- 20:59Because things don't just break instantly, they break over time.
- 21:02Energy builds up, oscillates and tears things apart.
- 21:05Exactly. But analyzing systems purely in
- 21:08the time domain using raw differential equations is
- 21:11incredibly painful. The math gets nasty.
- 21:13Very nasty. If you try to calculate how a
- 21:15mass bounces on a spring over 10 seconds using basic calculus,
- 21:19the math is horrific. So to deal with these time
- 21:22domain terrors, engineers use transform methods, specifically
- 21:26the Laplace transform. The famous Laplace transform.
- 21:29Right. The Laplace transform takes
- 21:31these horrific tangled differential equations and turns
- 21:34them into simple manageable algebra by moving the problem
- 21:38out of the time domain into the complex frequency domain.
- 21:41You know, I always like to explain the Laplace transform
- 21:43visually. Well, let's hear it.
- 21:45It is like trying to untangle a massive knotted ball of yarn.
- 21:49That's your time domain differential equation.
- 21:52If you try to pull at the threads with raw calculus, it
- 21:55just gets tighter and more tangled.
- 21:56It really does. But a Laplace transform is like
- 21:58dropping that knotted ball into a magical chemical bath.
- 22:02The bath dissolves the knots entirely and you are left with
- 22:06straight parallel strings. I like that.
- 22:09You do simple addition and subtraction on those straight
- 22:11strings. That's the complex frequency
- 22:13domain algebra. And when you're done, you
- 22:15reverse the chemical process, pull the yarn out, and the math
- 22:18is solved. Exactly.
- 22:20The output relies entirely on the system's transfer function,
- 22:23which we denote as H of S. That's a perfect analogy.
- 22:26The Laplace transform untangles the dynamic behavior.
- 22:29It really does. And when we look at how a system
- 22:32actually responds to a test input, like an impulse strike, a
- 22:36sudden step input, or a steady ramp up in force, we are really
- 22:39looking at 2 distinct phases of behavior.
- 22:41What's the first phase? 1st is the transient response,
- 22:44which is the initial, often chaotic reaction right after the
- 22:47system is disturbed. Like the immediate bounce?
- 22:51Right second is the steady state response, which is how the
- 22:54system behaves after the initial chaos settles down.
- 22:57So let's isolate these and look at 1st order systems first.
- 23:01These are the simplest dynamic systems.
- 23:03Very simple. They only have one energy
- 23:05storage element, like a single mass sliding on a frictionless
- 23:08surface or a single capacitor charging.
- 23:11Because there's only one storage element, energy can't bounce
- 23:14back and forth. Exactly.
- 23:16The system's speed is governed by a single parameter called the
- 23:19time constant, which we denote with the Greek letter Tau.
- 23:22So what is the golden rule for engineers dealing with a first
- 23:26order system? The Golden Rule is incredibly
- 23:29practical. After four time constant the
- 23:32four times the value of Tau, the system has reached roughly 98%
- 23:37of its final steady state value. So it's basically done moving.
- 23:40For all practical engineering purposes, we consider it
- 23:43completely settled. It doesn't bounce, it doesn't
- 23:45overshoot, it is just a smooth exponential curve flattening
- 23:48out. But things get violently crazy
- 23:50when we step up to 2nd order systems.
- 23:52Oh yeah, they do. This is where you have two
- 23:54energy storage elements trading energy back and forth like a
- 23:57physical mass bouncing on a physical spring.
- 24:00The spring pushes the mass. The mass gains kinetic energy.
- 24:03It overshoots, stretches the spring, and the spring pulls it
- 24:06back. Now the system's behavior is
- 24:08governed by two entirely new parameters, the damping ratio,
- 24:12called Zeta, and the natural frequency, called Omega N.
- 24:15And this is exactly where physical systems vibrate to
- 24:18pieces. The value of the damping ratio
- 24:20Zeta dictates absolutely everything about the system's
- 24:23survival. OK, let's walk through the Zeta
- 24:26values. If Zeta is greater than one, the
- 24:28system is what we call over. Damped, it is sluggish.
- 24:31Sluggish like what? Imagine a door closer filled
- 24:34with thick molasses. It's slowly, painfully creeps
- 24:37toward the closed position without ever slamming or
- 24:40bouncing past the frame. Safe but slow.
- 24:42Right now, if Zeta is exactly 1, it is critically damped.
- 24:46I always say a critically damped system is like the perfect high
- 24:50end kitchen drawer. You shove it as hard as you can
- 24:53and it glides inward incredibly fast, but it stops exactly at
- 24:56the of the rail without slamming, clicking, or bouncing
- 24:59back even a millimeter. Yes, exactly.
- 25:02It is the theoretical ideal for a vast majority of mechanisms
- 25:06where you want speed without overshoot.
- 25:07But what if Zeta drops too low? If Zeta drops below 1, if it's
- 25:11between zero and one, the system is under damped.
- 25:14It moves fast, but it overshoots the target, bounces back and
- 25:18oscillates before eventually settling down.
- 25:20Like a car with bad shocks going over a speed bump, it just keeps
- 25:23floating up and down. Exactly.
- 25:24And if Zeta equals exactly 0, you have no damping at all.
- 25:28You have pure harmonic oscillation.
- 25:31The system will literally bounce back and forth forever.
- 25:33It never settles. And here is where it gets really
- 25:36interesting. On the mathematical side, this
- 25:38real world bouncing, this physical oscillation, is
- 25:41dictated mathematically by the location of complex poles in
- 25:44this plane. Yes, when you saw the
- 25:46denominator of your transfer function, the roots of that
- 25:49characteristic equation are called the poles.
- 25:51OK, the poles. If you plot these poles on a
- 25:54graph called the Complex set Plane, their physical location
- 25:57on the paper completely dictates whether the system will
- 26:01peacefully settle or vibrate itself to pieces.
- 26:04So how do you read the graph? The X axis is real numbers, the
- 26:07axis is imaginary numbers. If your poles sit purely on the
- 26:11real axis, you get that smooth, sluggish, over damped response.
- 26:16But if the poles migrate off the real axis and become complex
- 26:19numbers with imaginary parts, that means the system is going
- 26:23to oscillate. The imaginary part of the math
- 26:25literally translates to physical vibration in the real world,
- 26:28that is mind. Blowing it is, and the closer
- 26:31those poles get to the vertical imaginary axis, the more
- 26:34violently and endlessly the system vibrates.
- 26:36What if they cross it? If the poles crossover to the
- 26:39right half of the blame, the system is fundamentally
- 26:41unstable. It doesn't just vibrate.
- 26:43The vibrations grow exponentially until the system
- 26:45destroys itself. Like the Tacoma Narrows Bridge?
- 26:48Yes. Think of that famous footage of
- 26:50the bridge twisting in the wind until it collapsed.
- 26:53That is a system where the poles moved into the unstable region.
- 26:56And what about the zeros? We talked about the roots of the
- 26:59denominator being the poles. What do the roots of the
- 27:02numerator do? Zeros are fascinating.
- 27:05While poles dictate the underlying stability and
- 27:08vibration, A0 acts as an anticipator of the input.
- 27:12It anticipates. Yes, because a 0 mathematically
- 27:16introduces a derivative of the input into the system.
- 27:19It is essentially sensing the rate of change of the input
- 27:22before the full input even arrives.
- 27:24It's looking at the slope. Exactly.
- 27:26This drastically speeds up the response time of the system,
- 27:29acting almost like a predictive filter, though it can also cause
- 27:32a much larger initial overshoot because it reacts to
- 27:35aggressively. So to recap for the listener,
- 27:37holes cause the system to drag, bounce or explode, and zeros try
- 27:41to predict the future to speed things up.
- 27:43That's a great summary. But up until now, we've only
- 27:46been talking about how a system reacts to a single sudden event,
- 27:50like hitting a speed bump. Right, isolated events.
- 27:52But systems don't just experience simple clean step
- 27:56inputs. In the real world, engines
- 27:59vibrate continuously at high RPMS, Wind howls periodically.
- 28:03An airplane wing is constantly buffeted.
- 28:05We have to look at constant rhythmic noise.
- 28:08We do, and that brings us naturally to how we optimize
- 28:11these systems in practice using frequency response and
- 28:14bandwidth. OK, let's breakdown frequency
- 28:16response. Frequency response is
- 28:18essentially asking how does your system behave in the steady
- 28:21state when you feed it a continuous, never ending
- 28:25sinusoidal input. Like a constant vibration from a
- 28:27motor. Exactly what is absolutely
- 28:30crucial to understand here is that if your system is linear,
- 28:33feeling it a sine wave will result in an output that is the
- 28:36exact same frequency sine wave. So if I shake it at 50 Hertz.
- 28:39It will shake back at 50 Hertz. It will never magically output
- 28:4260 Hertz. The only things that change are
- 28:44the amplitude, how violent the shaking is compared to the input
- 28:47in the phase angle, how delayed the shaking is.
- 28:49To evaluate this, engineers use a visual tool called Bowed
- 28:52Plots, right? Yes, bowed plots are essential
- 28:55here. A bowed plot is split into two
- 28:57parts. On the top graph, you plot the
- 29:00magnitude ratio in decibels versus the logarithm of the
- 29:04frequency Omega. On the bottom graph you plot the
- 29:07phase angle delay versus the logarithm of Omega.
- 29:11And this step by step graphical optimization is where controls
- 29:15engineers really make their money.
- 29:18Dynamic systems act exactly like physical filters.
- 29:21Explain that. Think of a heavy mechanical
- 29:23mass. It will pass low frequencies
- 29:25through easily. If you push it slowly back and
- 29:27forth, it moves, but it will block or attenuate high
- 29:30frequencies. So if you vibrate it 10,000
- 29:33times a second. It's inertia prevents it from
- 29:35moving at all. The threshold frequency where
- 29:37this blocking begins to happen defines the system's bandwidth.
- 29:41And bandwidth is defined as the frequency range where the output
- 29:44amplitude drops no more than three decibels from its peak
- 29:47value, right? Exactly.
- 29:48So bandwidth determines the system speed of response.
- 29:51A narrow bandwidth means a sluggish system that filters out
- 29:54all the high frequencies. It just can't react fast enough.
- 29:57Right. And if you have complex periodic
- 30:00input noise, like a messy wind gust, engineers use a
- 30:04mathematical tool called a Fourier series.
- 30:07What does the Fourier series do? It breaks down that complex,
- 30:11messy real world noise into a clean stack of simple sine and
- 30:15cosine waves. Then they look at the boat plot
- 30:18to see if those specific frequencies fall inside or
- 30:21outside the system's bandwidth. But I have to ask you a serious
- 30:24question here, because it feels like there is a trap.
- 30:27There usually is. If a wider bandwidth makes a
- 30:30system react faster, track inputs more accurately, and act
- 30:33more responsively, shouldn't we as designers always optimize for
- 30:37the maximum possible bandwidth? Why not make the bandwidth as
- 30:40wide as physically possible? That's a very tempting thought.
- 30:43Or does that just open the door for high frequency garbage to
- 30:46come in and destroy the? That is the exact engineering
- 30:49trade off. Yes, an incredibly wide
- 30:51bandwidth means a fast, highly responsive system.
- 30:54A fighter jet has a much wider bandwidth than a commercial
- 30:57airliner, but it also means you are letting in absolutely
- 31:00everything. You are letting in high
- 31:01frequency sensor noise, electrical static, and
- 31:04mechanical chatter from the gears.
- 31:07If your bandwidth is too wide, your control motors will try to
- 31:10violently react to every tiny piece of random static.
- 31:14The system will jitter constantly, which leads to
- 31:17immediate mechanical wear and tear, burned out motors, or
- 31:20catastrophic instability. So you want your bandwidth just
- 31:24wide enough to capture the real intended signal and narrow
- 31:27enough to block all the high frequency garbage.
- 31:29You nailed it. Wow.
- 31:31OK, let's take a collective breath because up to now we have
- 31:35been building this beautiful, elegant mathematical castle.
- 31:39All of this magic in the Laplace transforms, untangling the yarn,
- 31:42the bowed plots, filtering the frequencies, the pristine state
- 31:46variable matrices. It all relies entirely on one
- 31:49massive, incredibly dangerous assumption.
- 31:51It relies on the assumption that the system is perfectly linear.
- 31:54And let's be honest, engineers absolutely love to assume
- 31:57systems are linear because the math is easy.
- 31:59It's so much easier if it's linear and I double the input.
- 32:03The output double S perfectly. If I push twice as hard, it goes
- 32:05twice as fast. It is a beautiful, predictable
- 32:09world. But what happens when we step
- 32:11outside the textbook? The superposition principle, the
- 32:14very bedrock of linear math, completely fails in reality.
- 32:17Exactly. Superposition states that the
- 32:19response to a large input is exactly the same shape as the
- 32:23response to a small input, just scaled up proportionally.
- 32:26But real physical components do not work that way.
- 32:29Not at all. Think about real world
- 32:31nonlinearities that plague every mechanical design.
- 32:34First, you have dead zones. Dead zones.
- 32:37This is where a small input causes absolutely 0 output.
- 32:41Think of a loose steering wheel in an old car.
- 32:43You turn the wheel a little bit left, a little bit right, and
- 32:46the car doesn't turn at all until the gears physically
- 32:48engage. The math for a dead zone is
- 32:50entirely nonlinear. Then you have backlash where
- 32:53gears clack back and forth in the housing when reversing
- 32:56direction and of course you have saturation.
- 32:58Saturation is everywhere. It is the reality that pushing
- 33:02harder doesn't give you any more output because a physical limit
- 33:04has been reached. A valve is already 100% open, a
- 33:08motor is drawing maximum current.
- 33:10Assuming linearity across the board is like assuming that if
- 33:13you can easily lift 50 lbs at the gym, you can definitely lift
- 33:17£500 just by trying 10 times harder.
- 33:19That's a painful analogy. The math seems right, but
- 33:22eventually your body hits a saturation limit.
- 33:25The physics completely change. Your spine doesn't just scale
- 33:28it's lifting capacity linearly, it physically breaks.
- 33:31And the consequence in engineering when you ignore
- 33:34these nonlinearities is the creation of limit cycles.
- 33:37Limit cycles? What are those?
- 33:38Well, in a purely linear system, a continuous oscillation depends
- 33:42entirely on how hard you initially hit the system.
- 33:45Hit it hard, it bounces big, hit it soft, it bounces small.
- 33:48But in a non linear system, these limit cycles are unique
- 33:51self-sustaining oscillations of a fixed amplitude and fixed
- 33:55period that the system will automatically fall into
- 33:57completely regardless of the initial state.
- 33:59Wait. Explain that it doesn't matter
- 34:01how hard you hit it. Exactly.
- 34:03Whether you tap the system lightly or smash it with a
- 34:05hammer, it will eventually settle into the exact same
- 34:09violent hum. The system actively hunts for
- 34:12this specific vibration and just locks into it indefinitely.
- 34:16That sounds incredibly dangerous.
- 34:17It's incredibly dangerous because a limit cycle can cause
- 34:20metal fatigue over thousands of cycles, destroying a component
- 34:24that classical linear math said was perfectly stable.
- 34:28So how do you actually fix this? If the linear math is broken by
- 34:31dead zones and saturation, and we know limit cycles are lurking
- 34:34in the dark, what do we do? We can't just throw away all the
- 34:37Laplace transforms and boat plots we just talked about.
- 34:39We don't throw them away. We have three primary
- 34:41workarounds to cheat our way through nonlinearities.
- 34:44OK, what's the first cheat? The first is linearizing
- 34:47approximations. This is the most common if we
- 34:50know a system is going to operate around a very specific
- 34:52reference trajectory. Let's say we are programming a
- 34:55drone to hover at exactly 50 feet.
- 34:58We use a mathematical tool called a Taylor series
- 35:01expansion. How does that help?
- 35:03We use the Taylor series to pretend the system is linear,
- 35:06just for very small movements around that specific 50 foot
- 35:09hover point. It works beautifully as long as
- 35:12the drone doesn't deviate too far from the hover point.
- 35:15But hold on, a drone doesn't just hover perfectly still in a
- 35:18vacuum. What if a massive gust of wind
- 35:21hits it or the pilot Yanks the joystick and the drone is flying
- 35:26wildly in aggressive banks and dives?
- 35:28You can't pretend that's linear. The Taylor series hover point is
- 35:31useless there. We have to have a way to handle
- 35:34messy high frequency large scale chaos without breaking the
- 35:38simulation. You're exactly right.
- 35:40And when the deviations are large, we move to the second fix
- 35:44describing function. This approach is incredibly
- 35:47clever. You take all the messy, ugly
- 35:49nonlinear, the dead zones, the saturation limits, the backlash,
- 35:52and you mathematically aggregate them into a single comprehensive
- 35:56block. So you just shove all the ugly
- 35:57stuff into one box. Pretty much.
- 35:59Then you feed a clean sine wave into this ugly block.
- 36:02Naturally the output is a distorted messy non sine wave.
- 36:05But here's the trick. You assume that the rest of the
- 36:08physical system acts as a natural low pass filter.
- 36:12You assume the physical inertia of the drone will strip away all
- 36:15the high frequency harmonic distortion.
- 36:18So mathematically, you simply ignore the distortion and only
- 36:23model the fundamental base frequency that survives.
- 36:27It is an approximation, but it brilliantly allows you to use
- 36:30your standard linear frequency response tools like the bowed
- 36:34plot on a highly nonlinear system.
- 36:37That is genius. You just assume reality is too
- 36:39sluggish to care about the high frequency distortion, so you
- 36:42mathematically delete it. Exactly.
- 36:43What is the third fix? The third fix is the phase plane
- 36:46method. This is a super visual approach
- 36:49for 2nd order systems. Instead of plotting A variable
- 36:51against time, which creates messy wave graphs, you ignore
- 36:54time entirely. You ignore time.
- 36:56Yes, you plot one state variable directly against another state
- 36:59variable. So like plotting the physical
- 37:01position of a pendulum on the X axis and the velocity of that
- 37:04pendulum on the Y axis. Time isn't on the graph at all.
- 37:08Exactly. This lets you track the exact
- 37:10transient response graphically as a flowing path.
- 37:13On the paper, you can literally see the system's behavioral
- 37:17energy drawn out as tracking spirals, saddles, and stable
- 37:20nodes. What does a stable node look
- 37:22like? If a system is stable and
- 37:24settling down, the graph will show a stable focus.
- 37:27It looks exactly like a spiral, drawing inward tighter and
- 37:30tighter toward the dead center 0 point.
- 37:33The energy is draining away into the center.
- 37:35Right. And if the system is trapped in
- 37:36one of those dangerous limit cycles we talked about, the
- 37:38graph will look like a solid, bold closed loop.
- 37:42No matter where you start on the graph, the trajectory line will
- 37:45get sucked into that loop and justice trace it endlessly.
- 37:48It's brilliant because you don't need to analytically solve the
- 37:51impossible differential equation, you just map where the
- 37:53energy is flowing visually exactly.
- 37:56But let's be real. Because these nonlinear
- 37:58equations are so incredibly horrific to solve by hand,
- 38:02modern engineers don't sit around drawing spirals on paper.
- 38:05They inevitably turn to digital simulation software.
- 38:08They boot up a program, build a block diagram, and hit run.
- 38:13Oh yeah, they absolutely do. And this is where the traps get
- 38:15truly, deeply digital. The computer takes over and
- 38:20engineers blindly trust it. Digital Continuous system
- 38:23simulation sounds completely foolproof.
- 38:26The computer solves the equations over successive tiny
- 38:29time steps, but the massive pain point here is that engineers
- 38:33click simulate without having any understanding of the
- 38:36integration method running under the hood of the software.
- 38:39And the result. Numerical instability.
- 38:41Right. The simulation literally blows
- 38:43up, the number shoot off to Infinity, or much, much worse,
- 38:47the software spits out a beautiful, clean graph that is
- 38:50completely, fundamentally lying to you about reality.
- 38:54To understand why the computer lies, you have to understand
- 38:56what the processor is actually doing when it simulates A
- 38:59dynamic system. OK, walk me through it.
- 39:00The computer does not know the exact smooth curve of the real
- 39:04world math. It is lined to the future.
- 39:06It only knows the exact point it is at right now and the slope of
- 39:10the math at this exact millisecond.
- 39:12So it has to guess the next point.
- 39:13And how does it guess? The simplest, most primitive
- 39:16method is the Euler method. Euler calculates the
- 39:19mathematical slope at the current moment, draws a straight
- 39:21line along that slope, steps forward in time, and places the
- 39:25next point. I always visualize this as
- 39:27walking blindfolded on a winding curved track.
- 39:30That's a good way to look at it. You stop.
- 39:32You feel with your foot that the track is curving slightly to the
- 39:35left, so you take a perfectly straight step to the left.
- 39:39But because the track is continuously curving, your
- 39:42straight step actually takes you slightly off the track.
- 39:44Exactly. That error, the gap between your
- 39:46straight step and the true curve, is what we call
- 39:49truncation error. That is exactly it, and with the
- 39:52Euler method, the truncation error is massive and it is
- 39:56highly sensitive to the size of the time step.
- 39:59If you take a giant step forward based on one quick slope
- 40:02reading, you will drift wildly off the curve.
- 40:04So Euler is out. What do we use instead?
- 40:08To fix Euler's inherent blindness, engineers developed
- 40:11Runj CUDA methods. Instead of taking one blind
- 40:14guess and stepping forward, Runj CUDA essentially probes the
- 40:17darkness ahead before committing to a step.
- 40:20Probes the darkness. The industry standard is the 4th
- 40:23order Runj CUDA method. It relies on 4 separate complex
- 40:28derivative calls per single time step.
- 40:31So looking ahead. Right.
- 40:32It checks the slope of your current position, it calculates
- 40:352 projected slopes in the middle of the proposed step, and it
- 40:38checks one projected slope at the very end of the step.
- 40:41Then it mathematically averages those 4 slopes together to
- 40:45create an incredibly accurate curved path forward.
- 40:50It vastly improves accuracy, but the trade off is brutal, isn't
- 40:53it? It takes four times as much
- 40:55computing power to calculate a single millisecond of time.
- 40:58Right. And if that is too
- 41:00computationally expensive, you have 1/3 option predictor
- 41:02corrector methods like Adam's Bashforth and Adam's molten.
- 41:06How do those work? Instead of probing blindly into
- 41:08the future with multiple slope calculations within the current
- 41:11step, these methods look backward.
- 41:13They use historical data. They look at the past few steps.
- 41:17The simulation is already taken to predict where the next step
- 41:20should naturally fall on the curve, and then they use the
- 41:23differential equation to correct that prediction slightly.
- 41:26So it's more efficient. It uses less processing power
- 41:29per step than Run Jakuda, but requires the computer to
- 41:32constantly store past data in its active memory.
- 41:35OK, so let's talk step by step optimization.
- 41:38I have my software open. I understand Euler is bad and
- 41:41Ranj Kakuta is good, but how do I choose the right step size?
- 41:46That's the $1,000,000 question. Because if I set my digital time
- 41:49step to 1 nanosecond, the straight line truncation error
- 41:53will be virtually 0, but the computer will take 3 continuous
- 41:57weeks to simulate a one minute drone flight.
- 42:00Exactly. When choosing a step size,
- 42:03you're battling 2 completely opposing types of error.
- 42:06Truncation error, as we discussed, is caused by two
- 42:08largest step size. The straight lines cut the
- 42:11corners of the real curve and the simulation drifts away from
- 42:14physical reality. To fix it, you make the step
- 42:16size smaller. But if you make it too
- 42:18microscopic, you run into round off error.
- 42:20What causes round off error? Computers only have finite
- 42:23decimal memory. A processor can only hold so
- 42:26many decimal places before it has to chop the number off.
- 42:28Oh, so just deletes the end of the fraction?
- 42:30Yes. When you simulate a system at a
- 42:33nanosecond scale, you are adding billions of microscopic numbers
- 42:37together over and over. Every single time the computer
- 42:40does the math, a tiny fraction of a decimal is rounded off and
- 42:43lost. And over time.
- 42:45Over billions of calculations, those tiny rounding errors
- 42:48accumulate, and suddenly your simulation drifts away from
- 42:51reality again, not because the math model was wrong, but
- 42:54because the computer's physical memory architecture literally
- 42:57corrupted the calculation. It's a trap on both sides.
- 43:00Step too big, you cut corners. Step too small, the computer
- 43:03corrupts itself. So what on earth do you do with
- 43:07a stiff system? Stiff systems.
- 43:10Let's say I'm modeling a rocket engine.
- 43:12One part of my machine, the spark ignition and the initial
- 43:14chemical explosion reacts in microseconds, but the thermal
- 43:18build up, the heat soaking into the massive metal rocket nozzle
- 43:22takes hours to fully develop. A classic problem.
- 43:24Do you set the step size to microseconds for the fast part
- 43:28and just wait a month for your computer to finish the hours
- 43:30long thermal calculation? That is the classic stiff system
- 43:33dilemma, and it ruins countless simulations.
- 43:36If you use a standard runch CUDA method with a step size
- 43:39microscopic enough to capture the ignition, you will waste
- 43:43endless staggering amounts of computing power on the thermal
- 43:46side. And the round off error.
- 43:48By the time you reach hour two of the simulation, the round off
- 43:51error will have completely destroyed your thermal data.
- 43:54So how do you fix it? The fix is twofold.
- 43:56First, you use variable step methods designed specifically
- 44:00for stiff systems. The software dynamically changes
- 44:03the step size on the fly. Oh.
- 44:05That's smart. It takes microscopic, incredibly
- 44:08careful steps during the violent ignition event, and then once
- 44:12the explosion stabilizes into a steady burn, the algorithm takes
- 44:15massive leaps forward in time when tracking the slow,
- 44:18predictable thermal buildup. OK, so the software adapts to
- 44:22the speed of the physics. What if the software can't
- 44:24handle it? If the fast dynamics do not
- 44:27meaningfully impact the slow dynamics over the long run,
- 44:30meaning the microsecond spark doesn't fundamentally change the
- 44:33three hour heat soak, you simply decouple them.
- 44:35You split the simulation. Yes, you strip the high
- 44:39frequency components out of the macro model entirely.
- 44:42You run one simulation just for the spark, take the final output
- 44:45of that spark and feed it as a simple static initial condition
- 44:50into a completely separate long term thermal model.
- 44:53Divide and conquer. Mind blowing.
- 44:55As if simulation wasn't tricky enough, we finally need to close
- 44:58this deep dive down by answering the two most common questions
- 45:02engineers face today when dealing with the unpredictable
- 45:05reality of the physical world. Yeah, these are the big ones.
- 45:08Question one. How do we mathematically handle
- 45:10random real world noise? The wind outside does not blow
- 45:14in a perfect sine wave. No, it certainly doesn't.
- 45:16The electrical static in your sensor wiring is not a neat step
- 45:19function. Reality is chaotic.
- 45:22Right, when variables contain random unpredictable, non
- 45:25deterministic components, we are officially dealing with
- 45:28stochastic systems. And how do we model those?
- 45:31To model stochastic systems, engineers have to completely
- 45:34abandoned their deterministic differential equations.
- 45:37You can't rug an exact equation for a gust of wind.
- 45:39Instead, we turn to probability density functions, specifically
- 45:44the zero mean Gaussian distribution.
- 45:46The classic bell curve. Exactly.
- 45:48The absolute magic of a Gaussian or normal distribution is that
- 45:52it can be completely specified by just its variance, its
- 45:55spread, and if you feed a purely Gaussian noise input into a
- 45:59linear system, the output is mathematically guaranteed to
- 46:02also be perfectly Gaussian. So it preserves it's shit.
- 46:06Yes, it makes the math incredibly predictable even when
- 46:09the input is chaotic. But how do you know if the noise
- 46:11from one second ago affects the noise right now?
- 46:14Wind isn't purely random. A gust right now usually means
- 46:17it will still be gusting a half second from now.
- 46:19For that you use the autocorrelation function.
- 46:22This is a measure of time correlation.
- 46:24It tells you exactly how strongly past values of the
- 46:27random noise affect future values.
- 46:29OK. Give me an example.
- 46:30If the noise is purely random white noise like TV static, the
- 46:35autocorrelation is 0 everywhere except at the exact present
- 46:39moment. The past does not dictate the
- 46:42future, but if the noise is a rolling wind gust, the
- 46:45autocorrelation will show a distinct sloping curve.
- 46:48And what do you do with that curve?
- 46:49You pair this autocorrelation data with power spectrum
- 46:53filtering to figure out exactly which frequencies of the random
- 46:56noise possess the most physical energy, so you can specifically
- 46:59design your drone software filter to ignore them.
- 47:02Which perfectly tease up question too, How do we actually
- 47:05integrate these continuous analog physical systems with
- 47:09modern digital computer processors?
- 47:11A huge challenge today. Computers don't think in
- 47:14continuous time. A computer processor thinks in
- 47:16discrete digital ticks. It pulses.
- 47:19This brings us to discrete and hybrid systems.
- 47:22To get continuous real world data like the pressure in a pipe
- 47:25into a digital computer, you must use uniform sampling.
- 47:29OK. So sampling at regular
- 47:30intervals. Yes, you tell the sensor to
- 47:33sample the physical variable at a set interval, say every one
- 47:36millisecond. But you must obey the
- 47:39fundamental law of digital conversion, the sampling
- 47:43theorem, also known widely as the Nyquist criterion.
- 47:46The Nyquist criterion. What is the rule?
- 47:49The sampling period must be mathematically fast enough,
- 47:52specifically greater than twice the highest frequency present in
- 47:56the signal, to capture the true physical movement.
- 47:59If you sample too slowly, you get a catastrophic error called
- 48:03aliasing. You know, aliasing is so easy to
- 48:05visualize. It is exactly like when you
- 48:07watch a car commercial on TV and the car is driving forward on
- 48:11the highway, but the wheels look like they are spinning
- 48:13backwards. Yes, the camera frame rate
- 48:15effect. The camera's frame rate, which
- 48:17is its sample rate, isn't fast enough to catch the true
- 48:20continuous rotation of the wheel.
- 48:22It only captures fragmented snapshots that trick the brain
- 48:25into seeing reverse motion. If your drones altimeter alias
- 48:29is a vibration, the computer might think the drone is falling
- 48:32when it's actually rising. The data is completely
- 48:34corrupted. Exactly.
- 48:36So that gets data into the computer safely.
- 48:38But to output data from the digital computer back out to the
- 48:41physical motors, we use something called a zero order
- 48:44hold. A zero order hold.
- 48:46Because the computer only spits out control commands at discrete
- 48:49interval, say one command every 10 milliseconds, the zero order
- 48:52hold takes that discrete number and holds a physical voltage to
- 48:56the motor absolutely constant until the very next digital
- 48:59number arrives. So it's not a smooth curve
- 49:01anymore. No, It creates A rigid staircase
- 49:04pattern of voltage inputs for the analog system to react to.
- 49:08A zero order hold is literally a strobe light in a dark room.
- 49:12It freezes continuous fluid motion into distinct, separate,
- 49:16rigid steps that a digital computer can actually comprehend
- 49:19and control. That is a brilliant way to put
- 49:21it. And to handle the mathematics of
- 49:23these discrete staircase steps, we cannot use the continuous
- 49:26Laplace transform we talked about earlier, the.
- 49:28Laplace path only works on continuous yarn.
- 49:30Exactly for digital steps, we introduced the Z transform.
- 49:34The Z transform does for discrete digital systems exactly
- 49:37what the Laplace transform does for continuous analog ones.
- 49:40So it dissolves the digital knots.
- 49:42Right, it takes discrete different equations and turns
- 49:45them into manageable algebra, allowing us to build pulse
- 49:48transfer functions to perfectly control complex computer driven
- 49:53robotics. Wow, that is an absolutely
- 49:55incredible amount of ground covered today.
- 49:57Think about what we just did. We covered a lot.
- 49:59We took a chaotic physical system.
- 50:01We idealized it into universal TA&D components.
- 50:05We mapped the energy flow using state variable matrices.
- 50:09We untangled the math by bringing it into the time and
- 50:12frequency domains using Laplace transforms and Bode plots.
- 50:15We shatter the dangerous illusion of linearity.
- 50:18We navigated the hidden integration traps of computer
- 50:21simulation, and finally we bridged the gap between the
- 50:24continuous analog world and the discrete digital brain using the
- 50:28Z transform. It is the complete holistic life
- 50:31cycle of dynamic system modeling.
- 50:33But as our digital computers get exponentially faster, as our Z
- 50:36transforms in our 4th order Ranjakuda algorithms get more
- 50:40impossibly precise, and as artificial intelligence begins
- 50:43to actually automate the formulation of these very state
- 50:46matrices for us, it leaves us with a truly provocative thought
- 50:51about the future of engineering. What's that?
- 50:54Will we eventually hit a point in our lifetimes where our
- 50:56mathematical models achieve such perfect God like sidelity that
- 51:01physical prototypes become entirely obsolete?
- 51:04Or will the stochastic chaos of the real world, the
- 51:07unpredictable friction, the uneven heat gradients in the
- 51:10stubborn random noise of reality, always demand that an
- 51:14engineer eventually has to put down the simulation, build the
- 51:17physical thing, turn it on, and watch it break?
- 51:19Man, a terrifying and strangely beautiful thought to leave off
- 51:22on. You can't truly simulate reality
- 51:24until you truly understand it, and maybe reality always has one
- 51:27last unpredictable trick up its sleeve.
- 51:30If you got something useful out of today's episode, hit follow
- 51:32and drop a like. It helps grow the show and keeps
- 51:34the engineering knowledge flowing.