summaryrefslogtreecommitdiff
path: root/hw2/prob_1.py
blob: e26a5fcdeb17e6697e83a4247744718679cb6f81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal

t = [0.001 * x for x in range(0, 141)]
y = [0.873
     - 0.873 * np.exp(-46 * t) * np.cos(105.4 * t)
     - 0.381 * np.exp(-46 * t) * np.sin(105.4 * t) for t in t]

# plt.plot(t, y)
# plt.xlabel('t (sec)')
# plt.ylabel('y(t)')
# plt.title('MAE 171A - Homework 2.1\n Output y(t)')
# plt.show()

# numH = []
# denH =
# sysH = signal.TransferFunction(numH, denH)
# impulse = signal.impulse(sysH)

system = ([11550], [1, 92, 13225, 0])
t, y = signal.impulse2(system)
plt.plot(t, y)

# y_s = [11550 / (t * (t**2 + 92 * t + 13225)) for t in t]

# plt.plot(impulse)
plt.xlabel('t (sec)')
plt.ylabel('Amplitude')
plt.title('MAE 171A - Homework 2.1\n Impulse Response')
plt.show()
Copyright 2019--2024 Marius PETER