ajout figure et avance sujet

This commit is contained in:
Nolan Reynier Nomer 2026-04-20 16:11:03 +02:00
parent 4adb022e8e
commit bccd6c4a3f
6 changed files with 81 additions and 7 deletions

View file

@ -111,7 +111,7 @@ Question5 = figure ;
plot(t, cmd, t, y); plot(t, cmd, t, y);
xlabel("Temps (s)"); xlabel("Temps (s)");
ylabel("Amplitude"); ylabel("Amplitude");
legend("u(t)", "y(t)"); legend("$u(t)$", "$y(t)$", 'Interpreter', 'latex');
title("Simulation en boucle ouverte") ; title("Simulation en boucle ouverte") ;
if SAVE if SAVE
@ -128,9 +128,9 @@ Cw = @(zeta) [zeta^2*(2*zeta^3-5*zeta^2+10)/20 ...
Cw_L = Cw(L); Cw_L = Cw(L);
%% %%
TransientTime = [] ; TransientTime = zeros(size(0.01:0.01:10)) ;
for i = 0.01:0.01:10 for i = 1:size(TransientTime, 2)
TransientTime(end+1) = stepinfo(feedback(sys, i)).TransientTime ; TransientTime(i) = stepinfo(feedback(sys, i*0.01)).TransientTime ;
end end
[minimum, min_index] = min(TransientTime) [minimum, min_index] = min(TransientTime)
k = min_index * 0.01 k = min_index * 0.01
@ -186,11 +186,58 @@ H_lqr = inv(Cw_L*inv(-A+B*K)*B) ;
sys_CL_lqr = ss(A-B*K, B*H_lqr, C, 0); sys_CL_lqr = ss(A-B*K, B*H_lqr, C, 0);
[y, t, x] = lsim(sys_CL_lqr, cmd, t); [y, t, x] = lsim(sys_CL_lqr, cmd, t);
u = H_lqr*cmd'-k*y ; u = H_lqr*cmd'-(K*x')' ;
figure ; Question12 = figure ;
plot(t, u, t, y, t, cmd, t, (Cw_L*x')'); plot(t, u, t, y, t, cmd, t, (Cw_L*x')');
xlabel("Temps (s)"); xlabel("Temps (s)");
ylabel("Amplitude"); ylabel("Amplitude");
legend("u(t)", "y(t)", "wc(t)", "w(t)"); legend("$u(t)$", "$y(t)$", "$w_c(L,t)$", "$w(L,t)$", 'Interpreter', 'latex');
title("Simulation du retour d'états avec pré-gain") ; title("Simulation du retour d'états avec pré-gain") ;
if SAVE
exportgraphics(Question12, './latex/Illustrations/Question12.pdf')
end
%% Question 15
Bp = [0; 0; 0; 0; 1/2*L^4-L^3+L; L^3-1/2*L^4; 1/4*L^4-2/3*L^3+1/2*L^2; 1/4*L^4-1/3*L^3];
q = -5 * double (t' >= 4);
sys_perturbations = ss(A-B*K, [B*H_lqr Bp], C, [0 0]);
%%Question 16
[y, t, x] = lsim(sys_perturbations, [cmd ; q], t');
u = H_lqr*cmd'-(K*x')' ;
Question16 = figure ;
plot(t, u, t, y, t, cmd, t, (Cw_L*x')');
xlabel("Temps (s)");
ylabel("Amplitude");
legend("$u(t)$", "$y(t)$", "$w_c(L,t)$", "$w(L,t)$", 'Interpreter', 'latex');
title("Simulation du retour d'états avec pré-gain et perturbations") ;
if SAVE
exportgraphics(Question16, './latex/Illustrations/Question16.pdf')
end
%% Question 17
eig_lqr = eig(sys_CL_lqr);
eig_4 = [eig_lqr ; -2];
A_aug = [A, zeros(8,1) ; -Cw_L, 0];
B_aug = [B; 0];
B_p_aug = [Bp; 0];
B_ref = [zeros(8,1); 1];
%%
K_aug = place(A_aug, B_aug, eig_4)
sys_integral = ss(A_aug - B_aug*K_aug, [B_ref B_p_aug], [C, 0], [0 0]);
[y, t, x] = lsim(sys_integral, [cmd ; q], t');
u = -(K_aug*x')' ;
Question19 = figure ;
plot(t, u, t, y, t, cmd, t, ([Cw_L 0]*x')');
xlabel("Temps (s)");
ylabel("Amplitude");
legend("$u(t)$", "$y(t)$", "$w_c(L,t)$", "$w(L,t)$", 'Interpreter', 'latex');
title("Simulation du retour d'états avec action intégrale et perturbations") ;
if SAVE
exportgraphics(Question19, './latex/Illustrations/Question19.pdf')
end

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -204,6 +204,30 @@ Pour :
\end{aligned}\right. \Rightarrow d\acute{e}cla \ A, \ B, \ C \ en \ MATLAB \end{aligned}\right. \Rightarrow d\acute{e}cla \ A, \ B, \ C \ en \ MATLAB
\end{equation*} \end{equation*}
\begin{equation*}
A = \begin{pmatrix}
0 & 0 & 0 & 0 & 114 & 6 & 12 & -2 \\
0 & 0 & 0 & 0 & -54 & 6 & -2 & 4 \\
0 & 0 & 0 & 0 & -1188 & -12 & -114 & 6 \\
0 & 0 & 0 & 0 & -828 & -12 & -54 & 0 \\
6 & 54 & 4 & -2 & 0 & 0 & 0 & 0 \\
-6 & -114 & -2 & 12 & 0 & 0 & 0 & 0 \\
-12 & -828 & -6 & 54 & 0 & 0 & 0 & 0 \\
-12 & -1188 & -6 & 114 & 0 & 0 & 0 & 0 \\
\end{pmatrix}, \ B = \begin{pmatrix}
0 \\
0 \\
0 \\
0 \\
4 \\
-16 \\
-60 \\
-120 \\
\end{pmatrix}, \ C = \begin{pmatrix}
0 & 0 & 0 & 0 & 0 & -1 & 0 & 0
\end{pmatrix}
\end{equation*}
\subsection{Exercice 4} \subsection{Exercice 4}
\begin{equation*} \begin{equation*}
@ -299,6 +323,7 @@ $C_1$ et $C_2$ ?????????????????
\subsection{Exercice 12} \subsection{Exercice 12}
\includegraphics[width=\textwidth]{Illustrations/Question12}\begin{align*}
\subsection{Exercice 13} \subsection{Exercice 13}
@ -314,6 +339,7 @@ $C_1$ et $C_2$ ?????????????????
\subsection{Exercice 16} \subsection{Exercice 16}
\includegraphics[width=\textwidth]{Illustrations/Question16}\begin{align*}
\subsection{Exercice 17} \subsection{Exercice 17}
@ -323,6 +349,7 @@ $C_1$ et $C_2$ ?????????????????
\subsection{Exercice 19} \subsection{Exercice 19}
\includegraphics[width=\textwidth]{Illustrations/Question19}\begin{align*}
\subsection{Exercice 20} \subsection{Exercice 20}

Binary file not shown.