Skip to content

Commit e2346cd

Browse files
authored
Small fixes to iosys (#312)
* Remove bad characters in comments (py2.7 incompatibilities) * Use list() to create copy in py2.7
1 parent d267fa2 commit e2346cd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

control/iosys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,8 @@ def _compute_static_io(self, t, x, u):
10851085
ysys.reshape((-1,))
10861086

10871087
# Store the input in the second part of ylist
1088-
ylist[noutputs + output_index:
1089-
noutputs + output_index + sys.ninputs] = \
1088+
ylist[noutputs + input_index:
1089+
noutputs + input_index + sys.ninputs] = \
10901090
ulist[input_index:input_index + sys.ninputs]
10911091

10921092
# Increment the index pointers

examples/cruise-control.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def vehicle_update(t, x, u, params={}):
8484
Fg = m * g * sin(theta)
8585

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

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

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

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

303303
# Create arrays for return values
304-
subplot_axes = subplots.copy()
304+
subplot_axes = list(subplots)
305305

306306
# Velocity profile
307307
if subplot_axes[0] is None:

0 commit comments

Comments
 (0)