Skip to content
Merged
4 changes: 2 additions & 2 deletions control/iosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,8 @@ def _compute_static_io(self, t, x, u):
ysys.reshape((-1,))

# Store the input in the second part of ylist
ylist[noutputs + output_index:
noutputs + output_index + sys.ninputs] = \
ylist[noutputs + input_index:
noutputs + input_index + sys.ninputs] = \
ulist[input_index:input_index + sys.ninputs]

# Increment the index pointers
Expand Down
6 changes: 3 additions & 3 deletions examples/cruise-control.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def vehicle_update(t, x, u, params={}):
Fg = m * g * sin(theta)

# A simple model of rolling friction is Fr = m g Cr sgn(v), where Cr is
# the coefficient of rolling friction and sgn(v) is the sign of v (±1) or
# the coefficient of rolling friction and sgn(v) is the sign of v (+/- 1) or
# zero if v = 0.

Fr = m * g * Cr * sign(v)

# The aerodynamic drag is proportional to the square of the speed: Fa =
# 1/\rho Cd A |v| v, where ρ is the density of air, Cd is the
# 1/\rho Cd A |v| v, where \rho is the density of air, Cd is the
# shape-dependent aerodynamic drag coefficient, and A is the frontal area
# of the car.

Expand Down Expand Up @@ -301,7 +301,7 @@ def cruise_plot(sys, t, y, t_hill=5, vref=20, antiwindup=False,
while min(y[v_ind]) < v_min: v_min -= 1

# Create arrays for return values
subplot_axes = subplots.copy()
subplot_axes = list(subplots)

# Velocity profile
if subplot_axes[0] is None:
Expand Down