Represent physical systems with models

English translation

Control Engineering I Week 2 · Concept Explanations and Exercise Guide

What is applied, and what is observed? Start with this question, express physical laws as equations, and examine the model's response in MATLAB.

After watching the video, review in this order: inputs and outputs → physical laws → model → response. Hover over or select underlined terms to see their meanings. Expand detailed calculations when needed.

Constant-velocity and constant-acceleration motion are also models based on assumptions

The motion equations used in high school are also models predicting motion under specific conditions. For straight-line motion, denote position by yy, velocity by vv, and acceleration by aa. In the equations below, y0,v0y_0,v_0 denotes the starting position and velocity, and tt is the elapsed time.

Motion assumptions Relationships available for calculation Omitted changes
Velocity v0v_0 is constant y(t)=y0+v0ty(t)=y_0+v_0t Change in velocity
Acceleration aa is constant v(t)=v0+atv(t)=v_0+at, y(t)=y0+v0t+12at2y(t)=y_0+v_0t+\frac12at^2 Change in acceleration

For constant-velocity motion, v̇=0\dot v=0 is constant; for constant-acceleration motion, v̇=a\dot v=a is constant. Assuming certain values do not change lets us calculate subsequent position using simple equations. Whether this assumption sufficiently describes the actual motion determines the model choice.

What about an object attached to a spring? Spring force depends on position, and damper force depends on velocity. If the applied force also varies, acceleration is difficult to treat as a single constant. Include the force relationships in this case.

Mÿ=u−bẏ−kyM\ddot y=u-b\dot y-ky

This extends the constant-acceleration equations by calculating the previously constant acceleration from the current position, velocity, and force. Removing the spring and damper effects and applying only a constant force makes acceleration constant again.

Do simpler assumptions also reduce the number of states?

Not always. The condition that velocity is constant differs from knowing its value. The labels constant velocity and constant acceleration alone do not determine the state dimension. Distinguish values already given from current information still needed to predict the future. Continue with why position and velocity are chosen as states in Week 5.

In this exercise, vary coefficients of a model that includes spring and damper effects. Relate changes in the plots to the forces represented by each coefficient.

Run one section at a time in MATLAB

Like cells in Colab, this document runs code by section. Clicking an explanation or a single code line does not run only that line.

  1. Click inside the code to run, then select Live Editor → Run Section at the top. All code in the current section runs.
  2. Start from the top in this order: check the environment → run the RLC baseline → change one RLC variable at a time → mechanical model. At each stage, predict first, then compare with the results.
  3. After changing parameter or factor, rerun that section. Entering values alone does not update the plot.

Run executes the entire document. In this exercise, use Run Section so you can pause between prediction and observation. Explanation blanks and tables are fields you edit directly; they do not require the run button.

If shortcuts, execution results, or errors are confusing
  • Run the current section: Windows/Linux Ctrl+Enter, Mac ⌘+Enter. If the shortcut does not work, use the Run Section button at the top.
  • Depending on the settings, outputs appear to the right of or below the code. Inspect the graph and record your observations in the corresponding field.
  • If an error says variables such as R0 or g0 are undefined, run the preceding RLC baseline run section and subsequent sections in order. Later sections use variables created earlier. Also run from the top when starting a new session.
  • After changing code, rerun and update the related results, then save your copy.

Official MATLAB guide to running sections · Keyboard shortcuts

1. Define the input and output first

Even for the same object, the model's meaning depends on what is applied and what is measured.

Today's system Input Output
Parallel RLC circuit Injected current iᵢₙ(t) [A] Node voltage v(t) [V]
Mass–spring–damper Applied force u(t) [N] Displacement from equilibrium y(t) [m]
Why define inputs and outputs first?

Simply saying “model the circuit” is insufficient. Applying voltage and measuring current gives a different input–output relationship from applying current and measuring voltage. Today's RLC example uses current input → voltage output.

t is time. v(t) means voltage may vary with time. When reading a model, check each symbol's units as well as its name. Misreading the vertical axis can lead to a different interpretation of the same graph.

Check your understanding · With a 1 N force applied to today's mechanical model, should the plot's vertical-axis unit be N or m?

The vertical axis is the output displacement, so its unit is m. The 1 N is the applied force, or input magnitude. Distinguish input magnitude from the vertical-axis units in MATLAB plots too.

2. Can current values alone describe it?

The spring's static equilibrium can be expressed as F = ky. To describe the object's motion, velocity and acceleration are needed as well as position.

position y(t)velocity dydtacceleration d2ydt2 \text{position }y(t)\qquad \text{velocity }\frac{dy}{dt}\qquad \text{acceleration }\frac{d^2y}{dt^2}

Difference between a static relationship and a dynamic model

A static relation describes inputs and outputs at equilibrium or when time variation is unimportant, such as the spring extension after sufficient waiting. It does not mean the entire physical spring–mass system always responds instantaneously.

A dynamic model describes change over time. Two objects at the same position will reach different positions shortly afterward if one moves right and the other left. Current position alone is therefore insufficient; state information such as velocity is also needed.

