Skip to content
Menu

6. Solution of Time-Invariant State-Space Equations

Once a state-space model is formed, this chapter solves it explicitly — both the continuous-time and discrete-time responses — showing how state and output trajectories follow directly from the system matrices.

PowerPoint handouts: Dark · Light

link to download code

This chapter’s closed-form solution to the state equation relies on the matrix exponential e^(At), defined via the same infinite series as the ordinary exponential: e^x = sum_(n=0)^inf x^n/n!. Before working with the matrix version, it’s worth seeing that series converge for a plain scalar.

Setting x=1 gives e = sum_(n=0)^inf 1/n! — this sums the partial series out to n=10 and plots them against the true value of e, showing the partial sums converge to the familiar 2.71828… within just a handful of terms.

import math
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import io, base64
print("math.e =", math.e)
N = 10
eapprox = [sum(1 / math.factorial(k) for k in range(n)) for n in range(1, N + 1)]
print("Partial sums of sum_(n=0)^inf 1/n! :")
print([round(v, 10) for v in eapprox])
fig, ax = plt.subplots()
ax.scatter(range(N), eapprox, color="r", label="partial sum")
ax.plot(range(N), [math.e] * N, "b.", label="e")
ax.set_xlim(0, N)
ax.set_ylim(0, 3)
ax.set_xlabel("n")
ax.set_xticks(range(N + 1))
ax.set_ylabel("Convergence of sum 1/n!")
ax.legend()
plt.tight_layout()
buf = io.BytesIO()
plt.savefig(buf, format="png", dpi=100)
plot_b64 = base64.b64encode(buf.getvalue()).decode()

Convergence of the series for e (mcimp/codes/sssolution/number_e.py)

Click "Run" to execute.

← All chapters