diff --git a/BE_Beam.m b/BE_Beam.m index 38de810..623fd28 100644 --- a/BE_Beam.m +++ b/BE_Beam.m @@ -111,7 +111,7 @@ Question5 = figure ; plot(t, cmd, t, y); xlabel("Temps (s)"); ylabel("Amplitude"); -legend("u(t)", "y(t)"); +legend("$u(t)$", "$y(t)$", 'Interpreter', 'latex'); title("Simulation en boucle ouverte") ; if SAVE @@ -128,9 +128,9 @@ Cw = @(zeta) [zeta^2*(2*zeta^3-5*zeta^2+10)/20 ... Cw_L = Cw(L); %% -TransientTime = [] ; -for i = 0.01:0.01:10 - TransientTime(end+1) = stepinfo(feedback(sys, i)).TransientTime ; +TransientTime = zeros(size(0.01:0.01:10)) ; +for i = 1:size(TransientTime, 2) + TransientTime(i) = stepinfo(feedback(sys, i*0.01)).TransientTime ; end [minimum, min_index] = min(TransientTime) 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); [y, t, x] = lsim(sys_CL_lqr, cmd, t); -u = H_lqr*cmd'-k*y ; -figure ; +u = H_lqr*cmd'-(K*x')' ; +Question12 = figure ; plot(t, u, t, y, t, cmd, t, (Cw_L*x')'); xlabel("Temps (s)"); 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") ; +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 \ No newline at end of file diff --git a/latex/Illustrations/Question12.pdf b/latex/Illustrations/Question12.pdf new file mode 100644 index 0000000..d062b54 Binary files /dev/null and b/latex/Illustrations/Question12.pdf differ diff --git a/latex/Illustrations/Question16.pdf b/latex/Illustrations/Question16.pdf new file mode 100644 index 0000000..6249e67 Binary files /dev/null and b/latex/Illustrations/Question16.pdf differ diff --git a/latex/Illustrations/Question19.pdf b/latex/Illustrations/Question19.pdf new file mode 100644 index 0000000..1235738 Binary files /dev/null and b/latex/Illustrations/Question19.pdf differ diff --git a/latex/contents.tex b/latex/contents.tex index 587fb72..84291ed 100644 --- a/latex/contents.tex +++ b/latex/contents.tex @@ -204,6 +204,30 @@ Pour : \end{aligned}\right. \Rightarrow d\acute{e}cla \ A, \ B, \ C \ en \ MATLAB \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} \begin{equation*} @@ -299,6 +323,7 @@ $C_1$ et $C_2$ ????????????????? \subsection{Exercice 12} +\includegraphics[width=\textwidth]{Illustrations/Question12}\begin{align*} \subsection{Exercice 13} @@ -314,6 +339,7 @@ $C_1$ et $C_2$ ????????????????? \subsection{Exercice 16} +\includegraphics[width=\textwidth]{Illustrations/Question16}\begin{align*} \subsection{Exercice 17} @@ -323,6 +349,7 @@ $C_1$ et $C_2$ ????????????????? \subsection{Exercice 19} +\includegraphics[width=\textwidth]{Illustrations/Question19}\begin{align*} \subsection{Exercice 20} diff --git a/latex/main.pdf b/latex/main.pdf index f3fa8d3..f8dd15f 100644 Binary files a/latex/main.pdf and b/latex/main.pdf differ