定位并添加另一个输入节点

定位并添加另一个输入节点

目前,我有类似的东西

\begin{tikzpicture}
                    \node [draw=black,
                    minimum width=3cm,
                    minimum height=1.2cm,
                    ]  (controller) {1};
                    
                    \node [draw=black,
                    minimum width=3cm, 
                    minimum height=1.2cm, 
                    right=0.8cm of controller
                    ]  (sensor) {2};
                    
                    \node [draw=black,
                    minimum width=3cm, 
                    minimum height=1.2cm, 
                    right=0.8cm of sensor
                    ]  (system) {3};
                    
                    \draw[-stealth] (system.south) -- +(0,-0.39) -| node[pos=0.25,above]{x} (sensor.south);
                    \draw[-stealth] (controller.east) --  node[pos=0.5,above]{$u_{no}$} (sensor.west);
                    \draw[-stealth] (sensor.east) --  node[pos=0.5,above]{$u$} (system.west);
                    
                    \draw[-stealth] (system.east) -- ++ (1.25,0) 
                    node[midway](output){}node[midway,above]{$y_{out}$};
                    
                    \draw[-stealth] (output.center) -- +(0,-1.5) -| node[pos=0.25,above]{} (controller.west);
                \end{tikzpicture}

我应该如何更改才能使我的第一个块具有像这里一样的两个输入?如何添加另一个?如何将其定位好?如何更改此现有节点以使其不直接靠近块?

在此处输入图片描述

答案1

删除最后一行代码

\draw[-stealth] (output.center) -- +(0,-1.5) -| node[pos=0.25,above]{} (controller.west);

并添加以下两行

\draw[-stealth] (output.center) -- +(0,-1.5) -| node[pos=0.25,above]{} ($(controller.west)+(-2ex,-2ex)$) -- ($(controller.west)+(0ex,-2ex)$);

\draw[-stealth] ($(controller.west) + (-4ex,0ex)$) -- (controller.west) ;

在此处输入图片描述

\documentclass{scrreprt}

\usepackage{tikz}
\usetikzlibrary{positioning,fit,calc,backgrounds}


\begin{document}

\begin{tikzpicture}
                    \node [draw=black,
                    minimum width=3cm,
                    minimum height=1.2cm,
                    ]  (controller) {1};
                    
                    \node [draw=black,
                    minimum width=3cm, 
                    minimum height=1.2cm, 
                    right=0.8cm of controller
                    ]  (sensor) {2};
                    
                    \node [draw=black,
                    minimum width=3cm, 
                    minimum height=1.2cm, 
                    right=0.8cm of sensor
                    ]  (system) {3};
                    
                    \draw[-stealth] (system.south) -- +(0,-0.39) -| node[pos=0.25,above]{x} (sensor.south);
                    \draw[-stealth] (controller.east) --  node[pos=0.5,above]{$u_{no}$} (sensor.west);
                    \draw[-stealth] (sensor.east) --  node[pos=0.5,above]{$u$} (system.west);
                    
                    \draw[-stealth] (system.east) -- ++ (1.25,0) 
                    node[midway](output){}node[midway,above]{$y_{out}$};
                    
                    \draw[-stealth] (output.center) -- +(0,-1.5) -| node[pos=0.25,above]{} ($(controller.west)+(-2ex,-2ex)$) -- ($(controller.west)+(0ex,-2ex)$);

                    \draw[-stealth] ($(controller.west) + (-4ex,0ex)$) -- (controller.west) ;
                    
                \end{tikzpicture}


\end{document}

相关内容