%% Exercises on the Laplace Transform
%%
%% Exercise 1 - Solving an ODE exploiting the Laplace Transform
%
% Solve the ODE
%             \ddot{y}(t) +3\,\dot{y}(t) + 2\,y(t) = u(t)
% with the forcing input u(t)
%         u(t) = \big[1+3\,t\big]\cdot \mathbf{1}(t)
% and the Initial Conditions (ICs)
%         y(0) =1\;,\qquad \dot{y}(0) = 0
%
% What if the forcing input u(t) is:
%                 u(t) =  4.815,\cos \big(0.23\,t-1.25 \big) \cdot \mathbf{1}\big(t\big)
% with the new set of Initial Conditions
%                 y(0) =-10.8\;,\qquad \dot{y}(0) = -23.42
% ?
%
%

clear variables



%
%% Exercise 2 - The State Movement of a Continuous-time LTI System
%
% Consider
% \left\{
% \begin{array}{lcl}
% \dot{x} &=& \left[ \begin{array}{cc}
% 0 & 1 \\ 0  &-a
% \end{array} \right] \, x + \left[ \begin{array}{c}
% 0 \\ K
% \end{array} \right]\, u\\ \\
% y &=& \left[ \begin{array}{cc} 1 & 0 \end{array} \right] \, x
% \end{array}
% \right.
%
% and compute the state movement, starting from the initial state
% x(0) = \left[ \begin{array}{c} 1\\0 \end{array} \right]
% with the input
% u(t) = 2 \sin \left(4 t+\frac{\pi}{3}\right) \cdot 1(t)
% The state movement is expressed by
% x(t) = \displaystyle e^{At}\cdot x(0) + \displaystyle \int_{0}^{t} e^{A(t-\tau)} \cdot B u(\tau)\,d \, \tau
% Let's compute the state movement, using the Laplace Transform.