Linear Dynamical Systems: How Linear Algebra Models Change Over Time

Last Updated June 29, 2026

Linear dynamical systems explain how systems evolve through repeated linear transformation. A state vector represents the system at a given moment, and a matrix describes how that state changes from one step to the next. By iterating the matrix, linear algebra can model growth, decay, oscillation, equilibrium, convergence, instability, forcing, feedback, and long-run behavior.

This article introduces linear dynamical systems as a bridge between matrix algebra, eigenvalue analysis, state transition systems, differential equations, control theory, scientific computing, and systems modeling. It connects state vectors, update matrices, repeated transformation, matrix powers, equilibrium states, fixed points, eigenvalues, eigenvectors, stability, input terms, forcing, linearization, state-space models, simulation, numerical reliability, and responsible interpretation.

The central modeling question is not only “What is the update rule?” It is “What does repeated application of this rule imply about system behavior, and when is a linear dynamical model a defensible simplification of the real system?”

Vintage mathematical workspace with state trajectories, phase portraits, transition matrices, damped oscillations, vector fields, network dynamics, books, and drafting tools.
Linear dynamical systems shown through evolving states, transition rules, trajectories, oscillations, stability patterns, and structured system behavior over time.

A linear dynamical system describes change over time using linear relationships among state variables. The current state is encoded as a vector. A matrix maps that state into the next state. Repeating the map produces a trajectory through state space. This simple structure supports powerful analysis: eigenvalues classify modes, matrix powers describe repeated evolution, fixed points define equilibria, and stability diagnostics reveal whether disturbances decay or amplify.

Linear dynamical systems are not limited to abstract mathematics. They appear in population models, infrastructure systems, economic adjustment, scientific simulations, engineering models, machine learning iterations, signal processing, epidemiology, network diffusion, climate submodels, and control systems. Their strength is clarity. Their risk is oversimplification. Linear dynamics can clarify structure, but they can also hide nonlinear thresholds, feedback, constraints, saturation, adaptation, and institutional context.

Why Linear Dynamical Systems Matter

Linear dynamical systems matter because many systems evolve through repeated interaction among variables. A disturbance in one part of a system can propagate to others. A population stage can feed into another stage. Economic sectors can adjust through repeated dependency. Infrastructure condition can evolve through deterioration and maintenance. A numerical algorithm can update an error vector repeatedly. In each case, the modeler needs to understand how the state changes over time.

A linear dynamical model compresses this question into a matrix update rule. The model can then be analyzed using matrix powers, eigenvalues, eigenvectors, equilibrium equations, stability diagnostics, and simulation workflows.

Modeling question Linear algebra object Systems interpretation
What is the system state? State vector. Values of system variables at a given time.
How does the state update? System matrix. Linear rule connecting current state to next state.
What happens after many steps? Matrix powers. Repeated evolution through state space.
What modes dominate? Eigenvalues and eigenvectors. Growth, decay, oscillation, or persistence patterns.
Does the system stabilize? Stability diagnostics. Disturbances decay, persist, or amplify.

Linear dynamical systems provide a disciplined language for modeling change without losing the matrix structure that makes analysis and computation tractable.

Back to top ↑

State Vectors and System State

A state vector gathers the variables needed to describe a system at a given time. In a population model, entries might be age groups. In an infrastructure model, entries might be asset condition categories. In an economic model, entries might be sector outputs. In an engineering model, entries might be position and velocity. In a computational model, entries might be error components or feature states.

\[
\mathbf{x}_t=
\begin{bmatrix}
x_{1,t}\\
x_{2,t}\\
\vdots\\
x_{n,t}
\end{bmatrix}
\]

Interpretation: The state vector records the system’s variables at time \(t\).

State design is a modeling decision. A state vector should include variables that matter for the system’s evolution, but it should not include variables merely because they are available. State variables require units, scales, definitions, and interpretive boundaries.

State-vector issue Modeling question Interpretive warning
Variable choice Which quantities define the system state? Missing variables can make the dynamics appear linear when they are not.
Units What does each coordinate measure? Mixed units require scaling and careful interpretation.
Time index What does one step represent? Daily, monthly, and annual dynamics are different models.
State completeness Does the current state contain enough information? Hidden memory can violate simple state-update assumptions.
Measurement reliability How accurate are state observations? Noisy states can produce fragile dynamics.

A linear dynamical system begins with a state vector, but the usefulness of the model depends on whether that vector is a meaningful representation of the system.

Back to top ↑

Discrete-Time Linear Dynamics

The basic discrete-time linear dynamical system is:

