Skip to content

Instantly share code, notes, and snippets.

@kitmonisit
Last active December 2, 2018 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitmonisit/7a60223d89ee657b3f6cc77c42266937 to your computer and use it in GitHub Desktop.
Save kitmonisit/7a60223d89ee657b3f6cc77c42266937 to your computer and use it in GitHub Desktop.
Install custom packages in MacTex
\documentclass[crop]{standalone}
\usepackage{signalflowdiagram}
\begin{document}
\begin{signalflow}{Branches}
\begin{scope}
\node[adder] (add) {};
\node[input] (in1) [above left from=add] {$x_1(t)$};
\node[input] (in2) [below left from=add] {$x_2(t)$};
\node[output] (out) [right from=add] {$x_1(t) + x_2(t)$};
\path[r>] (in1) -| (add);
\path[r>] (in2) -| (add);
\path[r>] (add) -- (out);
\end{scope}
\end{signalflow}
\begin{signalflow}{Block diagram}
\begin{scope}
\node[input] (in) {$R(s)$};
\node[adder] (add) [right from=in] {};
\node[coordinate] (pt1) [right from=add] {};
\node[coordinate] (pt2) [right from=pt1] {};
\node[filter] (plant) [right from=pt2] {$\frac{G(s)}{s+1}$};
\node[node] (tap) [right from=plant] {};
\node[output] (out) [right from=tap] {$C(s)$};
\node[filter] (fb) [below left from=tap] {$H(s)$};
\node[filter] (neg) [left from=fb] {$-1$};
\path[r>] (in) -- (add);
\path[r>] (add) -- (plant);
\path[r] (plant) -- (tap);
\path[r>] (tap) -- (out);
\path[r>] (tap) |- (fb);
\path[r>] (fb) -- (neg);
\path[r>] (neg) -| (add);
\end{scope}
\end{signalflow}
\end{document}
% vim:sw=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment