How can I derive input from output of an ARX model?

2 views (last 30 days)
I constructed an 2 order ARX model:
na = [1 -1.885 0.9054]
nb = [0 -0.06796 0.08773];
nk = 1
m_arx = idpoly([1 -1.885 0.9054],[0 -0.06796 0.08773]);
Its time domain expression is as follows:
y = zeros(length(u),1);
y(1) = 0;
y(2) = -0.068*u(1)+1.885*y(1);
for t = 3:1:length(u)
y(t) = (-0.068)*u(t-1) + 0.0877*u(t-2) + 1.885*y(t-1) - 0.9054*y(t-2);
end
where u is input, y is output siganl
Now, i want to derive input from the output of the model, so i invert the model as follows
u_sim = zeros(1000,1);
u_sim(1) = ((-1)*y(2) + 1.885*y(1))/0.068;
for t = 3:1:length(y)
u_sim(t-1) =(0.0877*u_sim(t-2)+ (-1)*y(t) + 1.885*y(t-1)- 0.9054*y(t-2))/0.068;
end
However, the simulated result u_sim(t) is completely different with the meaursured input u(t).
Figure 1 is the measured input u(t):
Figure 2 is the simulated input u_sim(t):
How Can I derive input from output of an ARX model?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!