\[
\mathbf{x}_{t+1}=A\mathbf{x}_t
\]

Interpretation: The next system state is obtained by multiplying the current state by the system matrix \(A\).

The matrix \(A\) encodes how state variables interact. Each entry describes how one current variable contributes to a next-period variable. In systems modeling, this matrix may represent transition probabilities, input-output dependencies, growth rates, diffusion pathways, update weights, coupling strengths, or local linear approximations.

Part of the equation Formal role Systems meaning
\(\mathbf{x}_t\) Current state vector. System condition at time \(t\).
\(A\) Linear update matrix. Rule connecting current state to next state.
\(\mathbf{x}_{t+1}\) Next state vector. System condition after one update.
Repeated multiplication Iteration of update rule. Trajectory through state space.
Matrix structure Pattern of coupling among variables. Propagation, feedback, dependence, or isolation.

This simple equation is the foundation for a large class of dynamical models. Its clarity makes it useful, but its assumptions must remain visible.

Back to top ↑

Matrix Powers and Trajectories

Repeated updates produce matrix powers. Starting from an initial state \(\mathbf{x}_0\):

\[
\mathbf{x}_1=A\mathbf{x}_0,
\qquad
\mathbf{x}_2=A^2\mathbf{x}_0,
\qquad
\mathbf{x}_t=A^t\mathbf{x}_0
\]

Interpretation: The system trajectory is produced by repeated application of the update matrix.

The sequence \(\mathbf{x}_0,\mathbf{x}_1,\mathbf{x}_2,\ldots\) is a trajectory through state space. Its shape depends on the initial state, the matrix, the eigenstructure, and any constraints or forcing terms not included in the homogeneous model.

Trajectory feature Matrix explanation Systems interpretation
Decay toward zero All modes shrink under \(A^t\). Disturbance fades or system returns toward baseline.
Growth away from zero At least one mode amplifies. Instability or escalating response.
Oscillation Negative or complex modes affect direction. Alternating, cyclic, or rotating behavior.
Dominant direction Largest mode eventually shapes trajectory. Long-run behavior aligns with dominant system structure.
Slow convergence Eigenvalues near the stability boundary. Long memory or persistent transient behavior.

Matrix powers turn a static matrix into a dynamic story about repeated system change.

Back to top ↑

Equilibrium and Fixed Points

An equilibrium is a state that remains unchanged by the update rule. For the homogeneous system \(\mathbf{x}_{t+1}=A\mathbf{x}_t\), an equilibrium satisfies:

\[
\mathbf{x}^\ast=A\mathbf{x}^\ast
\]

Interpretation: The state \(\mathbf{x}^\ast\) is fixed by the update matrix.

This can be rewritten as:

\[
(A-I)\mathbf{x}^\ast=\mathbf{0}
\]

Interpretation: Equilibria lie in the null space of \(A-I\).

For many homogeneous systems, the zero vector is an equilibrium. Nonzero equilibria exist when \(1\) is an eigenvalue of \(A\). In transition systems, stationary distributions are a special kind of fixed point. In forced or affine systems, equilibria depend on both the matrix and the input term.

Equilibrium type Equation Modeling meaning
Homogeneous zero equilibrium \(\mathbf{0}=A\mathbf{0}\) No deviation from baseline remains no deviation.
Nonzero fixed point \(\mathbf{x}^\ast=A\mathbf{x}^\ast\) A persistent state under the update rule.
Stationary distribution \(\pi P=\pi\) Probability distribution unchanged by transition.
Forced equilibrium \(\mathbf{x}^\ast=A\mathbf{x}^\ast+\mathbf{b}\) State balancing internal dynamics and external input.
Local equilibrium Fixed point of nonlinear system, analyzed by linearization. Reference state for local stability analysis.

Equilibrium analysis asks which states remain unchanged, while stability analysis asks what happens near those states.

Back to top ↑

Eigenvalues and System Modes

Eigenvalues and eigenvectors reveal the natural modes of a linear dynamical system. If \(A\mathbf{v}=\lambda\mathbf{v}\), then starting in direction \(\mathbf{v}\) produces simple modal behavior:

\[
A^t\mathbf{v}=\lambda^t\mathbf{v}
\]

Interpretation: Along an eigenvector direction, repeated dynamics are governed by powers of the eigenvalue.

This is why eigenstructure is central to linear dynamics. Eigenvectors identify directions of coherent system behavior. Eigenvalues determine whether those directions grow, decay, persist, reverse, or oscillate.

