error using ss2tf function

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?

Respuestas (1)

Paul
Paul el 14 de Feb. de 2022

1 voto

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 comentarios

Tenzing Thiley
Tenzing Thiley el 14 de Feb. de 2022
But I don't have nonlinear output I need it in form of 8 SISO transfer function.
Tenzing Thiley
Tenzing Thiley el 14 de Feb. de 2022
State Matrix =
A =
-0.040493 9.8689 0 -9.81
-0.0021967 -0.030908 1 0
-0.013639 -0.015207 -0.42801 0
0 0 1 0
Control Matrix =
B =
3.2952 0
0 -0.0020488
0 -0.068204
0 0
Tenzing Thiley
Tenzing Thiley el 14 de Feb. de 2022
these are my matrix
Tenzing Thiley
Tenzing Thiley el 14 de Feb. de 2022
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 el 14 de Feb. de 2022
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Etiquetas

Preguntada:

el 14 de Feb. de 2022

Comentada:

el 14 de Feb. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by