# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %load_ext autoreload
# %autoreload 2  # automatically reload modules when changed
import simba
from sympy import symbols, simplify, init_printing, Matrix, MatrixSymbol, Rational, adjoint, Symbol
init_printing()

# The unstable filter transfer function is given by,
#
# $$
# G(s) = \frac{s - 2}{s + 2}
# $$

s = symbols('s')
tf = (s - 2) / (s + 2)
tf

ss = simba.transfer_function_to_state_space(tf).extended_to_quantum()
a, b, c, d = ss
ss

# Convert to a physically realisable state space

ss = ss.to_physically_realisable()
assert ss.is_physically_realisable
ss

slh = ss.to_slh('a')
slh

StarcoderdataJupyterScriptsDedupFiltered