How to predict a partial state-space model by specifying an initial state-space model.
2 views (last 30 days)
Show older comments
Using this link (https://jp.mathworks.com/help/ident/ref/ssest.html#btpb7ww-5) as a reference, I predicted a state-space model using tt data as gray-box modeling with system identification.
I constructed init_sys and tried to estimate only the "NaN" part of the matrix, leaving the other elements as fixed values.
However, the output matrices were all free coefficients.
How can I estimate only the "NaN" part?
I thought that specifying "NaN" was not a good idea, so I put the nominal values in init_sys, but the output results were exactly the same as the nominal values.
Is it still dependent on the initial value matrix?
Code is following (This is a linear approximation model of cart pole.)
%grayboxmodeling
% State Space
A = [0 1 0 0
0 0 NaN 0
0 0 0 1
0 0 NaN 0];
B = [0
NaN
0
NaN];
C = eye(4);
D = zeros(4,1);
K = zeros(4,4);
x0 = [0;
0;
-0.03;
0];
Ts = 0.02;
init_sys = idss(A,B,C,D,K,x0,Ts);
apar = init_sys.Structure.A;
apar.Free(1,:) = false;
apar.Free(2,1) = false;
apar.Free(2,2) = false;
apar.Free(2,3) = true;
apar.Free(2,4) = false;
apar.Free(3,:) = false;
apar.Free(4,1) = false;
apar.Free(4,2) = false;
apar.Free(4,4) = false;
init_sys.Structure.A = apar;
bpar = init_sys.Structure.B;
bpar.Free(1,1) = false;
bpar.Free(3,1) = false;
init_sys.Structure.B = bpar;
init_sys.Structure.C.Free = false;
sysgray = ssest(tt,init_sys)
0 Comments
Accepted Answer
Tianyu
on 1 May 2024
NaN is not accepted since the estimation requires a valid initial value to start.
The following code works for me.
%grayboxmodeling
load sdata2 tt2
tt = tt2;
% State Space
A = [0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0];
B = [0
1
0
1];
C = eye(1,4);
D = zeros(1,1);
K = zeros(4,1);
x0 = [0;
0;
-0.03;
0];
Ts = 0.1;
init_sys = idss(A,B,C,D,K,x0,Ts);
apar = init_sys.Structure.A;
apar.Free(1,:) = false;
apar.Free(2,1) = false;
apar.Free(2,2) = false;
apar.Free(2,3) = true;
apar.Free(2,4) = false;
apar.Free(3,:) = false;
apar.Free(4,1) = false;
apar.Free(4,2) = false;
apar.Free(4,4) = false;
init_sys.Structure.A = apar;
bpar = init_sys.Structure.B;
bpar.Free(1,1) = false;
bpar.Free(3,1) = false;
init_sys.Structure.B = bpar;
init_sys.Structure.C.Free = false;
sysgray = ssest(tt,init_sys)
>> sysgray.A
ans =
0 1.0000 0 0
0 0 2.2653 0
0 0 0 1.0000
0 0 0.2710 0
0 Comments
More Answers (0)
See Also
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!