Discrete-Time and Sampled-Data Systems
Discrete-time models update at separated time instants rather than evolving over every real-valued time. Some systems are inherently discrete, such as population counts by generation or account balances by month. Others are sampled-data systems: a continuous physical plant is measured, controlled, or simulated through samples taken every seconds.
Continuous simulation and discrete-time modeling meet in several places. Numerical integration itself creates a difference equation. Digital controllers sample sensor data and hold actuator commands. Simulink models often combine continuous plant blocks with discrete controllers. Understanding the difference between solver step size, sample time, and output logging interval prevents many simulation errors.
Definitions
A discrete-time state model is
For an LTI discrete-time system,
The sample period relates sample index and physical time:
A zero-order hold keeps an input constant between samples:
For a continuous LTI system
sampled with zero-order hold, the exact discrete-time matrices are
The -transform plays a role in discrete-time analysis similar to the Laplace transform in continuous time.
Key results
Discrete-time stability for an LTI system requires all eigenvalues of to lie inside the unit circle:
If a continuous-time pole is , exact sampling maps it to
Thus a continuous pole with negative real part maps inside the unit circle. Numerical integration methods approximate this mapping, and their approximations can distort stability and dynamics.
Forward Euler applied to gives
Backward Euler gives
The exact zero-order hold model is preferred when converting a linear continuous plant for digital controller analysis, because it accounts for the held input over the sample interval.
Sampling can lose information. A sinusoid of frequency sampled at rate aliases unless the signal bandwidth is below the Nyquist frequency . In simulation, aliasing can occur when logging or controller sample times are too slow even if the continuous solver uses smaller internal steps.
The sample period is a modeling choice with physical consequences. A controller that updates every cannot react to a disturbance that appears and disappears between updates unless the effect is visible in a later sample. A data logger that records once per second can miss fast oscillations even if the plant model was integrated accurately. When a simulation includes sensors, controllers, and actuators, each sample time should correspond to a real device rate or a deliberate design assumption.
Discrete-time models are also useful for systems whose natural clock is not a numerical artifact. Population generations, inventory updates, monthly financial balances, packet arrivals, and digital filters are described directly by difference equations. In those cases the index is part of the model, not just a method for approximating a continuous ODE. Confusing inherently discrete dynamics with sampled continuous dynamics can lead to wrong interpretations of stability and response time.
When comparing continuous and discrete simulations, use the same input convention. Exact zero-order hold conversion assumes the input is constant over each interval. A first-order hold assumes linear interpolation between samples. Impulse-invariant, matched pole-zero, and bilinear transformations preserve different features of the continuous model. No conversion is universally best; the appropriate one depends on whether time response, frequency response, controller implementation, or numerical convenience is the priority.
In Simulink, sampled-data diagrams should make rate changes visible. A continuous plant feeding a discrete controller usually needs a sampler or Zero-Order Hold interpretation at the interface. A discrete controller feeding a continuous actuator should state whether the command is held, filtered, delayed, or interpolated. Rate Transition blocks are not just cosmetic in multi-rate models; they document and manage the timing boundary between signals that update at different rates.
Time-response plots for sampled-data systems should show samples when samples matter. Connecting sample points with a smooth line can suggest behavior between samples that the discrete model does not define. A useful report often overlays the continuous response, the held input, and the sampled output. This makes it clear which behavior belongs to the physical plant, which belongs to the digital algorithm, and which belongs only to plotting interpolation.
Initial conditions also need translation. A continuous plant state becomes the discrete initial state , but controller memory, filter delays, and previous held commands may have their own initial values. A sampled-data simulation that initializes the plant correctly but leaves the controller state inconsistent can show artificial transients. For digital filters and controllers, document whether the stored delays start at zero, at steady state, or from measured history.
For final-value checks, compare discrete equilibria directly rather than assuming the continuous formula survived discretization. Exact zero-order hold preserves the constant-input equilibrium for nonsingular first-order examples, but approximate methods or added delays may shift the apparent steady value.
Visual
| Concept | Continuous time | Discrete time |
|---|---|---|
| Independent variable | ||
| State equation | ||
| Stability region | Left half-plane | Inside unit circle |
| Transform variable | ||
| Frequency uniqueness | Nonperiodic in | Periodic in digital frequency |
| Input holding | Not needed | Must define between samples for plant input |
Worked example 1: Exact discretization of a first-order plant
Problem: A continuous plant is
Assume zero-order hold input and sample period . Find and .
- Identify matrices:
- Compute :
- Compute :
- Integrate:
- Evaluate:
- Write the difference equation:
Checked answer: the discrete steady state for constant is
which matches the continuous equilibrium . The sampled time-response plot should lie on the continuous first-order response at sample times.
Simulink description: use a Discrete State-Space block with sample time 0.1, , , , and . A Zero-Order Hold block should appear between a discrete controller and continuous plant when modeling sampled-data behavior explicitly.
Worked example 2: Euler discretization and stability
Problem: Approximate
with forward Euler and sample time . Determine whether the zero-input discrete model is stable. Compare with exact sampling.
- Forward Euler gives
- Collect terms:
- Substitute :
- Apply discrete stability condition:
So the Euler discrete model is unstable.
- Exact sampling maps the continuous pole to
- Compare. The exact sampled model is stable because , while the Euler approximation is unstable.
Checked answer: the continuous system is stable, but the chosen Euler step is too large. A time-response plot of the Euler model should alternate signs and grow; the exact sampled model should decay rapidly.
Simulink description: a fixed-step Euler solver with step 0.3 on the continuous model can show the numerical instability. A Discrete Transfer Fcn or Discrete State-Space block using exact c2d coefficients should show the stable sampled response.
Code
clear; clc; close all;
% Exact discretization of first-order plant
A = -2; B = 3; C = 1; D = 0; T = 0.1;
sysc = ss(A, B, C, D);
sysd = c2d(sysc, T, 'zoh');
disp(sysd.A);
disp(sysd.B);
% Compare continuous and sampled response
t = 0:0.001:3;
[yc, tc] = step(sysc, t);
[yd, td] = step(sysd, 0:T:3);
figure;
plot(tc, yc, 'b-', td, yd, 'ro', 'LineWidth', 1.3);
grid on; xlabel('Time (s)'); ylabel('x');
legend('Continuous', 'Sampled', 'Location', 'southeast');
title('Exact sampled-data response');
% Euler instability example
Tbad = 0.3;
Ad_euler = 1 - 8*Tbad;
Bd_euler = Tbad;
Ad_exact = exp(-8*Tbad);
N = 12;
x_euler = zeros(1,N+1); x_exact = zeros(1,N+1);
x_euler(1) = 1; x_exact(1) = 1;
for k = 1:N
x_euler(k+1) = Ad_euler*x_euler(k);
x_exact(k+1) = Ad_exact*x_exact(k);
end
kvec = 0:N;
figure;
stem(kvec, x_euler, 'r', 'DisplayName', 'Euler'); hold on;
stem(kvec, x_exact, 'b', 'DisplayName', 'Exact ZOH');
grid on; xlabel('Sample k'); ylabel('x[k]');
legend('Location', 'best');
title('Discrete stability comparison');
The first plot should show red sample points sitting on the continuous curve. The second should show Euler diverging while exact sampling decays. This distinction is central in simulation: discretization is a modeling and numerical decision, not a harmless formatting change.
Common pitfalls
- Confusing solver fixed step with a digital controller's sample period.
- Logging too slowly and then interpreting aliased plots as physical oscillations.
- Using forward Euler discretization for controller design when exact zero-order hold conversion is needed.
- Applying continuous-time pole criteria to discrete-time poles.
- Forgetting the hold assumption when converting between continuous and discrete models.
- Mixing blocks with inherited sample times without checking the compiled sample-time display.