MATLAB Answers

How can I convert a state-space representation of a system into an equivalent transfer function (symbolic variables)?

Asked by aldemar bohorquez rodriguez on 14 Oct 2018 at 4:02
Latest activity Answered by Stephan Jung about 22 hours ago

Hello, guys, I hope you are well! I have a question: how can I convert a state-space representation of a system into an equivalent transfer function (symbolic variables)?

Example:

%------------------------------------ Arrays ------------------------------------%

A=[0 1 0 0; -(Kw+Ks)/Mw -(Cs+Cw)/Mw Ks/Mw Cs/Mw; 0 0 0 1; Ks/Mc Cs/Mc -Ks/Mc -Cs/Mc] B=[0; Kw/Mw; 0; 0]; C=[1 0 0 0; 0 0 1 0; -1 0 1 0; 0 -1 0 1]; D=[0; 0; 0; 0];

Thanks!

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephan Jung about 22 hours ago

Hi,

the usage of symbolic variables is not supported by Control System Toolbox. What you can do ist to use the realp function to make your variables to a tunable parameter. This allows to tune systems and make further investigations to the system you are dealing with. Unfortunately, only state space models are supported for this application. Although you can create a transfer function, it will no longer have tunable parameters. The creation of a system that has tunable parameters can be seen here:

% define tunable parameters with initial values
Kw = realp('Kw',1);
Ks = realp('Ks',1);
Mw = realp('Mw',1);
Cs = realp('Cs',1);
Cw = realp('Cw',1);
Mc = realp('Mc',1);
% define the state space description of the system
A=[0 1 0 0; -(Kw+Ks)/Mw -(Cs+Cw)/Mw Ks/Mw Cs/Mw; 0 0 0 1; Ks/Mc Cs/Mc -Ks/Mc -Cs/Mc];
B=[0; Kw/Mw; 0; 0];
C=[1 0 0 0; 0 0 1 0; -1 0 1 0; 0 -1 0 1];
D=[0; 0; 0; 0];
% define the generalized state space model for further investigations:
sys_ss =ss(A,B,C,D) 

The result will be:

sys_ss =
    Generalized continuous-time state-space model with 4 outputs, 1 inputs, 4 states, and the following blocks:
      Cs: Scalar parameter, 4 occurrences.
      Cw: Scalar parameter, 1 occurrences.
      Ks: Scalar parameter, 4 occurrences.
      Kw: Scalar parameter, 2 occurrences.
      Mc: Scalar parameter, 4 occurrences.
      Mw: Scalar parameter, 5 occurrences.
Type "ss(sys_ss)" to see the current value, "get(sys_ss)" to see all properties, and "sys_ss.Blocks" to interact with the blocks.

See also the documentation to this topic:

https://de.mathworks.com/help/control/ug/state-space-model-with-both-fixed-and-tunable-parameters.html

https://de.mathworks.com/help/control/ug/models-with-tunable-coefficients.html

Best regards

Stephan

  0 Comments

Sign in to comment.