Legend/Label in a compare command of an identified mimo system

조회 수: 4 (최근 30일)
Benjamin Pommer
Benjamin Pommer 2022년 11월 2일
답변: Balavignesh 2024년 1월 15일
Dear Matlab community
I am facing the following problem. I estimated an MIMO modell by ssest. Now, I want to compare the data with the identified systems by the compare command. I've already tried several ways but ususally only the label for the first output or all of the outputs or a default label is displayed. See the code below.
For example:
%%first trial
data = iddata(y,u,Ts);
sys_ord2 = ssest(data,2,'Ts',Ts,'InputName',['Mast Moment','Thrust','Density'],'OutputName',['Omega','Rotor Force x','Rotor Force y','Rotor Force z', ...
'Rotor Moment x', 'Rotor Moment y', 'Rotor Moment z']);
%second trial
data = iddata(y,u,Ts, 'Name', ['Omega','Rotor Force x','Rotor Force y','Rotor Force z', ...
'Rotor Moment x', 'Rotor Moment y', 'Rotor Moment z']);
sys_ord2 = ssest(data,2,'Ts',Ts);
%third trial
data = iddata(y,u,Ts,'Name','Omega','Name','Rotor Force x','Name','Rotor Force y','Name','Rotor Force z', ...
'Name','Rotor Moment x','Name','Rotor Moment y','Name','Rotor Moment z']);
sys_ord2 = ssest(data,2,'Ts',Ts);
%fourth trial
data = iddata(y,u,Ts);
data.InputData = {'Mast Moment','Thrust','Density'};
data.OutputData = {'Omega','Rotor Force x','Rotor Force y','Rotor Force z', ...
'Rotor Moment x', 'Rotor Moment y', 'Rotor Moment z'};
sys_ord2 = ssest(data,2,'Ts',Ts);
  댓글 수: 1
Arun
Arun 2023년 10월 27일
Could you please provide more clearity about what is the output you get after compare function and what is that you seek as output?

댓글을 달려면 로그인하십시오.

답변 (1개)

Balavignesh
Balavignesh 2024년 1월 15일
Hi Benjamin,
As per my understanding, you are facing an issue with labeling the outputs when comparing the measured data with the identified system, and you are looking to correctly display the labels for each output in the comparison plots.
The 'iddata' object is used to store time-domain input-output data, and the 'ssest' function is used state-space models from this data. When you're using the compare function to compare the measured output with the simulated output of an identified model, MATLAB should automatically use the output names from the iddata object or the model if they have been set.
I think there are some issues with how you're trying to set the 'InputName' and 'OutputName' properties. Have a look at the following code snippet to rectify the issue:
% Assuming y is the output data matrix, u is the input data matrix, and Ts is the sampling time
% Create the iddata object with named inputs and outputs
data = iddata(y, u, Ts, ...
'InputName', {'Mast Moment', 'Thrust', 'Density'}, ...
'OutputName', {'Omega', 'Rotor Force x', 'Rotor Force y', 'Rotor Force z', ...
'Rotor Moment x', 'Rotor Moment y', 'Rotor Moment z'});
% Estimate the state-space model
sys_ord2 = ssest(data, 2, 'Ts', Ts);
% Compare the measured and simulated outputs using the compare command
compare(data, sys_ord2);
Kindly refer to the following documentation links to have more information on:
Hope that helps!
Balavignesh

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by