import sympy
import control as ct
import numpy as np
num = [4, 6, 10]
den = [1, 4, 6, 10]
system = ct.tf(num,den)
system
#u(t)를 입력할 경우.
num_us = [1]
den_us = [1, 0]
Us = ct.tf(num_us, den_us)
Us
system_GU = system * Us
system_GU
#u(t)를 입력으로 놓을 경우, error
system_error = ct.tf([1], [1, 4, 6, 10, 0])
system_error
ct.step_info(system)
{'RiseTime': 0.31135134292033206, 'SettlingTime': 6.849729544247305, 'SettlingMin': 0.8240077331892378, 'SettlingMax': 1.3315308280991212, 'Overshoot': 33.153082809912114, 'Undershoot': 0, 'Peak': 1.3315308280991212, 'PeakTime': 0.9340540287609962, 'SteadyStateValue': 1.0}
import matplotlib.pyplot as plt
# Time vector
time, response = ct.step_response(system)
# Plot the step response
plt.plot(time, response)
plt.title('Step Response')
plt.xlabel('Time (seconds)')
plt.ylabel('Amplitude')
plt.grid(True)
plt.show()