Hallo Zusammen
Wie kann ich in Spyder mehrere Plots anzeigen lassen (P-Z, Bode, Step response). Momentan wird mir jeweils nur der letzte Plot generiert/angezeigt:
...
# P-Z Map
control.pzmap(H)
# Bode Plot
mag, phase, omega = control.bode(H)
# Step Response
t, y = control.step_response(H)
plt.plot(t, y)
plt.title("Step Response")
plt.grid()
control.pzmap(H)
Mehrere Plots in Spyder
-
- User
- Beiträge: 2
- Registriert: Freitag 3. Februar 2023, 13:17
# Ganzer Code:
# pip install control
import numpy as np
import control
import matplotlib.pyplot as plt
num = np.array([1])
den = np.array([1, 2, 1])
# Transfer Function
H = control.tf(num, den)
print('H(s) =', H)
# Zeros
z = control.zero(H)
print('z =', z)
# Poles
p = control.pole(H)
print('p =', p)
# P-Z Map
control.pzmap(H)
# Ab hier rest auskommentieren -> pz-map wird geplottet ---------------------
# Bode Plot
mag, phase, omega = control.bode(H)
# Ab hier rest auskommentieren -> Bodeplot wird geplottet -------------------
# Step Response
t, y = control.step_response(H)
plt.plot(t, y)
plt.title("Step Response")
plt.grid()
# Step response wird über Bodeplot gelegt :-S -------------------------------
# pip install control
import numpy as np
import control
import matplotlib.pyplot as plt
num = np.array([1])
den = np.array([1, 2, 1])
# Transfer Function
H = control.tf(num, den)
print('H(s) =', H)
# Zeros
z = control.zero(H)
print('z =', z)
# Poles
p = control.pole(H)
print('p =', p)
# P-Z Map
control.pzmap(H)
# Ab hier rest auskommentieren -> pz-map wird geplottet ---------------------
# Bode Plot
mag, phase, omega = control.bode(H)
# Ab hier rest auskommentieren -> Bodeplot wird geplottet -------------------
# Step Response
t, y = control.step_response(H)
plt.plot(t, y)
plt.title("Step Response")
plt.grid()
# Step response wird über Bodeplot gelegt :-S -------------------------------