Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 56 additions & 59 deletions Examples/ARX_MIMO.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,62 +161,59 @@

######plot
#
import os

if 'DISPLAY' in os.environ:
import matplotlib.pyplot as plt

plt.close('all')
plt.figure(0)
plt.subplot(4, 1, 1)
plt.plot(Time, Usim[0, :])
plt.grid()
plt.ylabel("Input 1 PRBS")
plt.xlabel("Time")
plt.title("Input (Switch probability=0.03)")

plt.subplot(4, 1, 2)
plt.plot(Time, Usim[1, :])
plt.grid()
plt.ylabel("Input 2 PRBS")
plt.xlabel("Time")

plt.subplot(4, 1, 3)
plt.plot(Time, Usim[2, :])
plt.ylabel("Input 3 PRBS")
plt.xlabel("Time")
plt.grid()

plt.subplot(4, 1, 4)
plt.plot(Time, Usim[3, :])
plt.ylabel("Input 4 PRBS")
plt.xlabel("Time")
plt.grid()

plt.figure(3)
plt.subplot(3, 1, 1)
plt.plot(Time, Ytot1)
plt.plot(Time, Yout_id[:, 0])
plt.ylabel("y_1,out")
plt.grid()
plt.xlabel("Time")
plt.title("Gu (identification data)")
plt.legend(['Original system', 'Identified system'])

plt.subplot(3, 1, 2)
plt.plot(Time, Ytot2)
plt.plot(Time, Yout_id[:, 1])
plt.ylabel("y_2,out")
plt.grid()
plt.xlabel("Time")
plt.legend(['Original system', 'Identified system'])

plt.subplot(3, 1, 3)
plt.plot(Time, Ytot3)
plt.plot(Time, Yout_id[:, 2])
plt.ylabel("y_3,out")
plt.grid()
plt.xlabel("Time")
plt.legend(['Original system', 'Identified system'])

plt.show()
import matplotlib.pyplot as plt

plt.close('all')
plt.figure(0)
plt.subplot(4, 1, 1)
plt.plot(Time, Usim[0, :])
plt.grid()
plt.ylabel("Input 1 PRBS")
plt.xlabel("Time")
plt.title("Input (Switch probability=0.03)")

plt.subplot(4, 1, 2)
plt.plot(Time, Usim[1, :])
plt.grid()
plt.ylabel("Input 2 PRBS")
plt.xlabel("Time")

plt.subplot(4, 1, 3)
plt.plot(Time, Usim[2, :])
plt.ylabel("Input 3 PRBS")
plt.xlabel("Time")
plt.grid()

plt.subplot(4, 1, 4)
plt.plot(Time, Usim[3, :])
plt.ylabel("Input 4 PRBS")
plt.xlabel("Time")
plt.grid()

plt.figure(3)
plt.subplot(3, 1, 1)
plt.plot(Time, Ytot1)
plt.plot(Time, Yout_id[:, 0])
plt.ylabel("y_1,out")
plt.grid()
plt.xlabel("Time")
plt.title("Gu (identification data)")
plt.legend(['Original system', 'Identified system'])

plt.subplot(3, 1, 2)
plt.plot(Time, Ytot2)
plt.plot(Time, Yout_id[:, 1])
plt.ylabel("y_2,out")
plt.grid()
plt.xlabel("Time")
plt.legend(['Original system', 'Identified system'])

plt.subplot(3, 1, 3)
plt.plot(Time, Ytot3)
plt.plot(Time, Yout_id[:, 2])
plt.ylabel("y_3,out")
plt.grid()
plt.xlabel("Time")
plt.legend(['Original system', 'Identified system'])

plt.show()