p3(visualise.py): update titles,labels

This commit is contained in:
leo 2023-03-15 19:00:59 +01:00
parent a232dd2500
commit a5a6d08f83
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -43,30 +43,31 @@ plt.close()
theta = pd.read_csv('data/theta.csv', header=None) theta = pd.read_csv('data/theta.csv', header=None)
# theta = np.transpose(theta) # -> no need to transpose. # theta = np.transpose(theta) # -> no need to transpose.
th_columns = ["$ \hat{a}_1 $","$ \hat{a}_2 $","$ \hat{b}_1 $","$ \hat{b}_2 $"] th_columns = ["$\hat{a}_1 $", "$\hat{a}_2 $", "$\hat{b}_1$", "$\hat{b}_2$"]
for i in theta: for i in theta:
plt.plot(theta[i], label=th_columns[i]) plt.plot(theta[i], label=th_columns[i])
plt.locator_params(axis='x', nbins=12) plt.locator_params(axis='x', nbins=12)
plt.legend() plt.legend()
plt.xlabel("$ \mathit{k}T $") plt.xlabel("$\mathit{k}T$")
plt.title("ARX Theta (Θ) Parameter Estimation using Recursive Least Squares") plt.title("ARX Theta (θ) Parameter Estimation using RLSq")
plt.savefig('res/theta.png', dpi=300) plt.savefig('res/theta.png', dpi=300)
plt.clf() plt.clf()
error = pd.read_csv('data/estimate_error.csv', header=None) error = pd.read_csv('data/estimate_error.csv', header=None)
plt.plot(error, label="$ ê(\mathit{k}T) $") plt.plot(error, label="$\hat{e}(\mathit{k}T)$")
plt.locator_params(axis='x', nbins=12) plt.locator_params(axis='x', nbins=12)
plt.legend() plt.legend()
plt.xlabel("$ \mathit{k}T $") plt.xlabel("$\mathit{k}T$")
plt.title("ARX RLSq Theta (Θ) Parameter Estimation Error") plt.title("Error of ARX Theta (θ) Parameter Estimation using RLSq")
plt.savefig('res/error.png', dpi=300) plt.savefig('res/error.png', dpi=300)
plt.clf() plt.clf()
explicitTheta = pd.read_csv('data/explicit_theta.csv', header=None) explicitTheta = pd.read_csv('data/explicit_theta.csv', header=None)
eTx = explicitTheta[0:4] eTx = explicitTheta[0:4]
eTy = explicitTheta[4:8] eTy = explicitTheta[4:8]
eTxy = [eTx, eTy] eTxy = [eTx, eTy]
@ -76,10 +77,10 @@ print(explicitTheta)
explicitError = pd.read_csv('data/explicit_error.csv', header=None) explicitError = pd.read_csv('data/explicit_error.csv', header=None)
plt.plot(explicitError, label="$ ê(\mathit{k}T) $") plt.plot(explicitError, label="$ê(\mathit{k}T)$")
plt.locator_params(axis='x', nbins=12) plt.locator_params(axis='x', nbins=12)
plt.legend() plt.legend()
plt.xlabel("$ \mathit{k}T $") plt.xlabel("$\mathit{k}T$")
plt.title("ARX ELSq Theta (Θ) Parameter Estimation Error") plt.title("Error of ARX Theta (θ) Parameter Estimation using ELSq")
plt.savefig('res/explicit_error.png', dpi=300) plt.savefig('res/explicit_error.png', dpi=300)
plt.clf() plt.clf()