Implementing equality constraints using Structured Parameterization
Show older comments
I have a system such that
sys_init = idss(A_init, B_init, C_init, D, K, x0, Ts);
My A matrix is NxN in dimension. These demensions are set by a variable called Order, which is any odd integer above zero
I am trying to constrain pairs of two's of my diagonal values of my A matrix (besides the first point A(1,1)) to equal eachother such that A(2,2) = A(3,3), A(4,4) = A(5,5). A(4,4) does not have to equal A(2,2), its is just the pair that I want. I am also trying to set a constraint such that A(2,1) = -A(1,2). Currently, I am trying to set these constraints by using these lines
for i = 2:2:order
sys_init.Structure.A.Value(i+1, i+1) = sys_init.Structure.A.Value(i, i);
sys_init.Structure.A.Free(i, i+1) = true;
sys_init.Structure.A.Value(i+1, i) = -sys_init.Structure.A.Value(i, i+1);
end
Here is an example of what a correct form of order nine would look like

Once I finish denifing my systems, I estimate a state space model to match an input and output with the line
sys = ssest(u', y', sys_init);
However, when I run this code, the equality constraints I detail above do not set. Here is an example output.

How can I define my equality constraints so that they are implemented correctly? Thank you.
Answers (1)
Aabha
on 25 Feb 2025
The issue might be in the “for” loop of the code. In the current code, only the diagonal elements with odd indices are being frozen. Adding few more constraints in the loop should solve the problem. I tried the following code, with random values for initial matrices, and it is working for me.
for i = 2:2:order-1
sys_init.Structure.A.Value(i+1, i+1) = sys_init.Structure.A.Value(i, i);
sys_init.Structure.A.Free(i, i) = false;
sys_init.Structure.A.Free(i+1, i+1) = false;
sys_init.Structure.A.Value(i+1, i) = -sys_init.Structure.A.Value(i, i+1);
sys_init.Structure.A.Free(i+1, i) = false;
sys_init.Structure.A.Free(i, i+1) = false;
end

After executing the command
sys = ssest(u', y', sys_init);
the matrix values are constrained as expected.

I hope this is helpful to you.
1 Comment
Categories
Find more on Linear Model Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!