I want to draw the following diagram in LaTeX:
[Tex/LaTex] How to draw a diagram with arrows
arrowsdiagramsdraw
Related Solutions
Just for a starting point.
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\begin{document}
\tikzset{ell/.style={ellipse,draw,minimum height=0.65cm,minimum width=1cm,inner sep=0.25cm}}
\begin{tikzpicture}[>=stealth]
\node[ell] (e1)at (0,0) {\color{blue}$SOC1$};
\node[ell] (e2)at (5,2) {\color{blue}$SOC2$};
\node[ell] (e4)at (5,5) {\color{blue}$SOC4$};
\node[ell] (e3)at (-5,3) {\color{blue}$SOC3$};
\node[ell] (e5)at (-1,7) {\color{blue}$SOC5$};
\draw [->] (e4) to [out=-20,in=20]node[right]{\color{red}$p^{\phi} (0)$} (e2);
\draw [->] (e2) to [out=-20,in=-40,looseness=5]node[right]{\color{red}$p^{\phi} (1)$} (e2);
\draw [->] (e2) to [out=-90,in=-30]node[right=2mm]{\color{red}$p^{\phi} (0)$} (e1);
\draw [->] (e1) to [out=0,in=240]node[right=2mm]{\color{red}$p^{\phi} (1)$} (e2);
\draw [->] (e2) to [out=190,in=-30]node[below]{\color{red}$p^{\phi} (2)$} (e3);
\end{tikzpicture}
\end{document}
From the phase plot, your transfer function has:
- 1 integrator,
- 1 pole (at w=100),
- and 2 zeros (at w=0.1 and w=10).
It can be written as follows:
Here is my attempt using bodegraph package. You can also check this tutorial: The Easiest Way to Draw a BODE Plot in LaTeX!).
\documentclass{standalone}
\usepackage{bodegraph}
\begin{document}
\begin{tikzpicture}[
gnuplot def/.append style={prefix={}},
]
\tikzset{
semilog lines/.style={black},
semilog lines 2/.style={gray!50},
semilog half lines/.style={gray!50, dotted},
semilog label x/.style={below,font=\small},
semilog label y/.style={above,font=\small} }
\begin{scope}[xscale=10/5,yscale=5/200]
% y axis step
\OrdBode{50}
% Semilog grid
\semilog*{-2}{3}{-100}{100}
% Plot asymptotic lines
\draw[blue!80,dashed,line width=1.2] (-2,-90 ) -| (-1,0 ) -| (1,90) -|(2,0) -- (3,0);
% Phase plot of the transfer function
\BodeGraph[red!80]{-2:3}{\IntArg{1}+\POArg{1}{0.01}-\POArg{1}{10}-\POArg{1}{0.1}}
% Text node
\node[fill=white] at (-1,50){Phase ($^{\circ}$)};
\end{scope}
\end{tikzpicture}
\end{document}
which yields:
For a touch of style, suggested by @Sebastiano, you can modify opacity of the phase label as follows:
\node[fill=white,opacity=0.9] at (-1,50){Phase ($^{\circ}$)};
Best Answer
It's quite easy with
tikz-cd
:But, in my humble opinion, I'd vote for picture-mode, for its far more user-friendly syntax:
Update:
tikz-cd
solution for the second diagram: