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 = 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:
plt.plot(theta[i], label=th_columns[i])
plt.locator_params(axis='x', nbins=12)
plt.legend()
plt.xlabel("$ \mathit{k}T $")
plt.title("ARX Theta (Θ) Parameter Estimation using Recursive Least Squares")
plt.xlabel("$\mathit{k}T$")
plt.title("ARX Theta (θ) Parameter Estimation using RLSq")
plt.savefig('res/theta.png', dpi=300)
plt.clf()
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.legend()
plt.xlabel("$ \mathit{k}T $")
plt.title("ARX RLSq Theta (Θ) Parameter Estimation Error")
plt.xlabel("$\mathit{k}T$")
plt.title("Error of ARX Theta (θ) Parameter Estimation using RLSq")
plt.savefig('res/error.png', dpi=300)
plt.clf()
explicitTheta = pd.read_csv('data/explicit_theta.csv', header=None)
eTx = explicitTheta[0:4]
eTy = explicitTheta[4:8]
eTxy = [eTx, eTy]
@ -76,10 +77,10 @@ print(explicitTheta)
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.legend()
plt.xlabel("$ \mathit{k}T $")
plt.title("ARX ELSq Theta (Θ) Parameter Estimation Error")
plt.xlabel("$\mathit{k}T$")
plt.title("Error of ARX Theta (θ) Parameter Estimation using ELSq")
plt.savefig('res/explicit_error.png', dpi=300)
plt.clf()