Eigenvalue feature Dynamic behavior Systems interpretation
\(|\lambda|<1\) Mode decays in discrete time. Disturbance fades along that mode.
\(|\lambda|>1\) Mode amplifies in discrete time. Instability or escalating response.
\(\lambda=1\) Mode persists. Conservation, steady structure, or fixed direction.
\(\lambda<0\) Mode alternates sign. Overshoot, reversal, or alternating behavior.
Complex eigenvalue Rotating or oscillatory behavior. Cycles, waves, or coupled exchange.

Eigenvalue analysis turns matrix iteration into interpretable modal behavior, but modal interpretation still depends on the meaning of the state variables and matrix entries.

Back to top ↑

Stability in Linear Dynamical Systems

For discrete-time linear systems, stability depends on eigenvalue magnitudes. If all eigenvalues of \(A\) lie inside the unit circle, then the homogeneous system tends to decay toward zero under standard assumptions.

\[
\rho(A)=\max_i|\lambda_i|
\]

Interpretation: The spectral radius is the largest eigenvalue magnitude and is a key discrete-time stability diagnostic.

Spectral radius condition Discrete-time implication Systems interpretation
\(\rho(A)<1\) Modes decay asymptotically. System deviations fade under repeated updates.
\(\rho(A)=1\) Boundary behavior. Persistence, cycling, or marginal stability may occur.
\(\rho(A)>1\) At least one mode amplifies. Instability or runaway growth is possible.
\(\rho(A)\) near \(1\) Slow decay or slow growth. Long memory or near-instability matters.
Nonnormal matrix Eigenvalues may miss transient growth. Short-run amplification may still be consequential.

Stability analysis should report the spectral radius, eigenvalues, mode interpretation, and any caveats about nonnormality, forcing, scaling, nonlinearities, or model validity.

Back to top ↑

Forced and Affine Dynamics

Many systems are not purely homogeneous. External inputs, interventions, policy levers, environmental forcing, maintenance actions, demand shocks, or resource flows can affect the next state. A simple affine linear dynamical system is:

\[
\mathbf{x}_{t+1}=A\mathbf{x}_t+\mathbf{b}
\]

Interpretation: The next state depends on internal linear dynamics plus a constant input or forcing vector.

If an equilibrium exists, it satisfies:

\[
\mathbf{x}^\ast=A\mathbf{x}^\ast+\mathbf{b}
\]

Interpretation: At equilibrium, internal dynamics and external input balance so the state remains unchanged.

Rearranging gives:

\[
(I-A)\mathbf{x}^\ast=\mathbf{b}
\]

Interpretation: Solving this linear system gives the fixed point of the affine dynamics when \(I-A\) is invertible.

Dynamics type Equation Systems meaning
Homogeneous \(\mathbf{x}_{t+1}=A\mathbf{x}_t\) System evolves only through internal state coupling.
Affine \(\mathbf{x}_{t+1}=A\mathbf{x}_t+\mathbf{b}\) System has a constant input or background forcing.
Controlled \(\mathbf{x}_{t+1}=A\mathbf{x}_t+B\mathbf{u}_t\) System responds to time-varying inputs or decisions.
Disturbed \(\mathbf{x}_{t+1}=A\mathbf{x}_t+\mathbf{w}_t\) System is affected by noise, shocks, or uncertainty.
Observed \(\mathbf{y}_t=C\mathbf{x}_t\) Outputs reveal only part of the internal state.

Forced and controlled systems lead directly toward state-space modeling and control systems, where inputs, outputs, controllability, and observability become central.

Back to top ↑

State-Space Modeling

State-space models describe systems using internal state variables, inputs, and outputs. A basic discrete-time state-space model is:

\[
\mathbf{x}_{t+1}=A\mathbf{x}_t+B\mathbf{u}_t
\]

Interpretation: The next state depends on the current state and an input vector.

\[
\mathbf{y}_t=C\mathbf{x}_t+D\mathbf{u}_t
\]

Interpretation: The observed output depends on the internal state and possibly the input.

This framework becomes central in control systems modeling, which follows later in this series. Here, the key point is that linear dynamical systems provide the foundation for representing evolving state, external influence, and observed output within one matrix-based structure.

State-space object Role Systems interpretation
\(A\) State transition matrix. Internal dynamics.
\(B\) Input matrix. How actions, shocks, or controls affect state.
\(C\) Output matrix. How internal state becomes observed measurement.
\(D\) Direct feedthrough matrix. Immediate effect of input on output.
\(\mathbf{u}_t\) Input vector. Decision, intervention, forcing, or external signal.
\(\mathbf{y}_t\) Output vector. Observed or reported system quantity.

