error using ss2tf function

조회 수: 9 (최근 30일)
Tenzing Thiley
Tenzing Thiley 2022년 2월 14일
댓글: Paul 2022년 2월 14일
clear all;
clc;
%% Declaration with parameter
I = 205113.07; % kg-m^2
m= 15118.35; % kg
c = 3.511; % m
rho = 1.225; % kg/m^3
Tm = 49817.6; % N
S = 37.16; % m^2
%% Equation of motion(Longitudinal modes)
syms alpha etta delta theta q V
f1 = ((etta*Tm*cos(alpha))/m) - ((0.5*rho*(V^2)*S*((0.0013*alpha^2)-(0.00438*alpha)+0.1423))./m)-(9.81*sin(theta-alpha));
f2 = q-(etta*Tm*sin(alpha)/(m*V))-(0.5*rho*V*S*((0.0751*alpha)+(0.0144*delta)+0.732)/m)+(9.81*cos(theta-alpha)/V);
f3 = (0.5*rho*V^2*S*c*(-0.00437*alpha-0.0196*delta-0.123*q-0.1885)/I);
f4 = q;
%% Linearization
A = jacobian([f1,f2,f3,f4],[V alpha q theta]);
B = jacobian([f1,f2,f3,f4],[etta delta]);
%% Equillibrium
V = 94.5077; %m/s
etta = 0.58;
delta = -0.1678; %rad
theta = 0;
alpha = 0;
q = 0;
%% Evaluate System and Control Matrix
format shortG;
fprintf("State Matrix = ");
A = eval(A)
fprintf("Control Matrix = ");
B = eval(B)
I want to convert State Space to Single input Single Output Transfer function Transfer function but I get error when using ss2tf function.
can any one help me out?

답변 (1개)

Paul
Paul 2022년 2월 14일
Define the nonlinear output equation y = h(x,u), take the jacobians wrt x and u, and evaluate them at the equilibirium point. These results will be C and D. Same exact approach to derive A and B from xdot = f(x,u). Once you have C and D then if you really need the transfer function using ss2tf()
[n,q]=ss2tf(A,B,C,D)
or better
hzpk = zpk(ss(A,B,C,D))
Or just leave the model in state space form
hss = ss(A,B,C,D);
unless you have to have the explicit transfer function for some reason.
  댓글 수: 5
Tenzing Thiley
Tenzing Thiley 2022년 2월 14일
transfer function needed was in this form
v(s)/etta(s) =
alpha(s)/etta(s) =
q(s)/etta(s) =
theta(s)/etta(s) =
v(s)/delta(s) =
alpha(s)/delta(s) =
q(s)/delta(s) =
theta(s)/delta(s) =
how can I achieve is using function ss2tf
Paul
Paul 2022년 2월 14일
It looks like the output vector y = [v; alpha; q; theta] is exactly the same as the state variable vector, x. In this case, what should C and D be in this equation, where u = [etta; delta]?
y = C*x + D*u
Once you have C and D you can get all eight transfer functions at once using the second or third method in my comment above.
If sst2tf must be used, you can use
[num,den] = sst2tf(A,B,C,D,1)
to get the first four transfer functions and
[num,den] = sst2tf(A,B,C,D,2)
to get the second four transfer functions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by