Differentiation expresses a rate of change. A differential equation relates physical laws to these rates. Today, focus on the phenomenon each term represents rather than memorizing new mathematical symbols.

Check your understanding · When a spring-connected mass is at y=0y=0, can position alone distinguish being stationary from passing through while moving?

Different velocities produce different subsequent motion. A dynamic system also requires an initial state, such as initial position and velocity.

3. Parallel RLC: build a model from the sum of currents

Parallel RLC circuit. A current source is connected in parallel with resistor R, inductor L, and capacitor C.

The diagram's r(t) is denoted iᵢₙ(t) here to distinguish the resistor R from the input signal. The output is the voltage v(t) shared by all three elements.

The incoming current splits into three branches.

iin=iR+iL+iCi_{in}=i_R+i_L+i_C

Element Current–voltage relationships How to read this
Resistor iR=v/Ri_R=v/R At the same voltage, greater R gives smaller resistor current
Capacitor iC=Cdv/dti_C=C\,dv/dt Voltage rate of change is related to current
Inductor v=LdiL/dtv=L\,di_L/dt The rate of change of current is related to voltage
Combine the three relationships into one equation

Integrating the inductor relationship gives

iL(t)=iL(0)+1L∫0tv(τ)dτi_L(t)=i_L(0)+\frac{1}{L}\int_0^t v(\tau)\,d\tau

is obtained. τ denotes time within the integral. iL(0) is the initial inductor current. With initial current 0, this simplifies as follows.

iin(t)=v(t)R+Cdv(t)dt+1L∫0tv(τ)dτi_{in}(t)=\frac{v(t)}{R}+C\frac{dv(t)}{dt}+\frac{1}{L}\int_0^t v(\tau)\,d\tau

Every term has units of A. This equation substitutes each element's relationship into the current conservation law. Since it includes an integral term, it is strictly an integro-differential relationship. Differentiating both sides would produce a differential equation, but here we proceed to the transfer function from this form.

Check your understanding · Do the voltages across the three parallel elements differ?

The three elements are connected between the same two nodes by ideal wires, so their voltages are equal. Their branch currents may differ, and their sum is the input current.

4. A transfer function compactly represents the input–output relationship

Today, set the initial conditions to 0 and convert differentiation and integration relations into expressions in s for calculation. Denote the Laplace transform of time function v(t) by V(s).

GRLC(s)=V(s)Iin(s)=sCs2+1Rs+1L G_{RLC}(s)=\frac{V(s)}{I_{in}(s)} =\frac{s}{Cs^2+\frac{1}{R}s+\frac{1}{L}}

This transfer function has input–output units of V/A. Check that this agrees with the definition of output divided by input.

Deriving the transfer function

With all initial conditions equal to 0, differentiation becomes multiplication by s and integration becomes division by s. Later units cover Laplace properties in more detail.

Iin(s)=V(s)R+CsV(s)+V(s)LsI_{in}(s)=\frac{V(s)}{R}+CsV(s)+\frac{V(s)}{Ls}

Factoring out the common V(s) gives

Iin(s)=V(s)(1R+Cs+1Ls)I_{in}(s)=V(s)\left(\frac{1}{R}+Cs+\frac{1}{Ls}\right)

is obtained. Rearranging both sides to find output/input gives

V(s)Iin(s)=11R+Cs+1Ls\frac{V(s)}{I_{in}(s)}=\frac{1}{\frac1R+Cs+\frac1{Ls}}

. Finally, multiplying the numerator and denominator by s gives the polynomial form above. Enter the coefficients of this polynomial into MATLAB.

What setting initial conditions to 0 means

For a circuit, consider an initial capacitor voltage and inductor current of 0. For a mechanical system, consider rest at the reference point. If energy is stored initially, that initial state also produces a response.

A transfer function represents the response relationship to an input with all initial conditions equal to 0. If initial position, velocity, capacitor voltage, or inductor current is not 0, calculate their effects on the output separately and add them.

5. Mass–spring–damper: Build the model by summing forces

Mass–spring–damper. The downward force r(t) and displacement y(t), and the upward spring force ky(t) and damper force b times the time derivative of y are shown.

Take downward as positive and write r(t) in the figure as u(t). y(t) is the displacement from the equilibrium point that already accounts for gravity.

u(t)−bẏ(t)−ky(t)⏟sum of forces=Mÿ(t)\underbrace{u(t)-b\dot y(t)-ky(t)}_{\text{sum of forces}}=M\ddot y(t)

Term Physical meaning Units of coefficients
MÿM\ddot y Mass × acceleration M: kg
bẏb\dot y Damper force proportional to velocity b: N·s/m
kyky Spring force proportional to displacement k: N/m
If the signs and gravity term are confusing

The spring exerts force opposite to extension, and the damper exerts force opposite to velocity. Relative to the selected positive direction, these forces are −ky and −bẏ-b\dot{y}. If y or velocity is negative, these terms' signs change accordingly.

Although the figure shows a vertical system, here the reference point includes static deflection due to gravity. Thus, the equation describing additional motion from equilibrium has no constant gravity term. Using the unstretched spring length as the coordinate reference would require a new equation including gravity.

