用图形绘制控制图

用图形绘制控制图

我正在尝试创建附图。但我似乎不知道如何创建它。我的代码如下所示。有人能帮我吗?谢谢你的帮助

在此处输入图片描述

  \begin{tikzpicture}
        \node [draw=black!50, 
            minimum width=2cm,
            minimum height=1.2cm,
            fill=gray!5
            ]  (controller) {Extremum Seeking Controller};

            \node [draw=black!50, 
            minimum width=5cm,
            minimum height=3cm,
            above=1.5cm of controller, fill=gray!5
            ]  (plant) {Plant};

       % \draw[-stealth] (plant.east) -| (controller.east)

       \draw[] (plant.east) -- ++ (1.5,0) 
        node[](output){}node[midway,above]{};

        \draw[-stealth] (output.east) |- (controller.east);

        \draw[] (controller.west) --++  (-1.5,0) 
            node[](fromESCline){};

        \draw[-stealth] (fromESCline.west) |-  (plant.west) ;
            
    \end{tikzpicture}

答案1

你有这个:

在此处输入图片描述

使用此代码(平面解决方案......):

\documentclass[10pt,a4paper]{article}

\usepackage{tikz,graphicx}
\begin{document}
    \begin{tikzpicture}
        \draw[-latex] (2,1)--(-1,1)-=(-1,6)--(2,6);
        \draw (2,0) rectangle (8,1.7);
        \draw (2,2.5) rectangle (8,8);
        \draw (5,2.8) node () {\Large Plant};
        \draw[-latex] (8,6)--(11,6)--(11,1)--(8,1);
        \draw[-latex] (2.5,3.5)--(7.5,3.5) node[below] {\footnotesize $u_{ss}$};
        \draw[-latex] (2.5,3.5)--(2.5,7.5) node[right] {\footnotesize $y_{ss}$};
        %\clip (3,4) rectangle (7,7);
        \draw (3,4.5).. controls  (4.5,7) and (5,6.5)..(7,4);
        \draw[dashed] (2.5,6.2)--(4.5,6.2)--(4.5,3.5);
        \draw (2.5,6.2) node[left] () {\footnotesize $y$};
        \draw (4.5,3.5) node[below] () {\footnotesize $u$};
        \draw (5,1) node[] () {\large Extremum Seeking Controller};
        \draw (0.4,6) node[above] () {\large Manipulated};
        \draw (0.4,6) node[below] () {\large Variables};
        \draw (9.5,6) node[above] () {\large Plant};
        \draw (9.5,6) node[below] () {\large Output};   
    \end{tikzpicture}
\end{document}

相关内容