Reputation: 309
i'am following a course in flight dynamics and i want to plot the respons of a step input (of 0.01745) at one of the 4 inputs. I have 4 inputs: u,w,q,theta
however, i get an error: Error using DynamicSystem/lsim (line 98) When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels.
as far as i see in my workspace i meet those requirments... My code does work when i use u=ones(size(t)), but this gives a step input on all 4 channels u,w,q,theta.... Can you please help me? thanks :)
clear all; clc;
A=[ 0.00501 0.00464 -72.90 -31.34;
-0.08570 -0.545 309 -7.4;
0.00185 -0.00767 -0.395 0.00132;
0 0 1 0];
B=[5.63 -23.8 -4.51576 0]';
C=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1];
D=0;
sys=ss(A,B,C,D);
t=0:0.1:1000;
%definieer initial conditions:
u0=0;
w0=0;
q0=0;
theta0=0;
x0=[u0 w0 q0 theta0]';
u1=zeros(size(t)); %u
u2=zeros(size(t)); %w
u3=zeros(size(t)); %q
u4=zeros(size(t))+0.01745; %theta0
u=[u1;u2;u3;u4]'; **% this line gives the error**
%u=zeros(size(t)); **%this works but gives step input at all 4 inputs...**
figure(1)
subplot(1,2,1)
lsim(sys,u,t,x0)
xlabel('time');
ylabel('theta (rad) q (rad/s) w (ft/s) u (ft/s)');
subplot(1,2,2)
pzmap(sys)
title('pole-zere map A-7A corsair II, ex 6.1');
damp(sys)%geeft eigenvalue,damping,freq
[U,D]=eig(A);
eigenvector=U;
disp('----------------------------------------')
disp('magnitude, welke mode is het sterkst voor (u,w,q,theta)')
disp(' |short-period mode | phugoid mode|')
EigenvecMagnitude=abs(U);
EigenvecMagnitude
disp('----------------------------------------')
Upvotes: 1
Views: 800
Reputation: 1
we consider a mimo 2x2 we would like to transmit symbol x1 trough the first antenna
it is possible to assign to symbol x1 two transmit power such as x1 sent trough channel h11 is p11
and x1 sent trough channel h21 is p21 ( are the value of p11 and p21 must be the same or different)enter image description here?
Upvotes: 0
Reputation: 3476
The documentation of ss
states the matrices relate to the following system model:
dx/dt = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
and in particular that B
"-- is an Nx-by-Nu real- or complex-valued matrix", where Nx
is the state dimension (4 in your case) and Nu
is the control dimension, which according to your B=[5.63 -23.8 -4.51576 0]';
is 1.
However, when you attempt to use the matrix u=[u1;u2;u3;u4]';
as presented in your code as a control input, that will fail since its dimensions are not as expected (4 instead of 1). The length of the control inputs (corresponding to t
) seems to be ok in your code.
In conclusion, you need to modify at least B
(mind you, I'm not an expert on the particular system -- you know it best yourself!) to make this work. Perhaps you need Bnew = diag(B)
or something similar?
Upvotes: 0