Skip to content

Commit 5d71c4d

Browse files
committed
Clean up the developer branch before merging
The most recent version of tester.py contains information that, while going to be deleted at some point, is as of now still useful
1 parent 62ef7ef commit 5d71c4d

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

tester.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import control as c
2+
from control.xferfcn import clean_tf
3+
from control.statesp import clean_ss
4+
from control.timeresp import fival
25
import numpy as np
36

47
ci = 2 / np.sqrt(13)
@@ -14,10 +17,21 @@
1417
H = c.tf([[Hq.num[0][0], Htheta.num[0][0]], [Hgamma.num[0][0], Hh.num[0][0]]],
1518
[[Hq.den[0][0], Htheta.den[0][0]], [Hgamma.den[0][0], Hh.den[0][0]]])
1619
sys1 = c.ss(H)
17-
sys1.D = np.array([[1, 2], [3, 4]]) # Changes it to a non-zero input matrix D
20+
sys1.D = np.array([[1, 2], [3e-13, 4]]) # Changes it to a non-zero input matrix D
1821

1922
H = c.tf(sys1) # Gives a tf with nice unrounded residual components
2023

2124
H2 = c.tf([1, -3, 0, 0], [1, 1e-13, 7, 0, 0, 0]) # to test minreal things
2225

23-
print(H)
26+
print(H.clean())
27+
#print(sys1)
28+
#print(H.clean(input = 1, output = 2, precision = 9))
29+
#print(sys1.clean(precision = 12))
30+
#print(clean_tf(sys1, input = 1, output = 2, precision = 1))
31+
#print(clean_tf(H, input = 2, output = 2, precision = 8))
32+
#print(clean_ss(sys1, precision = 2))
33+
#print(clean_ss(H, precision = 12))
34+
print(H.fival(forcing="step", input=1, output=1, stabilityCheck=True))
35+
print(sys1.fival(forcing="step", input=2, stabilityCheck=True, precision=17))
36+
print(fival(H, forcing="step", output=2, stabilityCheck=True, precision=3))
37+
print(fival(sys1, forcing="step", input=2, output=2, precision=10))

0 commit comments

Comments
 (0)