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?

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Paul
Paul 2023๋…„ 5์›” 18์ผ

1 ๊ฐœ ์ถ”์ฒœ

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

Yasin Karacif
Yasin Karacif 2023๋…„ 5์›” 18์ผ
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)');
Paul
Paul 2023๋…„ 5์›” 18์ผ
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.
Yasin Karacif
Yasin Karacif 2023๋…„ 5์›” 18์ผ
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

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ PID Controller Tuning์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์งˆ๋ฌธ:

2023๋…„ 5์›” 18์ผ

๋Œ“๊ธ€:

2023๋…„ 5์›” 18์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by