0

I am trying to create the attached diagram. But I can't seem to figure out how to create it. My code is shown below. Could someone please help me? Thanks for your help

enter image description here

  \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}

Tee
  • 147
  • You need some of these options to connect nodes. For example \draw[-stealth] (plant.east) -- ++ (1.5,0) node[align=center]{Plant \\Output} |- (controller); \draw[-stealth] (controller.west) --++ (-1.5,0) |- node[near end, align=center]{Manipulated\\Variables} (plant); – Qrrbrbirlbel Dec 15 '22 at 08:04

1 Answers1

1

You have this:

enter image description here

whit this code (flat solution...):

\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}

  • I wanted to add that there is a possibility of having a node and simply including another graphics in it in case there is real data to be displayed . Good solution Raffaele. – anis Dec 15 '22 at 09:10
  • @anis I need understanding better: You need only to change the central rectangle (Plant)? – Raffaele Santoro Dec 15 '22 at 09:20
  • All that I am saying is that I would have replaced the plant rectangle by \node [rectangle] {\includegraphics[...]{...}. But that is not a question. thank you. – anis Dec 15 '22 at 09:26
  • Thank you @RaffaeleSantoro – Tee Dec 15 '22 at 16:11
  • @anis great suggestion. I did not know that it was possible to add a graph with real data. I will consider that option. – Tee Dec 15 '22 at 16:13
  • @tee you pay want to check the tikz library named datavisualization. You an even read CSV files directly and plot them. – anis Dec 15 '22 at 16:16