I figured out how to solve the first one but I'm still struggling on how to find those specific transfer functions in part 2
multiple equations to steady-state system to transfer function
14 views (last 30 days)
Show older comments
Part 1:
This is the steady-state system I found :
A=[0 0 1 0;
0 0 0 1;
(-k1-k2)/m1 k2/m1 0 0;
(-k2-k3)/m2 k2/m2 0 0];
B=[0 0; 0 0; -1/m1 0; 1/m2 1/m2];
C=[1 0 0 0;0 0 1 0];
D=[];
found using the following equations
๐1๐งฬ1 = โ๐1๐ง1 โ ๐2(๐ง1 โ ๐ง2) โ ๐ข1 and
๐2๐งฬ2 = โ๐2(๐ง2 โ ๐ง1) โ ๐3๐ง2 + ๐ข1 + ๐ข2
Here I was instructed to find one of the transfer functions (such as Z1(s)/U1(s))
Part 2: I got the steady-state system
A=[-0.12 -6.2 -785 32.2;
-0.11 -11.23 5.51 0;
0.0002 -0.5 -5.94 0;
0 1.02 0 0];
B=[21.04 0; 8.87 -23.34; -0.09 0.01; 0 0];
C=[1 1 1 1; 1 1 1 0; 1 1 1 0; 0 1 0 0];
D=[];
which was found using the below equations:
๐ฅ๐ฝฬ = โ0.12๐ฅ๐ฝ โ 6.20โ๐ โ 785.0โ๐ + 32.2โ๐ + 21.04โ๐ฟ๐
โ๐ฬ = โ0.11โ๐ฝ โ 11.23โ๐ + 5.51๐โ โ 23.34โ๐ฟ๐ + 8.87โ๐ฟ๐
โ๐ฬ = 0.0002๐ฅ๐ฝ โ 0.50โ๐ โ 5.94โ๐ + 0.01๐ฅ๐ฟ๐ โ 0.09โ๐ฟ๐
โ๐ฬ = 1.02โ๐
Here I was supposed to find the transfer functions: ๐ฅ๐ฝ/๐ฟ๐ and ๐/๐ฟ๐
In both instances I used the following code but the upon running the files, the code would keep running whenever it got to "transferfunction" and wouldn't stop or actually give me the transfer functions. Each time I'd have to manually stop the code in order to use it. What am I doing wrong here?
clear all
clc
%part 1
syms k1 k2 m1 m2 k3
A=[0 0 1 0;
0 0 0 1;
(-k1-k2)/m1 k2/m1 0 0;
(-k2-k3)/m2 k2/m2 0 0];
B=[0 0; 0 0; -1/m1 0; 1/m2 1/m2];
C=[1 0; 0 1];
D=[];
system1=ss(A,B,C,D)
transferFunction=tf(system1)
clear all
clc
%part 2
A=[-0.12 -6.2 -785 32.2;
-0.11 -11.23 5.51 0;
0.0002 -0.5 -5.94 0;
0 1.02 0 0];
B=[21.04 0; 8.87 -23.34; -0.09 0.01; 0 0];
C=[1 1 1 1; 1 1 1 0; 1 1 1 0; 0 1 0 0];
D=[];
system1=ss(A,B,C,D)
transferFunction=tf(system1)
Answers (2)
Walter Roberson
on 19 Feb 2025 at 2:42
The Control System Toolbox functions, such as ss and tf do not support symbolic variables at all. There are very very few functions in the Control System Toolbox that support symbolic variables.
In https://www.mathworks.com/matlabcentral/answers/305339-how-to-create-a-transfer-function-with-gain-k#comment_395202 I explore what is actually possible for Control System Toolbox in turns of making parameterized systems.
Sam Chak
on 19 Feb 2025 at 2:54
Edited: Sam Chak
on 19 Feb 2025 at 5:53
Hi @erin
Part 1 of your code does not work because the tf() function from the Control System Toolbox is primarily used for creating transfer functions, which are dynamical system objects, and it does not directly support symbolic computations. Part 2 is purely numerical, so the code in that section works.
๐ฅ๐ฝฬ = โ0.12๐ฅ๐ฝ โ 6.20โ๐ โ 785.0โ๐ + 32.2โ๐ + 21.04โ๐ฟ๐
โ๐ฬ = โ0.11โ๐ฝ โ 11.23โ๐ + 5.51๐โ โ 23.34โ๐ฟ๐ + 8.87โ๐ฟ๐
โ๐ฬ = 0.0002๐ฅ๐ฝ โ 0.50โ๐ โ 5.94โ๐ + 0.01๐ฅ๐ฟ๐ โ 0.09โ๐ฟ๐
โ๐ฬ = 1.02โ๐
๐ฅ๐ฝ/๐ฟ๐ and ๐/๐ฟ๐
%% part 2
% state matrix
A = [-0.12 -6.2 -785 32.2;
-0.11 -11.23 5.51 0;
0.0002 -0.5 -5.94 0;
0 1.02 0 0];
% input matrix
B = [21.04 0;
8.87 -23.34;
-0.09 0.01;
0 0];
% output matrix
C = [1 0 0 0;
0 0 1 0];
% direct matrix
D = 0*C*B;
% state-space model
sys = ss(A, B, C, D, 'StateName', {'beta', 'p', 'r', 'phi'}, 'InputName', {'dr', 'da'})
% convert MIMO state-space to multiple transfer functions
G = tf(sys)
%% To access specific transfer function, enter: G(output order, input order)
% beta is Output #1
% r is Output #2
% ฮดr is Input #1
% ฮดa is Input #2
%% beta/ฮดr
Gbr = G(1,1)
%% r/ฮดa
Gra = G(2,2)
2 Comments
Sam Chak
on 19 Feb 2025 at 3:06
Hi @erin
Your output matrix
has 4 rows, and the input matrix
has 2 columns; thus, it implies that there are four outputs for each input signal. Since a transfer function can only describe a Single Input, Single Output (SISO) relationship, there is a total of eight transfer functions in the results.


You need to identify which specific rows in
represent ฮฒ and r, as well as which specific columns in
represent the input signals
(rudder) and
(aileron), in order to determine the corresponding transfer functions for ฮฒ/ฮดr and r/ฮดa.




Sam Chak
on 19 Feb 2025 at 6:03
Hi @erin
For Part 2, the desired outputs are
(state 1) and
(state 3). I discovered that your output matrix
is incorrect because the first three outputs {
,
,
} are not linear combinations of the states. Therefore, I corrected the code in my Answer and demonstrated an approach to access the desired transfer functions ฮฒ/ฮดr and r/ฮดa"






See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!