mss2mss

Affine state transformations of MTI models

Contents

Syntax

[sys_sc,a,b] = mss2mss(obj,x,u,lbx,ubx,lbu,ubu,options)

Description

[sys_sc,a,b] = mss2mss(obj,x,u,lbx,ubx,lbu,ubu,options) Linear state transformation (and input transformation) of an explicit MTI model in CPN1 format.

The tranformation is done with the linear state transformation

$$ \mathbf{x}=\mathbf{T}\tilde{\mathbf{x}}+\mathbf{b} $$

and

$ \tilde{\mathbf{x}}=\mathbf{T}^{-1}(\mathbf{x}-\mathbf{b}) $.

The transformed mti system in normalized represenatation is given by

$$\mathbf{\dot{\tilde{x}}}=\mathbf{\tilde{F}}_\phi\prod{(1-|\mathbf{\tilde{F}}_U|+\mathbf{\tilde{F}}_U\mathbf{\tilde{x}})}$$

$$\mathbf{y}=\mathbf{\tilde{G}}_\phi\prod{(1-|\mathbf{\tilde{G}}_U|+\mathbf{\tilde{G}}_U\mathbf{\tilde{x}})}$$

The output is a MTI model with same input and output behavior as the original system, but with scaled states between the lower limits lbx and the upper limits ubx.

Optional: the inputs can be scaled in a range between lbu and ubu and the output bahavior will the be same as with original state and input.

Input arguments

obj mss object

x state trajectory

u input trajectory

lbx lower bound state

ubx upper bound state

lbu lower bound input

ubu upper bound input

Output arguments

msys mss object

a,b scaling parameter

Optional parameters

transformInput scale input in a range between lbu and ubu. Default: false

Example state transformation

Build multilinear model (MTI), 2.order, 1 input

F.U = [[0.83, -0.1]; [0, 0.53]; [1, -0.1]];         % state transition matrix
F.phi= [[1.0080, 0]; [0, 1.50]];                    % state weigting matrix
u=[zeros(20,1);ones(20,1);-ones(20,1)];             % input signal
t=1:1:60;                                           % time vector
Ts=1;                                               % discrete time mti with sampling time 1
obj=mss(CPN1(F.U,F.phi),Ts);                    % build mti model object

Simulate MTI Model

x0=[0;0];                                           % initial state
[y, ~, xsim] =msim(obj,u,t,x0);

Set limits for states and inputs

lbx=[0 0];                                          % lower limit state
ubx=[1 1];                                          % upper limit state
lbu=0;                                              % 0 for non scaled input
ubu=0;                                              % 0 for non scaled input

Linear state transformation of mti model

msys = mss.mss2mss(obj,xsim,u,lbx,ubx,lbu,ubu);               % scale parameter of mti model
[xsc,~,~,~]=dataProcessing.scaleData(xsim,u,lbx,ubx,lbu,ubu); % scale data within limits

Simulation of transformed mti model

[ysc,~,xsimsc]=msim(msys,u,t,xsc(1,:));             % simulate scales mti model with scaled initial state

Plot results

figure()                                            % plot original mti model
sgtitle('original MTI model')
subplot(3,1,1)
plot(u)
xlabel('time')
legend('input')
subplot(3,1,2)
plot(xsim)
xlabel('time')
legend({'state 1','state 2'})
subplot(3,1,3)
plot(y)
xlabel('time')
legend('output')

figure()                                            % plot scaled mti model
sgtitle('scaled MTI model')
subplot(3,1,1)
plot(u)
xlabel('time')
legend('input')
subplot(3,1,2)
plot(xsimsc)
xlabel('time')
legend({'state 1','state 2'})
subplot(3,1,3)
plot(ysc)
xlabel('time')
legend('output')

Example transformation in state and input

Build multilinear model (MTI), 2.order, 1 input

F.U = [[0.83, -0.1]; [0, 0.53]; [1, -0.1]];         % state transition matrix
F.phi= [[1.0080, 0]; [0, 1.50]];                    % state weigting matrix
u=[zeros(20,1);ones(20,1);-ones(20,1)];             % input signal
t=1:1:60;                                           % time vector
Ts=1;                                               % discrete time mti with sampling time 1
obj=mss(CPN1(F.U,F.phi),Ts);                    % build mti model object

Simulate MTI Model

x0=[0;0];                                           % initial state
[y, ~, xsim] =msim(obj,u,t,x0);

Set limits for states and inputs

lbx=[0 0];                                          % lower limit state
ubx=[1 1];                                          % upper limit state
lbu=0;                                              % lower limit input
ubu=1;                                              % upper limit input

Linear state transformation of mti model

msys = mss.mss2mss(obj,xsim,u,lbx,ubx,lbu,ubu,"transformInput",true);   % scale parameter of mti model
[xsc,usc,~,~]=dataProcessing.scaleData(xsim,u,lbx,ubx,lbu,ubu);         % scale data within limits

Simulation of transformed mti model

[ysc,tOut,xsimsc]=msim(msys,usc,t,xsc(1,:));          % simulate scales mti model with scaled initial state

plot results

figure()                                            % plot original mti model
sgtitle('original MTI model')
subplot(3,1,1)
plot(u)
xlabel('time')
legend('input')
subplot(3,1,2)
plot(xsim)
xlabel('time')
legend({'state 1','state 2'})
subplot(3,1,3)
plot(y)
xlabel('time')
legend('output')

figure()                                            % plot scaled mti model
sgtitle('scaled MTI model')
subplot(3,1,1)
plot(usc)
xlabel('time')
legend('input')
subplot(3,1,2)
plot(xsimsc)
xlabel('time')
legend({'state 1','state 2'})
subplot(3,1,3)
plot(y)
xlabel('time')
legend('output')

See also

mss CPN1