Код: Выделить всё
import numpy as np
from harold import Transfer, simulate_linear_system
import matplotlib.pyplot as plt
from scipy import signal
nbr_inputs = 5
t_in = np.arange(0, 10, 0.2)
dim = (nbr_inputs, len(t_in))
x = np.cumsum(np.random.normal(0, 2e-3, dim), axis=1)
H = Transfer([[[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 1, 5]]], [[[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 1, 5]]])
y, t = simulate_linear_system(H, x.T, t_in[0:1], per_channel=True)
y = y.squeeze()
plt.plot(t, y)
plt.xlabel('Time')
plt.ylabel('Output')
plt.title('System Output Response')
plt.legend(['Input 1', 'Input 2', 'Input 3', 'Input 4', 'Input 5'])
plt.show()
для i в диапазоне (x.shape[1]):
'y[:, i], _ = имитация_линейной_системы(H, x.T, t_in, per_channel=True)'
но ошибка: массив времени должен быть одномерным массивом.
Я хочу сделать одношаговый кратный входной сигнал
Подробнее здесь: https://stackoverflow.com/questions/790 ... or-onestep