Skip to content

Commit 649b21e

Browse files
authored
Update passivity.py
1 parent 0ecc135 commit 649b21e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

control/passivity.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
'''
55

66
import numpy as np
7-
import cvxopt as cvx
87

8+
try:
9+
import cvxopt as cvx
10+
except ImportError as e:
11+
cvx = None
912

1013
def is_passive(sys):
1114
'''
@@ -17,7 +20,9 @@ def is_passive(sys):
1720
The source for the algorithm is:
1821
McCourt, Michael J., and Panos J. Antsaklis. "Demonstrating passivity and dissipativity using computational methods." ISIS 8 (2013).
1922
'''
20-
23+
if cvx is None:
24+
raise ModuleNotFoundError
25+
2126
A = sys.A
2227
B = sys.B
2328
C = sys.C

0 commit comments

Comments
 (0)