Mechatronic System Modeling & Simulation

Chapter 3
Mathematical System Representations

Bachelor Program in Mechatronics Engineering
Mechatronic System Modeling & Simulation   •   Bachelor

Mathematical System Representations

Introduction

Mechatronic systems combine mechanical, electrical, electronic, computer, sensing, and control subsystems. Their physical behavior may be complex, but engineering analysis becomes manageable when that behavior is represented mathematically. A mathematical model is a purposeful abstraction: it retains relationships important to a design question while neglecting effects that are insignificant for that purpose.

For example, a robotic joint may be represented by a nonlinear rigid-body model for trajectory planning, a linear transfer function for controller design, or a discrete state-space model for digital implementation. No single representation is universally best. The appropriate model depends on the required accuracy, available measurements, computational resources, operating range, and intended use.

This chapter develops algebraic, differential-equation, transfer-function, block-diagram, signal-flow, and state-space representations. It also distinguishes static and dynamic, continuous and discrete, deterministic and stochastic systems.

Learning Objectives

By the end of this chapter, a student should be able to:

  1. Distinguish a physical system, its variables, and its mathematical model.
  2. Formulate algebraic and differential-equation models from physical laws.
  3. Derive and interpret transfer functions under stated assumptions.
  4. Construct and simplify block diagrams and signal-flow graphs.
  5. Convert a differential equation or transfer function into state-space form.
  6. Classify models as static or dynamic, continuous or discrete, and deterministic or stochastic.
  7. Select an appropriate representation for simulation, analysis, or control implementation.

1. Systems, Variables, and Modeling Assumptions

A system is a collection of interacting components that transforms inputs into outputs. An input may be an applied voltage, motor torque, commanded position, or environmental disturbance. An output may be displacement, velocity, temperature, or measured current. Internal variables, called states, summarize information about the past that is needed to predict future behavior.

A useful modeling procedure is:

  1. Define the system boundary and objective.
  2. Identify inputs, outputs, parameters, disturbances, and states.
  3. Draw a physical schematic and establish sign conventions.
  4. Apply conservation laws and constitutive relations.
  5. State assumptions and estimate parameter values.
  6. Validate predictions against experiment or a higher-fidelity model.

Typical assumptions include rigid bodies, small displacements, constant parameters, negligible friction, ideal sensors, or operation near an equilibrium point. Assumptions are not minor qualifications: they determine the domain in which a model is credible.

QuantityTypical mechanical exampleTypical electrical example
InputForce F or torque τVoltage v or current i
OutputPosition x or angle θCharge q or voltage v
StorageMass/inertia, spring, damperCapacitor, inductor
DissipationViscous frictionResistance
Parameterm, J, k, bR, L, C

Units must remain consistent. In the SI system, force is measured in newtons, torque in newton-metres, position in metres, voltage in volts, and time in seconds.

2. Algebraic and Static Models

An algebraic model contains no derivatives, integrals, or delays. It relates variables at the same instant. A system is static when its output depends only on the present input, not on stored energy or past input values.

A simple potentiometer can be modeled as

vo = αvi, 0 ≤ α ≤ 1

where v_i is input voltage, v_o is output voltage, and α is the dimensionless wiper fraction. This model is static if loading, contact dynamics, and electrical noise are neglected.

A gear pair provides another algebraic relation. If ideal gears have tooth counts N₁ and N₂, then, with a consistent sign convention,

θ₂ = −(N₁/N₂)θ₁

where θ₁ and θ₂ are angular displacements. The negative sign indicates opposite rotation for external gears. For ideal power transmission, torque approximately satisfies

τ₂ = −(N₂/N₁)τ₁

because output speed decreases as output torque increases. Real gear trains require efficiency, backlash, compliance, and friction terms.

Static models are useful for calibration, steady-state design, and sensor conversion. They cannot predict settling time, oscillation, transient error, or the effect of initial stored energy.

3. Differential-Equation Models

Dynamic systems store energy. Their behavior is consequently described by differential equations in continuous time or difference equations in discrete time.

