State-space input response

I have this state space system for an a/c;
[u_dot;w_dot;q_dot;theta_dot]=[-0.045,0.036,0,-0.322 ; -0.370,-2.02,1.76,0 ; 0.191,-3.96,-2.98,0 ; 0,0,1,0][u;w;q;theta] + [0,1 ; -0.282, 0 ; -11, 0 ; 0, 0][𝛿_e;𝛿_t] )
. Aircraft has initial of[176;0;0;0]. I want to input w=-5 ft/s in the time range of t=3s to t=8s. How can i do that and how to plot response?

 Accepted Answer

Paul
Paul on 18 May 2023
Hi Yasin,
You can create a model using ss. Wtih that model you can simulate the repsonse to the initial condition and the input using lsim.

3 Comments

Hi Paul,
I am exactly using ss and lsim but im not sure what im inputting, here is my code,
clc;clear;clear all
% Define the state-space system
A = [-0.045 0.036 0 -0.322;
-0.370 -2.02 1.76 0;
0.191 -3.96 -2.98 0;
0 0 1 0];
B = [0 1; -0.282 0; -11 0; 0 0];
C = eye(4);
D = zeros(4,2);
sys = ss(A,B,C,D);
ic = [176 0 0 0]';
% Define the gust input
t = 0:0.05:100;
w = zeros(size(t));
w(t>=3 & t<8) = -5;
% Simulate the system response to the gust input
[y,t,x] = lsim(sys, [w' zeros(size(t'))], t, ic);
% Plot the response of the longitudinal states
figure;
subplot(2,2,1);
plot(t,x(:,1));
xlabel('Time (s)');
ylabel('u (ft/s)');
Something not making sense. w is a state. The inputs are delta_e and delta_t. So we can't specify w as being -5 ft/s 3 < t < 8. Unless you're trying to solve some sort of inverse dynamics problem.
Exactly, but it is asked that plot the response if w is -5 ft/s in a time period of 3 < t < 8. Thanks for help though

Sign in to comment.

More Answers (0)

Tags

Asked:

on 18 May 2023

Commented:

on 18 May 2023

Community Treasure Hunt

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

Start Hunting!