Overview

SymPy 1.12, released on May 11, 2023, improves the control systems module and plotting capabilities.

Main Features

Control systems

The sympy.physics.control module gains new transfer functions and stability analysis for dynamic system modeling.

python
from sympy.physics.control.lti import TransferFunction
from sympy import symbols

s = symbols('s')

# Second order system transfer function
G = TransferFunction(1, s**2 + 2*s + 1, s)
print(f'Poles: {G.poles()}')
print(f'Zeros: {G.zeros()}')
print(f'Stable: {G.is_stable()}')

Improved plotting

The plotting module supports new chart types and improves axis and legend customization.

python
from sympy import symbols, sin, cos
from sympy.plotting import plot

x = symbols('x')

# Plot multiple functions
p = plot(
    sin(x), cos(x), sin(x) + cos(x),
    (x, -2 * 3.14, 2 * 3.14),
    legend=True,
    show=False,
)
p.title = 'Trigonometric functions'
# p.show()

Sources