import sympy as sp def auswahlmatrix_E(u: int, aktive_unbekannte_indices: Iterable[int]) -> sp.Matrix: E = sp.zeros(u, u) for idx in aktive_unbekannte_indices: E[int(idx), int(idx)] = 1 return E def raenderungsmatric_G(): def teilspurminimierung_Gi(G: sp.Matrix, E: sp.Matrix) -> sp.Matrix: Gi = E * G return Gi