3.1 Translational mechanical system

Consider a mass m connected to a viscous damper b and spring k, acted upon by force F(t). Newton’s second law gives

m d²x/dt² + b dx/dt + kx = F(t)

Here x(t) is displacement in metres, m is mass in kilograms, b is viscous damping in newton-seconds per metre, k is stiffness in newtons per metre, and F(t) is force in newtons. The equation assumes small displacement, linear spring behavior, viscous damping, and constant parameters.

The three terms represent inertia, damping, and spring force. Their units are all newtons: kg·m/s², (N·s/m)(m/s), and (N/m)m, respectively.

3.2 Rotational system

For a rotational inertia J, viscous rotational damping b, and torsional stiffness k, the analogous model is

J d²θ/dt² + b dθ/dt + kθ = τ(t)

where J is in kg·m², b in N·m·s/rad, k in N·m/rad, θ in radians, and τ in newton-metres. Radians are dimensionless in SI but are retained for clarity.

3.3 Electrical RLC circuit

For a series resistor–inductor–capacitor circuit driven by voltage v_i(t), Kirchhoff’s voltage law gives

L di/dt + Ri + (1/C)∫i dt = vi(t)

Differentiating, under sufficiently smooth signals and zero concern about impulsive initial conditions, gives

L d²i/dt² + R di/dt + (1/C)i = dvi/dt

where L is inductance in henries, R resistance in ohms, C capacitance in farads, and i current in amperes. A charge-based formulation often avoids differentiating the input.

3.4 Coupled mechatronic models

Electromechanical actuators couple electrical and mechanical equations. For a separately excited DC motor, a common linear model is

L di/dt + Ri + Keω = v
J dω/dt + bω = Kti − τL

where v is armature voltage, i current, ω angular velocity, τ_L load torque, L armature inductance, R resistance, J combined inertia, b viscous damping, K_e back-emf constant, and K_t torque constant. In coherent SI units, K_e and K_t have numerically compatible values, although their physical units differ. The model assumes magnetic linearity, no saturation, and linear friction.

4. Transfer-Function Representation

The transfer function describes the input–output behavior of a linear time-invariant (LTI) system under zero initial conditions. Applying the Laplace transform to the mass–spring–damper equation gives

(ms² + bs + k)X(s) = F(s)

Therefore,

G(s) = X(s)/F(s) = 1/(ms² + bs + k)

where s is the Laplace variable in radians per second, X(s) is the transform of displacement, and F(s) is the transform of force. The zero-initial-condition requirement is essential: nonzero stored energy produces additional terms that are not part of the transfer function.

The normalized second-order form is

G(s) = (1/m)/(s² + 2ζωn s + ωn²)

with

ωn = √(k/m)
ζ = b/(2√(mk))

where ω_n is the undamped natural frequency in rad/s and ζ is the dimensionless damping ratio. These definitions apply for m > 0 and k > 0. The system is underdamped when 0 < ζ < 1, critically damped when ζ = 1, and overdamped when ζ > 1. For ζ = 0, the ideal model oscillates without decay.

A transfer function is a ratio of polynomials in s:

G(s) = Y(s)/U(s) = N(s)/D(s)

Zeros are roots of N(s), and poles are roots of D(s), after cancellation of exact common factors. Poles characterize natural modes and stability for many LTI systems. A continuous-time rational LTI system is asymptotically stable when all uncancelled poles have strictly negative real parts. Pole-zero cancellation can conceal internal modes, so input–output stability should not automatically be interpreted as internal stability.

Transfer functions are especially useful for frequency response, cascade systems, characteristic equations, and classical feedback design. They are less convenient for nonlinear, time-varying, multi-input multi-output, or nonzero-initial-condition problems.

Worked Example 1: Mass–spring–damper parameters

Let m = 2 kg, b = 4 N·s/m, and k = 18 N/m. Then

G(s) = 1/(2s² + 4s + 18)

Dividing by 2 gives

