Xmod Co-simulation Link May 2026
def set_state(self, state: Dict): pass xmod co-simulation master ---------------------------------------------------------------------- class XModCoSimulation: """Orchestrates coupled xmod models."""
def step(self, t: float, dt: float, inputs: Dict[str, np.ndarray]) -> XModStep: F_ext = inputs.get("F_ext", np.array([0.0]))[0] # Simple semi-implicit Euler a = (F_ext - self.k * self.x - self.c * self.v) / self.m self.v += a * dt self.x += self.v * dt return XModStep( outputs={"x": np.array([self.x]), "v": np.array([self.v])}, new_time=t + dt ) xmod co-simulation
sim.run(0.0, 2.0, log_callback=log)