%
% AlgebraBlocchi.tex
%

\documentclass{beamer}

\usepackage{beamerthemeshadow}
\usepackage{listings}
\usepackage{graphics}
\usepackage{times}
\usepackage{algorithm2e}

\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
% \usepackage{amsmath,amssymb} \usepackage[latin1]{inputenc}
% \usepackage{colortbl}
\usepackage[english]{babel}

\newcommand{\erlang}{
\lstset{language=Prolog, basicstyle=\ttfamily\footnotesize,frame=trBL,
  frameround=fttt}}

\newcommand{\erlangsmall}{
\lstset{language=Prolog, basicstyle=\ttfamily\scriptsize,frame=trBL,
  frameround=fttt}}

\newcommand{\clang}{
\lstset{language=Prolog, basicstyle=\ttfamily\footnotesize,frame=trBL,
  frameround=fttt}}

\newcommand{\clangsmall}{
\lstset{language=Prolog, basicstyle=\ttfamily\scriptsize,frame=trBL,
  frameround=fttt}}

\newcommand{\clangtiny}{
\lstset{language=Prolog, basicstyle=\ttfamily\tiny,frame=trBL,
  frameround=fttt}}

\erlang

\newcommand\blue{\color[rgb]{0,0,1}}
\newcommand\green{\color[rgb]{0,0.5,0}}
\newcommand\red{\color[rgb]{1,0,0}}
\newcommand\black{\color[rgb]{0,0,0}}