State-space modeling clarifies the difference between what the system is, what acts on it, and what can be observed.

Back to top ↑

Linearization of Nonlinear Systems

Many real systems are nonlinear. Linear dynamical systems often appear as local approximations near an equilibrium or reference trajectory. For a nonlinear discrete-time system:

\[
\mathbf{x}_{t+1}=F(\mathbf{x}_t)
\]

Interpretation: The next state is produced by a nonlinear update rule.

Near an equilibrium \(\mathbf{x}^\ast\), small deviations may be approximated by:

\[
\Delta\mathbf{x}_{t+1}\approx J(\mathbf{x}^\ast)\Delta\mathbf{x}_t
\]

Interpretation: The Jacobian matrix gives a local linear dynamical approximation around the equilibrium.

This is one of the most important uses of linear dynamics: not because every system is linear, but because local linear structure can reveal stability, sensitivity, and modal behavior near a reference state.

Linearization step Mathematical role Modeling caution
Choose reference state Equilibrium or operating point. Different reference states may have different local dynamics.
Compute Jacobian Local derivative matrix. Derivative estimates may be uncertain or data-dependent.
Analyze eigenvalues Classify local modes. Local stability does not imply global stability.
Test perturbation size Check approximation range. Large deviations may leave the linear region.
Interpret in domain Translate local modes into system behavior. Mathematical modes need substantive validation.

Linearization is a bridge between nonlinear reality and linear analysis. It is useful only when the approximation remains visible as an approximation.

Back to top ↑

Continuous-Time Preview

Linear dynamical systems also appear in continuous time. Instead of updating from one step to the next, the state changes continuously according to a differential equation:

\[
\frac{d\mathbf{x}}{dt}=A\mathbf{x}
\]

Interpretation: The rate of change of the state is determined by a linear transformation of the current state.

The solution involves the matrix exponential:

\[
\mathbf{x}(t)=e^{At}\mathbf{x}(0)
\]

Interpretation: Continuous-time evolution is governed by the matrix exponential rather than ordinary matrix powers.

The next article, Matrix Differential Equations, develops this bridge in more detail. For now, the key distinction is that discrete-time dynamics use \(A^t\), while continuous-time dynamics use \(e^{At}\).

Time model State equation Evolution operator Stability signal
Discrete time \(\mathbf{x}_{t+1}=A\mathbf{x}_t\) \(A^t\) Eigenvalue magnitudes relative to \(1\).
Continuous time \(\frac{d\mathbf{x}}{dt}=A\mathbf{x}\) \(e^{At}\) Eigenvalue real parts relative to \(0\).
Affine discrete time \(\mathbf{x}_{t+1}=A\mathbf{x}_t+\mathbf{b}\) Matrix powers plus accumulated forcing. Matrix stability and input balance.
Controlled discrete time \(\mathbf{x}_{t+1}=A\mathbf{x}_t+B\mathbf{u}_t\) State transition plus input sequence. Stability, controllability, and response.

The distinction between discrete and continuous time is not technical bookkeeping. It determines which equations, stability rules, and computational tools are appropriate.

Back to top ↑

Simulation and Iteration

Linear dynamical systems can often be simulated directly. Starting from an initial state, repeatedly apply the update rule and record the trajectory. Simulation does not replace mathematical analysis, but it makes behavior visible and supports diagnostic checks.

\[
\mathbf{x}_{0},\ \mathbf{x}_{1},\ \mathbf{x}_{2},\ldots,\mathbf{x}_{T}
\]

Interpretation: A simulated trajectory records the state vector over a finite horizon.

Simulation element Purpose Diagnostic question
Initial state Starting point of trajectory. Are results sensitive to starting conditions?
Time horizon Number of simulated steps. Does the horizon match the decision context?
Matrix update Repeated transformation. Is the matrix valid over the whole horizon?
Trajectory output State sequence over time. Does behavior converge, grow, oscillate, or stabilize?
Scenario comparison Alternative matrices or inputs. How do interventions or assumptions change dynamics?

Simulation makes dynamics concrete, but a simulation is only as trustworthy as the matrix, inputs, time step, numerical method, and model assumptions behind it.

Back to top ↑

Numerical Reliability and Model Diagnostics

Linear dynamical systems are computationally convenient, but numerical reliability still matters. Repeated multiplication can amplify rounding error, reveal poor scaling, magnify unstable modes, or hide transient growth. Eigenvalue computations can be sensitive when matrices are ill-conditioned, nearly defective, nonnormal, or poorly scaled.

