delayss - State Space Model with two states

2 Ansichten (letzte 30 Tage)
Rodrigo Zenon Guzman Iturra
Kommentiert: Ameer Hamza am 9 Apr. 2020
Dear comunnity:
Nowadays i am trying to create a state space model of a system with two states (x1,x2) and a delay in the state x2. The state space representation of my system is as follows:
dx1/dt = x2(t)/LS
dx2/dt = -x1(t)/CF - (1/CF*K)*x2(t-Td) + u/CF
Where x1,x2 are the states, x2(t-Td) is the delayed state by a time Td and u is the input of the system.
Even due the help file of delayss.m is helpful, the example is given for a system with a single state x1 only. I tried the following code:
% Clear the workspace
clc
clear all
% Electrical Parameters Values
LS = 32.6e-06 ; % H
CF = 300e-06 ; % F
K = 100e-03; ; % Ohms
Td = 1e-06;
%Definition of the State Matrices
% States defined as:
A = [0 (1/LS);
(-1/CF) 0];
Ad = [0 0;
(-1/(CF*K)) 0];
B = [0;
(1/CF)];
C = [0 1];
D = 0;
%System Definition in SS
DelayT(1) = struct('delay',Td,'a',Ad,'b',[0;0],'c',[0 0],'d',0);
sys = delayss(A,B,C,D,DelayT)
step(sys);
But the step response of the system is not as expected, therefore i know that there is a error on how i defined the system. Could anybody support me with the correct way to define my system using delayss.
Kinds Regards
Rodrigo Guzman

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 9 Apr. 2020
The value of Ad is wrong according to your equations. Change it to
Ad = [0 0;
0 (-1/(CF*K))];
Similarly, do you want to output x1 or x2 as output? If you want to output x1, then change C to
C = [1 0];
Apart from that, your code is correct.
  2 Kommentare
Rodrigo Zenon Guzman Iturra
I truly apologize, it was a foolish mistake. Thank you for your support.
Rodrigo Guzman
Ameer Hamza
Ameer Hamza am 9 Apr. 2020
Glad to be of help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by