\newcommand\tape[9]{
\framebox{#1}
\framebox{#2}
\framebox{#3}
\framebox{#4}
\framebox{#5}
\framebox{#6}
\framebox{#7}
\framebox{#8}
\framebox{#9}}

\newcommand\two[2]{
\framebox{#1}
\framebox{#2}}

\newcommand\six[6]{
\framebox{#1}
\framebox{#2}
\framebox{#3}
\framebox{#4}
\framebox{#5}
\framebox{#6}}

\newcommand\three[3]{
\framebox{#1}
\framebox{#2}
\framebox{#3}}

\title[Algebra FDT]{Algebra a Blocchi delle\\Funzioni di Trasferimento}
%%

\author[Corrado Santoro]
       {Corrado Santoro}

\date{ }

\institute[University of Catania]
  {
    \begin{center}
      \textbf{\red{}ARSLAB - Autonomous and Robotic Systems Laboratory}\\
      Dipartimento di Matematica e Informatica - Universit\`{a} di Catania, Italy\\
      \texttt{santoro@dmi.unict.it}\\
      \includegraphics[width=60pt]{robotEscher_Eura_blur.eps}\\%%~~~~\includegraphics[width=80pt]{logo_dmi.png}
      Programmazione Sistemi Robotici\\
    \end{center}
  }



\begin{document}

\frame{\titlepage}


\newcommand\LT[1]{\mathcal{L}\{#1\}}
\newcommand\ILT[1]{\mathcal{L}^{-1}\{#1\}}


%%
\begin{frame}[fragile]
%%
  \frametitle{Sistemi in serie}
%%
\begin{center}
\includegraphics[scale=0.3]{sistemi_serie.eps}
\end{center}
La funzione di trasferimento di due sistemi in serie \`{e} il prodotto
delle due funzioni di trasferimento:
\[
G(s) = G_1(s)G_2(s)
\]
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Sistemi in parallelo}
%%
\begin{center}
\includegraphics[scale=0.25]{sistemi_parallelo_1.eps}
\end{center}
La funzione di trasferimento di due sistemi in parallelo con un
\textbf{sommatore} in uscita  \`{e} la somma
delle due funzioni di trasferimento:
\[
G(s) = G_1(s) + G_2(s)
\]
\end{frame}
%%



%%
\begin{frame}[fragile]
%%
  \frametitle{Sistemi in parallelo}
%%
\begin{center}
\includegraphics[scale=0.25]{sistemi_parallelo_2.eps}
\end{center}
La funzione di trasferimento di due sistemi in parallelo con un
\textbf{sottrattore} in uscita  \`{e} la differenza
delle due funzioni di trasferimento:
\[
G(s) = G_1(s) - G_2(s)
\]
\end{frame}
%%



%%
\begin{frame}[fragile]
%%
  \frametitle{Combinazione Serie/Parallelo}
%%
\begin{center}
\includegraphics[scale=0.25]{blocchi_vari.eps}
\end{center}
\[
G(s) = -G_1(s)G_2(s) + G_3(s)
\]
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Sistemi con Feedback}
%%
\begin{center}
\includegraphics[scale=0.2]{feedback_1.eps}
\end{center}
\begin{eqnarray*}
\small%%
Y & = & U_1 G_1\\
U_1 & = & U + G_2Y\\
Y & = & (U + G_2Y)G_1\\
Y & = & UG_1 + G_1G_2Y\\
Y - G_1G_2Y & = & UG_1\\
Y( 1 - G_1G_2) & = & UG_1\\
Y & = & \frac{G_1}{ 1 - G_1G_2}U\\
\red{}G & \red{}= & \red{}\frac{G_1}{ 1 - G_1G_2}
\end{eqnarray*}
\end{frame}
%%



%%
\begin{frame}[fragile]
%%
  \frametitle{Feedback Negativo}
%%
\begin{center}
\includegraphics[scale=0.2]{feedback_2.eps}
\end{center}
\begin{eqnarray*}
\small%%
Y & = & U_1 G_1\\
U_1 & = & U - G_2Y\\
Y & = & (U - G_2Y)G_1\\
Y & = & UG_1 - G_1G_2Y\\
Y + G_1G_2Y & = & UG_1\\
Y( 1 + G_1G_2) & = & UG_1\\
Y & = & \frac{G_1}{ 1 + G_1G_2}U\\
\red{}G & \red{}= & \red{}\frac{G_1}{ 1 + G_1G_2}
\end{eqnarray*}
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Implementazione}
%%
\begin{block}{}
\begin{center}
Implementazione di schemi basati su\\
composizione di funzioni di trasferimento
\end{center}
\end{block}
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Implementazione di Sistemi Composti}
%%
\begin{center}
\includegraphics[scale=0.2]{blocchi_vari.eps}
\end{center}
%%
\begin{block}{}
\begin{itemize}
\item Sono modelli basati sul \textbf{data flow}
\item Ogni \textbf{arco} corrisponde ad una \textbf{\red{}grandezza} (o una
  \textbf{variabile})
\item Ogni \textbf{blocco} corrisponde ad una \textbf{\red{}funzione}
  (matematica) che
  riceve, come parametro, la/le variabili in ingresso e restituisce la
  variabile/grandezza di output
\item Ogni \textbf{nodo} rappresenta una \textbf{\red{}operazione
  matematica} sulle variabili/grandezze associate
\end{itemize}
\end{block}
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Implementazione di Sistemi Composti}
%%
\begin{center}
\includegraphics[scale=0.2]{blocchi_vari.eps}
\end{center}
%%
\clangsmall
\begin{lstlisting}
// G1, G2 and G3 are subclasses of DynamicSystem
G1 g1;
G2 g2;
G3 g3;
...
  foreach (sampling interval) {
    input = ...
    y1 = g1.evaluate(input);
    y2 = g2.evaluate(y1);
    y3 = g3.evaluate(input);
    output = y3 - y2;
    ...
  }
...
\end{lstlisting}
\end{frame}
%%


%%
\begin{frame}[fragile]
%%
  \frametitle{Implementazione di Sistemi Composti}
%%
\begin{center}
\includegraphics[scale=0.2]{feedback_2.eps}
\end{center}
%%
\clangsmall
\begin{lstlisting}
// G1 and G2 are subclasses of DynamicSystem
G1 g1;
G2 g2;
...
  y = 0; // initial condition
  foreach (sampling interval) {
    u = ... // our input
    u1 = u - g2.evaluate(y);
    y = g1.evaluate(u1);
    output = y;
    ...
  }
...
\end{lstlisting}
\end{frame}
%%


\frame{\titlepage}


\end{document}
%%
%%