Diagnostic Purpose Interpretive warning
State norm over time Tracks growth, decay, or boundedness. Norm choice affects interpretation.
Spectral radius Checks asymptotic discrete-time stability. Nonnormal transient growth may still occur.
Eigenpair residuals Checks computed eigenvalues and eigenvectors. Small residuals do not prove domain meaning.
Conditioning Assesses sensitivity to perturbations. Ill-conditioned matrices produce fragile conclusions.
Scenario perturbation Tests robustness to plausible matrix changes. Stable conclusions should survive reasonable uncertainty.
Constraint checks Checks whether states remain physically meaningful. Linear updates may produce negative, impossible, or unbounded states.

Responsible computational workflows should treat linear dynamical outputs as auditable model claims, not merely generated arrays.

Back to top ↑

Linear Dynamics in Systems Modeling

Linear dynamical systems are widely used because they give modelers a structured way to connect current state, future state, feedback, stability, and long-run behavior. They can model repeated transitions, local perturbations, policy response, engineering control, resource evolution, diffusion, stage transitions, and iterative computation.

But the same clarity that makes linear dynamics useful can also make them dangerous if the system is nonlinear, discontinuous, threshold-driven, constrained, adaptive, strategic, or institutionally complex. The modeler should ask whether the linear update rule is a structural claim, a local approximation, a computational simplification, or a scenario-specific abstraction.

Domain Linear dynamical use Interpretive caution
Infrastructure Condition evolution, stress propagation, network response. Failure thresholds and cascading effects may be nonlinear.
Ecology Population stages, habitat transitions, disturbance response. Feedback, carrying capacity, and thresholds may dominate.
Economics Sector adjustment, input-output dynamics, shock propagation. Behavioral adaptation and institutions may change the matrix.
Public health State progression, intervention scenarios, compartment approximations. Contact patterns and behavior can be nonlinear and time-varying.
Engineering State-space response, stability, control design. Inputs, outputs, constraints, and uncertainty matter.
Computation Iterative algorithms, error propagation, convergence analysis. Floating-point effects and conditioning can affect conclusions.

Linear dynamical systems are best understood as structured models of change: powerful when the structure is justified, misleading when the simplification is forgotten.

Back to top ↑

Mathematical Deepening

This section adds a more formal layer. Linear dynamical systems connect state-space representation, matrix powers, eigenvalues, eigenvectors, diagonalization, Jordan structure, spectral radius, stability, equilibrium equations, affine systems, forced response, matrix exponentials, local linearization, numerical conditioning, controllability, observability, and model validation.

State Dynamics Review

State Vector

The state vector records the system variables at a specific time.

Update Matrix

The matrix defines how current-state variables contribute to next-state variables.

Trajectory

Repeated updates produce a sequence of states through state space.

Time Step

The update interval determines the meaning of the matrix and the dynamics.

Equilibrium Review

Fixed Point

An equilibrium remains unchanged under the update rule.

Null Space

Homogeneous fixed points satisfy \((A-I)\mathbf{x}^\ast=\mathbf{0}\).

Affine Balance

Forced equilibria balance internal dynamics and external input.

Local Equilibrium

Nonlinear systems can be studied near equilibrium through linearization.

Diagnostic Review

Norm Growth

Track whether state magnitude grows, decays, or remains bounded.

Conditioning

Review sensitivity of computations and modal interpretation.

Nonnormality

Check whether transient growth can occur despite asymptotic stability.

Constraint Validity

Verify that simulated states remain meaningful for the domain.

Governance Questions

What Does the State Mean?

Each coordinate should have a clear unit, scale, and domain interpretation.

Why Is the Update Linear?

The model should justify whether linearity is structural, local, empirical, or simplifying.

What Changes the Matrix?

Policy, climate, behavior, technology, feedback, and shocks can alter dynamics.

What Is the Valid Horizon?

A linear model may be reliable only over a specific time scale or perturbation range.

Back to top ↑

Examples from Systems Modeling

Linear dynamical systems appear wherever state variables evolve through repeated structured interaction.

Infrastructure Condition Dynamics

A state vector can represent asset conditions, while a matrix models deterioration, maintenance effects, and transition among operating states.

Population Stage Models

Age or stage classes can evolve through survival, growth, and reproduction matrices, revealing dominant long-run population modes.

Economic Adjustment Systems

Sector outputs, demand, or dependency states can evolve through repeated intersectoral adjustment and shock propagation.

Network Diffusion

