120def lemma1_lift(R_y: Zonotope, km: lk.KoopmanModel, ns: NormalizedSets) -> Zonotope:
121 """Line 6: R^Phi = H_Phi^+ (R^y - Z_theta) + (I_M - H_Phi^+ H_Phi) Z_sigma."""
122 Hp = np.linalg.pinv(km.H_Phi)
123 P_null = np.eye(km.M) - Hp @ km.H_Phi
124 c_theta = km.c_theta_normalized()
125 return Hp @ ((R_y - ns.Z_theta) - c_theta) + P_null @ ns.Z_sigmaσ enters
⋮
128def step(R_Phi: Zonotope, Z_in: Zonotope, km: lk.KoopmanModel, ns: NormalizedSets, Z_delta: Zonotope) -> Zonotope:
129 """Line 7: R^y_{k+1} = H_Phi K (R^Phi x Z_in) + H_Phi Z_omegaPhi + Z_theta + Z_delta."""
130 HK = km.H_Phi @ km.K
131 return HK @ R_Phi.cartesian(Z_in) + km.H_Phi @ ns.Z_omegaPhi + ns.Z_theta + Z_deltapad by Z_δ
⋮
166 for k in range(P):
167 R_Phi = lemma1_lift(R_y, km, ns)
168 R_y = step(R_Phi, seq[k], km, ns, Z_delta)
169 lifted.append(R_Phi)
170 out_n.append(R_y)