如何在 tikz 中绘制此块图

如何在 tikz 中绘制此块图

闭环系统

这是我的代码:

\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [block, name=G] (a) {$G$};
\node[left=of a.160](G1){$W$};
\node[left=of a.200](G2){};
\node [output, right of=a] (output) {};
\node[right=2cm of a](o1){$Z$};
\node[right=2cm of a](o2){};
\node [block, below of=a] (sensor) {$F$};
\draw[->] (G1) -- (a.160);
\draw[->] (G2) -- (a.200);
\draw[->] (a) -- (o1);
\draw[-] (a) -- (o2);
\draw [->] (o2) |- node [near start] {$\bar{Y}$} (sensor);
\draw [-] (sensor) -| node [near end] {$U$} (G2);
\end{tikzpicture}

这是我的代码。不幸的是,我无法生成我想要的框图,请帮忙。提前谢谢。

答案1

像这样?

在此处输入图片描述

由于您的文档序言和节点样式未知,我定义了自己的样式:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows,positioning}

\begin{document}
    \begin{tikzpicture}[auto, node distance=1cm,>=latex',
block/.style={draw,minimum width=22mm, minimum height=11mm}
                        ]
\node [block, name=G]       (a)     {$G$};
\draw[<-]   (a.170) -- + (-2,0) node[left]  {$W$};
\draw[->]   (a.10)  -- + ( 2,0) node[right] {$Z$};
\node[block,below=of a] (sensor) {$F$};
\draw[->]   (a.350) -- + (2,0) |- node [near start] {$\bar{Y}$} (sensor);
\draw[->]   (sensor.west) -- +(-2,0) |- node [pos=0.25] {$U$} (a.190);
    \end{tikzpicture}
\end{document}

相关内容