Information, risk, stress, or influence can propagate through a network using linear update rules based on adjacency or transition matrices.

Control and Response Models

Engineering systems can use state-space matrices to describe how internal states respond to inputs and produce outputs.

Iterative Computational Methods

Error vectors can evolve through iteration matrices, allowing convergence and stability to be studied with eigenvalues.

Across these examples, the modeler must ask whether the state vector, matrix, time step, and linear update rule are substantively justified.

Back to top ↑

Computation and Reproducible Workflows

Computational workflows for linear dynamical systems should document the state variables, update matrix, time step, initial state, trajectory horizon, matrix powers, eigenvalues, spectral radius, state norms, equilibrium checks, forcing terms, constraint violations, sensitivity tests, scenario comparisons, and interpretation warnings.

The companion repository treats linear dynamical systems as auditable systems models. Python, R, Julia, SQL, Haskell, C, C++, Fortran, Rust, Go, notebooks, schemas, generated outputs, Canvas artifacts, advanced reports, and calculators each support a different layer of reproducible linear dynamics analysis.

For this article, the computational examples focus on repeated state updates, trajectory generation, spectral-radius diagnostics, norm tracking, equilibrium checks, and governance records for linear dynamical claims.

Back to top ↑

Python Workflow: Linear Dynamics Audit

The Python workflow below simulates a discrete-time linear dynamical system, records the trajectory, tracks state norms, computes a simple spectral-radius diagnostic for a two-mode example, and writes auditable outputs.

from __future__ import annotations

from dataclasses import asdict, dataclass
from pathlib import Path
import csv
import json
import math


Matrix = list[list[float]]
Vector = list[float]


@dataclass(frozen=True)
class LinearDynamicsAudit:
    system_name: str
    state_names: str
    update_matrix: str
    initial_state: str
    horizon: int
    final_state: str
    initial_norm: float
    final_norm: float
    eigenvalue_1: float
    eigenvalue_2: float
    spectral_radius: float
    stability_classification: str
    trajectory_warning: str
    interpretation_warning: str


def matvec(A: Matrix, x: Vector) -> Vector:
    return [sum(A[i][j] * x[j] for j in range(len(x))) for i in range(len(A))]


def norm2(x: Vector) -> float:
    return math.sqrt(sum(value * value for value in x))


def matrix_to_string(A: Matrix) -> str:
    return ";".join(",".join(f"{value:.6f}" for value in row) for row in A)


def vector_to_string(x: Vector) -> str:
    return ",".join(f"{value:.6f}" for value in x)


def trace_2x2(A: Matrix) -> float:
    return A[0][0] + A[1][1]


def determinant_2x2(A: Matrix) -> float:
    return A[0][0] * A[1][1] - A[0][1] * A[1][0]


def eigenvalues_2x2(A: Matrix) -> tuple[float, float]:
    trace = trace_2x2(A)
    determinant = determinant_2x2(A)
    discriminant = trace * trace - 4.0 * determinant
    if discriminant < 0:
        raise ValueError("This teaching routine handles real eigenvalues only.")
    root = math.sqrt(discriminant)
    return ((trace + root) / 2.0, (trace - root) / 2.0)


def classify_discrete(spectral_radius: float) -> str:
    if spectral_radius < 1.0:
        return "asymptotically_stable_discrete_time"
    if abs(spectral_radius - 1.0) <= 1e-10:
        return "boundary_or_marginal_discrete_time"
    return "unstable_discrete_time"


def simulate(A: Matrix, x0: Vector, horizon: int) -> list[Vector]:
    trajectory = [x0]
    current = x0
    for _ in range(horizon):
        current = matvec(A, current)
        trajectory.append(current)
    return trajectory


def build_audit() -> LinearDynamicsAudit:
    state_names = ["infrastructure_stress", "service_delay"]

    A = [
        [0.82, 0.12],
        [0.18, 0.76],
    ]

    x0 = [10.0, 4.0]
    horizon = 20
    trajectory = simulate(A, x0, horizon)
    final_state = trajectory[-1]

    eigenvalues = eigenvalues_2x2(A)
    spectral_radius = max(abs(value) for value in eigenvalues)

    return LinearDynamicsAudit(
        system_name="two_state_linear_dynamics_audit",
        state_names="|".join(state_names),
        update_matrix=matrix_to_string(A),
        initial_state=vector_to_string(x0),
        horizon=horizon,
        final_state=vector_to_string(final_state),
        initial_norm=round(norm2(x0), 12),
        final_norm=round(norm2(final_state), 12),
        eigenvalue_1=round(eigenvalues[0], 12),
        eigenvalue_2=round(eigenvalues[1], 12),
        spectral_radius=round(spectral_radius, 12),
        stability_classification=classify_discrete(spectral_radius),
        trajectory_warning=(
            "A finite simulated trajectory shows behavior over the chosen horizon, "
            "not necessarily all possible long-run behavior."
        ),
        interpretation_warning=(
            "Linear dynamics depend on state definitions, units, scaling, time step, "
            "matrix validity, constraint checks, and whether linearity is structural or approximate."
        ),
    )