6. Transfer function of the mechanical model

Collecting the output terms on one side gives

Mÿ+bẏ+ky=u(t)M\ddot y+b\dot y+ky=u(t)

. Applying the Laplace transform with all initial conditions at 0 gives

GMSD(s)=Y(s)U(s)=1Ms2+bs+kG_{MSD}(s)=\frac{Y(s)}{U(s)}=\frac{1}{Ms^2+bs+k}

is obtained. The unit is m/N.

Compare alongside the circuit model
Model Input → output Numerator Denominator coefficients
Parallel RLC Current → voltage s C, 1/R, 1/L
Mechanical system Force → Displacement 1 M, b, k

Both denominators contain s², but their numerators, inputs, and outputs differ. Similar forms do not imply equal magnitudes or final values.

In Ms²Y + bsY + kY = U, the mechanical-model transformation groups Y and divides both sides. The physical meanings of mass, damping, and the spring remain unchanged.

Check your understanding · Which denominator coefficient changes when k increases in the mechanical model?

The constant term changes: the last value in [M b k]. Go beyond identifying its position and relate it to a physically stiffer spring.

7. Create a model from coefficients in MATLAB

tf creates a transfer function model from numerator and denominator coefficients. Enter coefficients in descending powers of s. Fill missing powers with 0.

R = 0.5; L = 1; C = 5;
g_rlc = tf([1 0], [C 1/R 1/L]);
  • [1 0] → 1·s + 0
  • [5 2 1] → 5·s² + 2·s + 1
M = 1; b = 2; k = 5;
g_msd = tf(1, [M b k]);
Check the coefficients yourself before running

At the baseline RLC values, 1/R = 2 and 1/L = 1, so the denominator is [5 2 1]. Entering R directly as [5 0.5 1] produces a different model.

Omitting the final 0 and entering the RLC numerator as 1 also produces a different model. When entering an equation, check the order and missing terms as well as the numbers.

If an error says tf cannot be found, check access to Control System Toolbox. The exercise file's initial execution section checks the current environment.

8. How do we read a step response?

step calculates the output when the input changes from 0 to 1 and stays there. Today's step input is 1 A for the RLC circuit and 1 N for the mechanical system.

figure;
step(g_rlc, 25);
grid on;
xlabel('Time (s)'); ylabel('Voltage (V)');

Voltage response to a 1 A current step in the baseline parallel RLC circuit. It starts at 0, rises, then decays toward 0.

This graph is calculated with R=0.5 Ω, L=1 H, C=5 F and all initial conditions at 0. If you ran with the same values, first check whether the overall shape is similar.

Why does the voltage approach 0 despite a continuous current input?

In DC steady state, the ideal inductor current no longer changes. Thus its voltage in v=L di/dt is 0. The common voltage across the parallel circuit also approaches 0. This does not mean the input current disappears. After sufficient time, the inductor branch carries the input current.

At the start, the capacitor voltage cannot jump, so v(0+)=0. If the initial inductor current is also 0, the input current initially flows into the capacitor, giving dv/dt(0+)=1/C=0.2 V/s. Ideal component models are used here.

How should the mechanical system's baseline response be read?

Response of the mechanical model with M=1, b=2, k=5 to a 1 N force step. It oscillates toward 0.2 m.

In the ideal stable model, velocity and acceleration become 0 after sufficient time. Only ky=u remains in the equation, so the final displacement for a 1 N input is 1/k=0.2 m.

The graph's horizontal axis is time, and its vertical axis is displacement. Examine the initial motion, the amount of overshoot beyond the final value, and the time needed to settle separately. The circuit and mechanical models have different final values because their inputs, outputs, and model structures differ.

9. Change one thing and compare in the exercise

Consider which force changes with each parameter and how the motion will change. Keeping a baseline and changing one variable at a time makes causes easier to identify than changing two values together.

Questions to guide your explanation
  • What does the changed coefficient represent in the actual object or circuit?
  • Did the final value change, or did the shape of the motion change?
  • Does less oscillation mean faster settling?
  • For two graphs with different final values, is comparing only the absolute peak heights sufficient?

For a parallel RLC circuit, do not assume that greater resistance always means less oscillation. At the same voltage, the resistor-branch current is v/R. Consider what increases or decreases when the value changes in today's circuit structure.

Write your own explanation based on graphs and equations before reading the expected comparison results.

10. Keep execution and results in one document

To revisit Colab and Markdown

Review explanatory and executable cells and the roles of headings, lists, and tables in the notebook self-study materials covering shared concepts. Across tools, the goal is to record results together with their meaning. MATLAB Live Editor uses formatted text and code sections.

Do not enter Python syntax unchanged into MATLAB code cells. For example, MATLAB uses % for comments and tf and step to handle models.

References

Circuit and mechanical diagram source: Course materials Mathematical Models of System #1. Response graphs are calculated using the parameters in the text.

Materials version: 2026-2-02 · Reference date: 2026-09-10

Practice materials