Skip to content

Commit b73e6fe

Browse files
author
Mark
committed
Address some review comments.
1 parent 649b21e commit b73e6fe

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/python-package-conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66
test-linux:
7-
name: Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.pandas && ', with pandas' || '' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}
7+
name: Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.pandas && ', with pandas' || '' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}${{ matrix.cvxopt && format(' with cvxopt from {0}', matrix.cvxopt) || ' without cvxopt' }}
88
runs-on: ubuntu-latest
99

1010
strategy:

control/passivity.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
except ImportError as e:
1111
cvx = None
1212

13+
1314
def is_passive(sys):
1415
'''
1516
Indicates if a linear time invarient system is passive
@@ -18,11 +19,13 @@ def is_passive(sys):
1819
such that is a solution exists, the system is passive.
1920
2021
The source for the algorithm is:
21-
McCourt, Michael J., and Panos J. Antsaklis. "Demonstrating passivity and dissipativity using computational methods." ISIS 8 (2013).
22+
McCourt, Michael J., and Panos J. Antsaklis.
23+
"Demonstrating passivity and dissipativity using computational methods." ISIS 8 (2013).
2224
'''
2325
if cvx is None:
26+
print("cvxopt required for passivity module")
2427
raise ModuleNotFoundError
25-
28+
2629
A = sys.A
2730
B = sys.B
2831
C = sys.C
@@ -35,13 +38,12 @@ def make_LMI_matrix(P):
3538
)
3639
return V
3740

38-
P = np.zeros_like(A)
3941
matrix_list = []
4042
state_space_size = sys.nstates
4143
for i in range(0, state_space_size):
4244
for j in range(0, state_space_size):
4345
if j <= i:
44-
P = P*0.0
46+
P = np.zeros_like(A)
4547
P[i, j] = 1.0
4648
P[j, i] = 1.0
4749
matrix_list.append(make_LMI_matrix(P).flatten())

0 commit comments

Comments
 (0)