G(s) = 0.5/(s² + 2s + 9)

Thus ω_n = √9 = 3 rad/s and ζ = 2/(2×3) = 1/3. Since 0 < ζ < 1, the system is underdamped. The model predicts oscillatory transients that decay because b is positive.

5. Block Diagrams

A block diagram represents functional relationships using directed blocks and summing junctions. A block with input U(s), output Y(s), and transfer function G(s) satisfies

Y(s) = G(s)U(s)

For a cascade of G₁(s) and G₂(s),

Y(s) = G₂(s)G₁(s)U(s)

so the equivalent transfer function is G₂G₁, provided the interconnection does not alter the block assumptions.

For a negative-feedback loop with forward path G(s) and feedback H(s),

E(s) = R(s) − H(s)Y(s)
Y(s) = G(s)E(s)

Combining these equations gives the closed-loop transfer function

T(s) = Y(s)/R(s) = G(s)/(1 + G(s)H(s))

The expression applies to a standard single-loop, negative-feedback, LTI configuration. Positive feedback changes the denominator to 1 − GH. Sign conventions must be shown explicitly; an incorrectly placed sign can change stability conclusions.

![Block diagram of a feedback system]

Negative feedback block diagram G(s) H(s) +− R(s) Y(s)
Negative feedback block diagram
Figure: Negative feedback block diagram

Figure: Standard single-loop negative-feedback representation.

6. Signal-Flow Graphs and Mason’s Rule

A signal-flow graph consists of nodes representing signals and directed branches representing multiplication by a gain. It is useful when many interacting paths exist. A forward path cannot pass through a node more than once. A loop starts and ends at the same node without repeating another node. Non-touching loops share no node.

Mason’s gain formula is

T = (Σk Pk∆k)/∆

where P_k is the gain of the kth forward path, ∆ = 1 − (sum of all individual loop gains) + (sum of products of two non-touching loop gains) − (sum of products of three non-touching loop gains) + …, and ∆_k is formed by excluding loops that touch the kth forward path. The formula assumes a well-defined directed linear signal-flow graph.

For a single forward path G and one feedback loop −GH, ∆ = 1 + GH and Mason’s rule gives G/(1 + GH), agreeing with block-diagram reduction. Signal-flow graphs are valuable for multi-loop systems, but careful node labeling is necessary to avoid accidentally introducing or omitting a signal path.

7. State-Space Representation

State-space models describe internal behavior using first-order equations. A continuous-time linear time-invariant model is

dx/dt = Ax + Bu
y = Cx + Du

where x ∈ ℝⁿ is the state vector, u ∈ ℝᵐ the input vector, y ∈ ℝᵖ the output vector, A the n×n state matrix, B the n×m input matrix, C the p×n output matrix, and D the p×m direct-feedthrough matrix. Matrix dimensions must be compatible.

For the mass–spring–damper system, choose states x₁ = displacement x and x₂ = velocity dx/dt. Then

dx₁/dt = x₂
dx₂/dt = −(k/m)x₁ − (b/m)x₂ + (1/m)F

Thus, for output displacement,

A = [[0, 1], [−k/m, −b/m]], B = [[0], [1/m]], C = [1, 0], D = [0]

The state vector is not unique. Any nonsingular coordinate transformation z = Tx produces an equivalent realization with A_z = TAT⁻¹, B_z = TB, C_z = CT⁻¹, and D unchanged. Different state choices can therefore have different physical interpretations while producing identical input–output behavior.

A state-space model is preferred for multi-input multi-output systems, nonlinear models, time-varying systems, digital control, and systems with nonzero initial conditions. For a nonlinear system,

dx/dt = f(x,u,t), y = g(x,u,t)

where f and g may contain nonlinear functions such as sin θ, saturation, Coulomb friction, or products of variables.

Discrete-time state space

With sampling interval T_s, a discrete model is

x[k+1] = Ad x[k] + Bd u[k]
y[k] = Cd x[k] + Dd u[k]

