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
69 ビュー (過去 30 日間)
古いコメントを表示
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)
回答 (2 件)
Walter Roberson
2025 年 2 月 19 日 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
2025 年 2 月 19 日 2:54
編集済み: Sam Chak
2025 年 2 月 19 日 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 件のコメント
Sam Chak
2025 年 2 月 19 日 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
2025 年 2 月 19 日 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"






参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!