format of the transfer function different from that contained in the articles and book

2 views (last 30 days)
%% Find Names and Ordering of States
[sizes,x0,names]=airframe3DoF([],[],[],'sizes');
% sizes
% x0 [valores para cada names]
% names [q,theta,U,w,x,y] posicoes: q=1,theta=2, U=3, w=4, x=5, y=6.
state_names = cell(1,numel(names));
for i = 1:numel(names)
n = max(strfind(names{i},'/')); %numero maximo de caracteres sem contar as barras.
state_names{i}=names{i}(n+1:end);
end
%% Specify States
% Specify which states to trim and which states remain fixed.
fixed_states = [{'U,w'} {'Theta'} {'Position'}]; % ix estados que nao mudam (nao trimam)
fixed_derivatives = [{'U,w'} {'q'}]; % idx % wponto = az; q = thetaponto; qponto = thetapontoponto estados que quero trimar
fixed_outputs = [];
% fixed_outputs = vazio
fixed_inputs = [];
% fixed_inputs = vazio
n_states=[];n_deriv=[];
for i = 1:length(fixed_states)
%length(fixed_states): tamamnho do fixed_states = 1 x 3
n_states=[n_states find(strcmp(fixed_states{i},state_names))]; %#ok<AGROW>
% n_states = 1 x 5; posicoes do fixed_states em relacao aos names]: [3 4 2 5 6] = [U w theta x y]
end
for i = 1:length(fixed_derivatives)
n_deriv=[n_deriv find(strcmp(fixed_derivatives{i},state_names))]; %#ok<AGROW>
% n_derivatives = 1 x 3; posicoes do fixed_derivatives em relacao aos names: [3 4 1] = [U w q]
end
n_deriv=n_deriv(2:end);
% pegando os valores da segunda posicao ate a ultima, nao pega a primeira posicao, porque??? [4 1] = [w q]
%%% estava alterando o valor quando mudava o fixed_derivatives por conta da
%%% linha 71 pois ele pega do segundo valor em diante e nao pega o
%%% primeiro.
%% Trim Model
% Trim the model.
[X_trim,U_trim,Y_trim,DX,options]=trim(modelName,x0,0,[0 0 simSetup.initCond.velocityIC]', ...
n_states,fixed_inputs,fixed_outputs, ...
[],n_deriv)
options(10) % retorna o numero de iteracoes usadas para encontrar um ponto de corte.
%[x,u,y,dx] = trim('sys',x0,u0,y0,ix,iu,iy,dx0,idx)
% x0 = [valores iniciais para cada names]
% u0 = 0
% y0 = [0; 0; velocidadeIC]
% ix = n_states = 1 x 5; posicoes do fixed_states em relacao aos names]: [3 4 2 5 6] = [U w theta x y]
% iu = fixed_inputs = vazio
% iy = fixed_outputs = vazio
% dx0 = vazio %valores da derivada de estado no ponto inicial da busca
% idx = n_deriv pegando os valores da segunda posicao ate a ultima, nao pega a primeira posicao, porque??? [4 1] = [w q]
% idx seleciona os valores dx0 que a busca deve satisfazer exatamente.
%% Linear Model and Frequency Response
% Derive the linear model and view the frequency response.
fmt = format("longG");
% opts(3);
[A,B,C,D]=linmod(modelName,X_trim,U_trim),fmt;
% [A,B,C,D]=linmod(modelName,X_trim,U_trim),opts;
A
if exist('control','dir')
airframe = ss(A(n_deriv,n_deriv),B(n_deriv,:),C([2 1],n_deriv),D([2 1],:));
set(airframe,'StateName',state_names(n_deriv), ...
'InputName',{'Elevator'}, ...
'OutputName',[{'az'} {'q'}]);
zpk(airframe)
linearSystemAnalyzer('bode',airframe)
end
Function transfer:
From input "Elevator" to output...
-25.905 s (s+276.1)
az: --------------------
(s^2 + 1.4s + 27.32)
-36.503 (s+0.6328)
q: --------------------
(s^2 + 1.4s + 27.32)
Continuous-time zero/pole/gain model.
In books and articles it is stated that the equations would have this format:
a_z=(K_1 (1-s²/(ω_z^2 )))/((1+(2ζ_AF)/ω_AF s+s²/(ω_AF^2 )) )
q=(K_3 (1+T_α s))/(1+(2ζ_AF)/ω_AF s+s²/(ω_AF^2 ))
[SL: I think I formatted the equations correctly in LaTeX, though I'm not certain if the subscripts on some of the variables are supposed to be AF or if the subscript is A with F being a separate variable multiplied by that expression. If it is not correct, please clarify exactly what parts of those symbols are supposed to be subscripts and/or edit the LaTeX expressions. In case I got it wrong I left the original equations in the post.
]
The first equation "az" as shown in the model in the book and articles, in the numerador there is only contains the term s² and a constant, the term s is equal to zero. I would like to know why the term s appears? az is as an answer in the model in the numerador: ax² + bx and the correct option would be ax² + c, could someone help me please? I would like to make the equations have the same format as in articles and books, does anyone know how to solve this problem?
  1 Comment
Sam Chak
Sam Chak on 16 Oct 2024
@Rafaella Barrêto Campos, Do you wish to continue pursuing the explanation for transforming the transfer function into the model presented in some book and articles?

Sign in to comment.

Answers (0)

Categories

Find more on Dynamic System Models in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!