where k is an integer sample index. For a zero-order-held input and constant continuous matrices, the exact discretization is

Ad = e^(ATs)
Bd = ∫₀ᵀˢ e^(Aτ)B dτ

The integral formula is general; the shortcut B_d = A⁻¹(A_d − I)B is valid only when A is nonsingular. A discrete LTI system is asymptotically stable when every eigenvalue of A_d lies strictly inside the unit circle, |λ_i| < 1.

8. System Classifications

Static and dynamic

A static system has no memory. An ideal algebraic sensor conversion is static. A dynamic system has memory because it stores energy or information. Masses, inductors, capacitors, thermal bodies, and software filters are dynamic.

Continuous and discrete

A continuous-time signal is defined for every time t. A discrete-time signal is defined only at sample indices k. Sampling frequency is f_s = 1/T_s, where T_s is the sampling interval. Sampling must be sufficiently fast for the intended dynamics, and anti-alias filtering is normally required. The Nyquist frequency is f_s/2; frequency components above it can be misrepresented as lower frequencies.

Deterministic and stochastic

A deterministic model gives the same output whenever the same initial conditions and inputs are supplied. A stochastic model includes random variables or processes, such as sensor noise, component variation, or uncertain disturbances. A measured signal may be written

y(t) = ytrue(t) + v(t)

where v(t) is measurement noise. Stochastic modeling requires probability distributions, statistical parameters, or experimentally estimated noise characteristics. Randomness does not mean that physical laws are absent; it means that uncertainty is represented explicitly.

Linear and nonlinear; time-invariant and time-varying

A linear system satisfies superposition: if inputs u₁ and u₂ produce outputs y₁ and y₂, then a₁u₁ + a₂u₂ produces a₁y₁ + a₂y₂. A system is time-invariant if delaying the input delays the output without changing its form. Linear time-invariant models enable Laplace and transfer-function methods. Saturation, backlash, friction, geometric trigonometric terms, and parameter changes commonly violate these assumptions.

ClassificationMain characteristicTypical representation
StaticNo memoryAlgebraic equation
DynamicMemory or energy storageDifferential/difference equation
ContinuousDefined for every ts-domain or continuous state space
DiscreteDefined at kT_sz-domain or discrete state space
DeterministicNo random componentFixed equations and parameters
StochasticIncludes uncertainty/noiseRandom processes and distributions

9. Worked Conversion Example

Consider

d²y/dt² + 5dy/dt + 6y = 2u

with zero initial conditions. Taking the Laplace transform gives

(s² + 5s + 6)Y(s) = 2U(s)

so

G(s) = Y(s)/U(s) = 2/(s² + 5s + 6)

Choose x₁ = y and x₂ = dy/dt. Then

dx₁/dt = x₂
dx₂/dt = −6x₁ − 5x₂ + 2u

and y = x₁. Therefore,

A = [[0, 1], [−6, −5]], B = [[0], [2]], C = [1, 0], D = [0]

The characteristic polynomial of A is det(sI − A) = s² + 5s + 6, which agrees with the transfer-function denominator. This agreement is a useful verification, although it does not by itself prove that all modeling assumptions are valid.

10. Applied Case: Digital Position Control of a Small Robot Joint

Background

This illustrative case concerns a motor-driven robotic joint used to position a lightweight gripper. The controller is implemented on a microcontroller, while the motor and joint are continuous physical systems.

Problem

The design team must predict joint motion, select a controller, and decide whether a simple linear model is adequate. The joint experiences motor torque, viscous friction, load torque, encoder quantization, and measurement noise.

Analysis

A first model combines motor electrical dynamics, rotational inertia, and damping. Near a fixed operating point, magnetic saturation and gear backlash are neglected. The continuous model can be written in state space with states motor current, joint angle, and angular velocity. Load torque is treated as a disturbance input, and encoder noise as a measurement-noise input.

For controller design, the linearized transfer function from motor voltage to joint angle is convenient. For simulation over the full motion range, a nonlinear model is preferable because gravity torque may contain sin θ, friction may change sign, and backlash may create dead zones.