def write_outputs(output_dir: Path) -> None:
    (output_dir / "tables").mkdir(parents=True, exist_ok=True)
    (output_dir / "json").mkdir(parents=True, exist_ok=True)

    audit = build_audit()
    row = asdict(audit)

    with (output_dir / "tables" / "linear_dynamics_audit.csv").open(
        "w", newline="", encoding="utf-8"
    ) as handle:
        writer = csv.DictWriter(handle, fieldnames=list(row.keys()))
        writer.writeheader()
        writer.writerow(row)

    (output_dir / "json" / "linear_dynamics_audit.json").write_text(
        json.dumps(row, indent=2, sort_keys=True),
        encoding="utf-8",
    )


if __name__ == "__main__":
    write_outputs(Path("outputs"))
    print("Linear dynamics audit complete.")

This workflow keeps the state definition, update matrix, trajectory, eigenvalue diagnostics, and interpretation warning together.

Back to top ↑

R Workflow: State Trajectory Diagnostics

R can support linear dynamical diagnostics by iterating state vectors, tracking norms, computing eigenvalues, and writing trajectory summaries.

A <- matrix(
  c(
    0.82, 0.12,
    0.18, 0.76
  ),
  nrow = 2,
  byrow = TRUE
)

state_names <- c("infrastructure_stress", "service_delay")
x0 <- c(10.0, 4.0)
horizon <- 20

trajectory <- matrix(NA, nrow = horizon + 1, ncol = length(x0))
trajectory[1, ] <- x0

for (t in seq_len(horizon)) {
  trajectory[t + 1, ] <- A %*% trajectory[t, ]
}

state_norms <- apply(trajectory, 1, function(row) sqrt(sum(row^2)))
eigen_values <- eigen(A)$values
spectral_radius <- max(Mod(eigen_values))

stability_classification <- ifelse(
  spectral_radius < 1,
  "asymptotically_stable_discrete_time",
  ifelse(abs(spectral_radius - 1) <= 1e-10, "boundary_or_marginal_discrete_time", "unstable_discrete_time")
)

audit_record <- data.frame(
  system_name = "two_state_linear_dynamics_audit",
  state_names = paste(state_names, collapse = "|"),
  update_matrix = paste(round(as.vector(t(A)), 6), collapse = ","),
  initial_state = paste(round(x0, 6), collapse = ","),
  horizon = horizon,
  final_state = paste(round(trajectory[horizon + 1, ], 6), collapse = ","),
  initial_norm = state_norms[1],
  final_norm = state_norms[horizon + 1],
  eigenvalues = paste(round(Re(eigen_values), 6), collapse = ","),
  spectral_radius = spectral_radius,
  stability_classification = stability_classification,
  interpretation_warning = paste(
    "Linear dynamics depend on state definitions, units, scaling, time step,",
    "matrix validity, constraint checks, and whether linearity is structural or approximate."
  )
)

dir.create("outputs/tables", recursive = TRUE, showWarnings = FALSE)

write.csv(
  audit_record,
  "outputs/tables/r_linear_dynamics_audit.csv",
  row.names = FALSE
)

trajectory_record <- data.frame(
  step = 0:horizon,
  infrastructure_stress = trajectory[, 1],
  service_delay = trajectory[, 2],
  state_norm = state_norms
)

write.csv(
  trajectory_record,
  "outputs/tables/r_linear_dynamics_trajectory.csv",
  row.names = FALSE
)

print(audit_record)

This R workflow makes the trajectory visible as data, not just as a final state or abstract matrix expression.

Back to top ↑

Haskell Workflow: Typed Dynamical Records

Haskell can represent linear dynamical diagnostics as a typed record, keeping the matrix, initial state, horizon, stability classification, and interpretation warning explicit.

module Main where

data LinearDynamicsAudit = LinearDynamicsAudit
  { systemName :: String
  , stateNames :: String
  , updateMatrix :: String
  , initialState :: String
  , horizon :: Int
  , finalState :: String
  , spectralRadius :: Double
  , stabilityClassification :: String
  , interpretationWarning :: String
  } deriving (Show)

