From 5803127930a06db2c9b31a7a37da8a0923474328 Mon Sep 17 00:00:00 2001 From: CPCLAB-UNIPI <40467044+CPCLAB-UNIPI@users.noreply.github.com> Date: Mon, 15 Jul 2019 13:08:35 +0200 Subject: [PATCH] Update ARX_MIMO.py Removing 'DISPLAY' check when plotting --- Examples/ARX_MIMO.py | 115 +++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/Examples/ARX_MIMO.py b/Examples/ARX_MIMO.py index 8f692d4..627d486 100755 --- a/Examples/ARX_MIMO.py +++ b/Examples/ARX_MIMO.py @@ -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()