The controller samples the encoder at T_s = 1 ms. A discrete state-space model is obtained using zero-order-hold discretization. The sampling rate is 1000 Hz, but this alone does not guarantee a good model: sensor delay, computation time, actuator saturation, and unmodeled resonances must also be represented or tested.

Approach and solution

The team uses three models:

  1. A static encoder scale model for converting counts to angle.
  2. A continuous linear state-space model for pole placement and initial controller design.
  3. A nonlinear discrete simulation containing saturation, quantization, friction, and noise for verification.

Validation compares simulated step responses, tracking error, current demand, and settling time with experimental measurements. Parameters are identified from safe low-amplitude tests rather than inferred solely from datasheets.

Outcome

The linear model predicts dominant settling behavior and supports controller tuning. The nonlinear model reveals a small steady tracking error caused by friction and quantization, and a current spike during rapid commands. The final design adds current limiting, anti-windup protection, filtered velocity estimation, and a fault response for encoder disagreement.

Learning points

A model should be matched to its purpose. Linear transfer functions are efficient for design, state space handles multiple variables and digital implementation, and nonlinear simulation is essential for testing limits and safety. Validation is a continuing process rather than a single final step.

11. Limitations, Governance, and Best Practice

Every model has a validity range. Linearization is local; a model accurate near one equilibrium may be poor during large motions. Parameter uncertainty can dominate numerical precision. An apparently stable simulation may result from an unrealistically small timestep, omitted delay, or ideal actuator.

Best practice includes:

  • record assumptions, parameter sources, units, and coordinate conventions;
  • keep physical and software models traceable to requirements;
  • test limiting cases, conservation laws, and dimensional consistency;
  • compare multiple representations when possible;
  • validate against independent experimental data;
  • model saturation, delays, quantization, noise, and faults when they affect decisions;
  • preserve version history and document parameter changes;
  • report uncertainty rather than presenting all simulated values as facts.

In safety-critical mechatronics, model-based design does not remove engineering responsibility. Verification, hardware-in-the-loop testing, risk assessment, cybersecurity controls, and applicable machinery or functional-safety standards remain necessary. AI-assisted modeling can help identify parameters or generate candidate equations, but engineers must check physical plausibility, data provenance, units, stability, and edge cases. An automatically generated model should be treated as a hypothesis until verified.

Chapter Summary

Mathematical representations translate physical behavior into forms suitable for analysis, simulation, and control. Algebraic models describe instantaneous static relationships, whereas differential and difference equations describe systems with memory. Transfer functions provide compact input–output descriptions of linear time-invariant systems under zero initial conditions. Block diagrams emphasize functional interconnection, and signal-flow graphs provide an alternative path-based representation. State-space models expose internal variables and are particularly effective for multi-variable, nonlinear, time-varying, and digital systems.

Static/dynamic, continuous/discrete, deterministic/stochastic, and linear/nonlinear classifications describe different properties and should not be confused. Model selection must reflect purpose, assumptions, computational constraints, and required fidelity. Validation, dimensional checks, uncertainty analysis, and explicit documentation are essential professional practices.

Key Terms

Mathematical model: An abstraction that describes relationships among system variables.

System boundary: The chosen separation between a system and its environment.

State: A variable set that summarizes information needed to predict future behavior.

Static system: A system whose output depends only on present input.

Dynamic system: A system with memory, energy storage, or internal evolution.

Continuous-time system: A system described for every real-valued time t.

Discrete-time system: A system described at indexed sampling instants.

Deterministic system: A system with reproducible output for specified input and initial conditions.

Stochastic system: A system that explicitly includes random quantities or uncertainty.

Transfer function: The zero-initial-condition ratio of output to input transforms for an LTI system.

Pole: A root of a transfer-function denominator after appropriate cancellation.

Zero: A root of a transfer-function numerator.

Block diagram: A graphical representation of functional signal relationships.

