We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa92b65 commit ffcc2a6Copy full SHA for ffcc2a6
control/optimal.py
@@ -746,9 +746,9 @@ def _compute_states_inputs(self, coeffs):
746
states = self.last_states
747
else:
748
states = self._simulate_states(self.x, inputs)
749
- self.last_x = self.x
750
- self.last_states = states
751
- self.last_coeffs = coeffs
+ self.last_x = self.x.copy() # save initial state
+ self.last_states = states # always a new object
+ self.last_coeffs = coeffs.copy() # save coefficients
752
753
return states, inputs
754
0 commit comments