diff --git a/src/opinf/models/mono/_nonparametric.py b/src/opinf/models/mono/_nonparametric.py index 8aebd7e4..df195a08 100644 --- a/src/opinf/models/mono/_nonparametric.py +++ b/src/opinf/models/mono/_nonparametric.py @@ -373,7 +373,7 @@ def rhs(self, state, input_=None): Evaluation of the right-hand side of the model. """ state = np.atleast_1d(state) - out = np.zeros(state.shape, dtype=float) + out = np.zeros(state.shape, dtype=state.dtype) for op in self.operators: out += op.apply(state, input_) return out @@ -402,7 +402,7 @@ def jacobian(self, state, input_=None): State Jacobian of the right-hand side of the model. """ r = self.state_dimension - out = np.zeros((r, r), dtype=float) + out = np.zeros((r, r), dtype=state.dtype) for op in self.operators: out += op.jacobian(state, input_) return out