Clear Filters
Clear Filters

Using state space in simulink

7 views (last 30 days)
Marina
Marina on 22 May 2024
Commented: Marina on 27 May 2024
What does x represent in the state space I define in simulink?
  4 Comments
Sam Chak
Sam Chak on 22 May 2024
Hi Marina,
If it is not absolutely necessary to use the State Space block, you can try using the Transfer Function block. From the identified state space model, you can convert it to a transfer function.
By the way, do you know the initial value of the system output when you want to operate it in real-time? This is a very important question
Marina
Marina on 22 May 2024
I tried that too. But I'm afraid the transfer functions are not defined in the same way. Is it necessary to perform a transformation to go from the Laplace domain to the time domain?
And to answer your question, yes. I know the initial output value

Sign in to comment.

Accepted Answer

Sanju
Sanju on 22 May 2024
Hi Marina,
x in the state space block represents "state vector", In state space representation, a state vector refers to a set of variables that describe the complete state of a system at a given time. It is a column vector that contains all the necessary information to determine the future behavior of the system. Each element of the state vector represents a specific state variable of the system.
For example, consider a simple mass-spring-damper system. The state vector for this system could be defined as [x; v], where x represents the displacement of the mass and v represents its velocity.
The state vector is often used in state space models to represent the dynamics of a system. By defining the state vector and its evolution over time, we can describe the behavior of the system using a set of differential equations.
For more information on state vector and state space you can refer to the following documentation links,
Hope this helps!
  3 Comments
Manikanta Aditya
Manikanta Aditya on 22 May 2024
When you use the ‘ident’ toolbox in MATLAB to obtain the state-space matrices (A, B, C, D), the state vector x is implicitly defined by the structure of these matrices. However, the physical meaning of the states in x depends on the system you are modeling.
The initial state x0 in Simulink is the initial condition for the state vector x. It represents the state of your system at the start of the simulation. If you don’t have a specific initial condition in mind, you can often set x0 to a zero vector of appropriate size (i.e., the same size as your state vector x).
If you’re unsure about the meaning of the states in your state vector x, you might need to refer back to the system you used to derive your state-space model with the ‘ident’ toolbox. The definition of x would be inherent to that process.
Marina
Marina on 22 May 2024
Thanks for your help

Sign in to comment.

More Answers (1)

Sam Chak
Sam Chak on 22 May 2024
Since you know the initial output value, the idea is to convert the Identified State-Space to an equivalent Canonical State-Space, where the system's output is the first state variable of the Canonical State-Space system.
By transforming the state-space model into canonical form, you can ensure that the first state variable directly corresponds to the system's output. The second state variable then represents the time-derivative of the first state, which, in the case of a positional displacement system, would be the velocity.
With the state-space model in canonical form, you can readily assign the appropriate initial values to the corresponding state variables within the Simulink State-Space block. This will help ensure that the simulation accurately reflects the initial conditions of your system.
%% Identified State-Space
Aid = magic(3);
Bid = [0; 0; 1];
Cid = [1, 2, 3];
Did = 0;
sys = ss(Aid, Bid, Cid, Did)
sys = A = x1 x2 x3 x1 8 1 6 x2 3 5 7 x3 4 9 2 B = u1 x1 0 x2 0 x3 1 C = x1 x2 x3 y1 1 2 3 D = u1 y1 0 Continuous-time state-space model.
%% Convert to Canonical State-Space
S = compreal(sys);
csys= ss(S.A', S.C', S.B', S.D)
csys = A = x1 x2 x3 x1 0 1 0 x2 0 0 1 x3 -360 24 15 B = u1 x1 3 x2 26 x3 474 C = x1 x2 x3 y1 1 0 0 D = u1 y1 0 Continuous-time state-space model.
  2 Comments
Sam Chak
Sam Chak on 24 May 2024
Have you resolved the issue with the proposed solution?
Marina
Marina on 27 May 2024
Hello,
I've just seen your answer. The first state of my system is not easy to identify.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!