1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
% ----------------------------------------------------------
\chapter{Figuras e gráficos}
% ----------------------------------------------------------
\section{Introdução}
Sugiro que você guarde todas as figuras na pasta ``figuras'' para que seu projeto fique mais organizado. A \cref{fig:logolatex} mostra como é fácil inserir uma figura com legenda e referência à fonte.
\begin{figure}[htb]
\begin{center}
\includegraphics[width=0.5\linewidth]{1280px-LaTeX-logo.png}
\caption{Circuito com diodo túnel.} \label{fig:logolatex}
\legend{Fonte: Wikimedia Commons \cite{wikimedia-latex}.}
\end{center}
\end{figure}
Além de figuras, é possível inserir caixas de texto de diversos tipos, como axiomas, teoremas etc.
\section{Exercício}
\begin{exercise}
Explique como Isaac Newton usaria cada um dos pacotes seguintes, se vivesse no tempo presente:
\begin{enumerate}[label=(\Alph*)]
\item Metapost
\item TikZ
\item PGFPlots
\item PSTricks
\end{enumerate}
\end{exercise}
\section{Exemplo}
\begin{example}
Einstein usaria um editor WYSIWYG ou \LaTeX? \\
Einstein era físico. Portanto, usando o teorema LaTeX-WYSIWYG, concluímos que ele usaria \LaTeX.
\end{example}
\section{Algoritmo}
O \cref{alg:NNMPC} é um pseudo-código para obtenção de um controlador preditivo baseado em modelo e em redes neurais.
\begin{algorithm} [ht]
\caption{NN-based MPC pseudocode for consensus control}
\label{alg:NNMPC}
\begin{algorithmic}[1]
%\Procedure{Roy}{$a,b$} \Comment{This is a test}
\State System Initialization at $x(0), \theta(0)$
\State $J = V(e(0),\theta(0))$
\State $K^{ab}_0 = 0$ $\forall (a,b)$
\State $dataset \gets [K_0,J]$
\For{$k = 1:k_{max}$} \Comment{Simulation loop}
\State $(W,Y) \gets train(dataset)$
\State $\tilde{J} = Y\sigma(Wz)$ $\forall K^{ab}_k\pm \delta_K
$
\State $K_k^{\ast} = arg \min_{K_k}(\tilde{J})$
\State $u(k) = \left( L(\theta(k)) \otimes K_k^{\ast} \right) x(k)$
\State $\hat{x}(k) = x(k)$; $\hat{\theta}(k) = \theta(k)$
\For{$t = k+1:k+h+1$} \Comment{Prediction loop}
%\For{$s = 1:S$} \Comment{Markov loop}
\State $\hat{\theta}(t) = randMarkov(\hat{\theta}(t-1),\Pi)$
\State $p = \hat{\theta}(t)$
\State $\hat{u}(t) = \left( L(p) \otimes K_k^{\ast} \right) \hat{x}(t)$
\State $\hat{x}(t+1) = F_p(\hat{x}(t))$
\State $x_0(t) = mean(\hat{x}(t))$
\State $\hat{e}(t) = F_p(\hat{x}(t)) - \boldsymbol{1_N} f_{p0}(x(t)) $
\State $\hat{V}_t = \hat{e}^T(t)P_{p}\hat{e}(t)$
\EndFor
%\State $r(t) = r(t-k)\Pi^{k}$
%\State $\bar{V}_t = \sum_{s=1}^S r_s(t) V_t^s$
%\EndFor
\State $\hat{J} = \sum_{t = k+1}^{k+h+1} \hat{V}_t$
\State $dataset \gets [K^{\ast}_k,\hat{J}]$
\State $x(k+1) = F_p(x(k))$
\EndFor
%\EndProcedure
\end{algorithmic}
\end{algorithm}
\section{Programa}
\begin{lstlisting}
/**
* MSO: ativa o servo cujo eixo eh descrito
* por drive_axis; informacoes de controle
* sao gravadas em MSO_1
*/
MSO(drive_axis,MSO_1);
/* Atribui o valor 0.0 ao primeiro elemento do array speed */
speed[0] := 0.0;
/* Atribui 1 para dataInitialized */
dataInitialized := 1;
\end{lstlisting}
Para mais exemplos de programas, veja o \cref{apd:cdg}
|