buildAudit :: LinearDynamicsAudit
buildAudit =
  LinearDynamicsAudit
    "two_state_linear_dynamics_audit"
    "infrastructure_stress|service_delay"
    "0.820000,0.120000;0.180000,0.760000"
    "10.000000,4.000000"
    20
    "3.626170,3.452104"
    0.94
    "asymptotically_stable_discrete_time"
    "Linear dynamics depend on state definitions, units, scaling, time step, matrix validity, and whether linearity is structural or approximate."

main :: IO ()
main =
  print buildAudit

The typed workflow helps keep mathematical results attached to the modeling assumptions that make them meaningful.

Back to top ↑

SQL Workflow: Linear Dynamics Assumption Registry

SQL can document linear dynamical assumptions when model outputs support dashboards, audits, simulation pipelines, engineering review, infrastructure planning, economic analysis, or institutional decision systems.

CREATE TABLE linear_dynamics_assumption_registry (
    assumption_key TEXT PRIMARY KEY,
    assumption_name TEXT NOT NULL,
    mathematical_role TEXT NOT NULL,
    systems_modeling_role TEXT NOT NULL,
    review_warning TEXT NOT NULL
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'state_vector',
  'State vector',
  'Defines the coordinates of system state.',
  'Determines what the model can track over time.',
  'Missing or poorly scaled state variables can distort dynamics.'
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'update_matrix',
  'Update matrix',
  'Maps current state to next state.',
  'Encodes interaction, coupling, propagation, or transition structure.',
  'Matrix entries require units, source documentation, and validity review.'
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'time_step',
  'Time step',
  'Defines the interval between updates.',
  'Determines the meaning of repeated matrix powers.',
  'A matrix calibrated for one interval should not be reused at another interval without transformation.'
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'linearity',
  'Linearity assumption',
  'Assumes state variables combine through linear relationships.',
  'Simplifies system evolution into matrix multiplication.',
  'Thresholds, constraints, saturation, and feedback can violate linearity.'
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'stability',
  'Stability classification',
  'Uses eigenvalues and spectral radius to classify repeated behavior.',
  'Shows whether modes decay, persist, or amplify.',
  'Eigenvalue stability does not automatically imply practical safety or desirability.'
);

INSERT INTO linear_dynamics_assumption_registry VALUES
(
  'valid_horizon',
  'Valid horizon',
  'Limits how long repeated updates should be trusted.',
  'Defines the time range for credible simulation or interpretation.',
  'A linear model may be valid locally or temporarily, not indefinitely.'
);

SELECT
    assumption_name,
    mathematical_role,
    systems_modeling_role,
    review_warning
FROM linear_dynamics_assumption_registry
ORDER BY assumption_key;

This registry keeps linear dynamics tied to state-vector design, matrix construction, time-step clarity, linearity assumptions, stability classification, valid horizons, and responsible interpretation.

Back to top ↑

GitHub Repository

The companion repository for this article is designed as a reproducible mathematical-modeling workspace. It supports linear dynamics audits, state-vector trajectory simulation, matrix-power diagnostics, eigenvalue and spectral-radius reports, equilibrium checks, SQL governance tables, generated outputs, advanced mathematical audit reports, and reusable calculator scripts.

Back to top ↑

Interpretive Limits and Responsible Use

Linear dynamical systems are powerful because they make repeated system evolution mathematically tractable. They show how state variables interact, how trajectories form, how eigenmodes shape behavior, and how stability can be classified. Their limits arise because real systems often include nonlinear thresholds, adaptive behavior, constraints, saturation, discontinuities, strategic response, unobserved variables, changing regimes, and institutional feedback.

A linear dynamical model can be structural, local, empirical, or purely exploratory. These are different claims. A structural model asserts that the system itself follows a linear rule. A local model uses a linear approximation near an equilibrium. An empirical model fits observed transitions over a historical period. An exploratory model tests a scenario. Each use requires different standards of validation.

Responsible use requires documenting the state variables, units, scaling, time step, matrix source, update rule, initial conditions, simulation horizon, stability diagnostics, equilibrium claims, forcing terms, constraint checks, uncertainty, sensitivity tests, and whether the model is intended for explanation, forecasting, control, scenario analysis, or decision support. Linear dynamics should clarify system behavior without pretending that linear simplification is the system itself.

Back to top ↑

Back to top ↑

Further Reading

Back to top ↑

References

Back to top ↑

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top