Signal-flow graph: A directed graph whose branches carry signal gains.

State-space model: First-order equations describing state evolution and output generation.

Natural frequency: The characteristic undamped frequency of a second-order system.

Damping ratio: A dimensionless measure of damping relative to critical damping.

Linearization: Approximation of a nonlinear model near an operating point.

Zero-order hold: An input reconstruction that holds each sampled value constant until the next sample.

Model validation: Comparison of model predictions with independent evidence or measurements.

Review Questions

Short Answer Questions

  1. What information is represented by a system state?
  2. Why are zero initial conditions required when defining a transfer function?
  3. Distinguish a static system from a dynamic system.
  4. What is the physical meaning of a pole in an LTI model?
  5. State one advantage of state-space modeling over transfer-function modeling.

Long Answer Questions

  1. Derive the transfer function of a mass–spring–damper system and explain the role of each parameter.
  2. Explain the assumptions and limitations of using a linearized model for a robotic joint.
  3. Describe how a negative-feedback block diagram is reduced to a closed-loop transfer function.
  4. Explain the differences among continuous-time, discrete-time, deterministic, and stochastic models.
  5. Formulate a state-space model for a series RLC circuit, clearly defining the states and inputs.

Analytical / Application Questions

  1. A translational actuator has m = 1 kg, b = 6 N·s/m, and k = 25 N/m. Determine its natural frequency and damping ratio, classify its damping, and write its transfer function from force to displacement.
  2. A digital controller uses a sampling interval of 2 ms. Explain which physical and computational effects should be examined before selecting a discrete model.
  3. For a motorized joint with backlash, saturation, encoder quantization, and measurement noise, recommend a set of complementary mathematical representations and justify the role of each.

Multiple Choice Questions with Answers

Question 1

Which condition is required for the usual transfer function definition?

A. The system must be nonlinear

B. Initial conditions must be zero

C. The input must be stochastic

D. The output must be static

Correct Answer: B. Initial conditions must be zero

Question 2

For a mass–spring–damper system, which term represents viscous damping?

A. m d²x/dt²

B. kx

C. b dx/dt

D. F(t)

Correct Answer: C. b dx/dt

Question 3

If m = 2 kg and k = 18 N/m, what is the undamped natural frequency?

A. 2 rad/s

B. 3 rad/s

C. 9 rad/s

D. 36 rad/s

Correct Answer: B. 3 rad/s

Question 4

The closed-loop transfer function for standard negative feedback is:

A. G/(1 − GH)

B. H/(1 + GH)

C. G/(1 + GH)

D. GH/(1 + G)

Correct Answer: C. G/(1 + GH)

Question 5

Which representation is generally most suitable for multi-input multi-output systems?

A. A single algebraic gain

B. State space

C. A static sensor equation

D. A gear ratio only

Correct Answer: B. State space

Question 6

A discrete-time LTI state model is asymptotically stable when its state-matrix eigenvalues are:

A. All greater than 1 in magnitude

B. All on the imaginary axis

C. All strictly inside the unit circle

D. All positive real numbers

Correct Answer: C. All strictly inside the unit circle

Question 7

Which model explicitly includes random measurement noise?

A. Deterministic model

B. Stochastic model

C. Static algebraic model only

D. Ideal gear model

Correct Answer: B. Stochastic model

Question 8

For a second-order system, 0 < ζ < 1 indicates:

A. Underdamping

B. Critical damping

C. Overdamping

D. No dynamics

Correct Answer: A. Underdamping

Question 9

In a state-space model, what does the vector x represent?

A. Only external disturbances

B. The state variables

C. Only measured outputs

D. Transfer-function zeros

Correct Answer: B. The state variables

Question 10

What is the main purpose of model validation?

A. To remove all physical assumptions

B. To compare predictions with independent evidence

C. To guarantee zero measurement noise

D. To convert every model into an algebraic equation

Correct Answer: B. To compare predictions with independent evidence

Mechatronic System Modeling & Simulation
Chapter 3 of 15