![绘制控制图](https://linux22.com/image/417165/%E7%BB%98%E5%88%B6%E6%8E%A7%E5%88%B6%E5%9B%BE.png)
答案1
尽管我发表了评论,但我还是快速尝试了您的问题。以下是使用 TikZ 的可能解决方案:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}
\tikzset{%
block/.style = {%
rectangle,
draw,
align = center
}
}
\node[block] (pid) at (0, 0) {PID\\Controller};
\node[
block,
right of = pid,
node distance = 3cm
] (plant) {Plant};
\node[
block,
draw = none,
below right of = plant,
node distance = 2cm
] (obj) {Objective\\evaluation};
\node[
block,
draw = none,
below left of = pid,
node distance = 2cm
] (param) {PID\\parameters};
\coordinate (mid) at ($(pid)!0.5!(plant)$);
\node[
block,
below of = mid,
node distance = 3cm
] (opt) {Stochastic optimization\\techniques};
\draw[-Latex] (pid.east) -- (plant.west);
\draw[-Latex] (plant.east) -| (obj.north);
\draw[-Latex] (obj.south) |- (opt.east);
\draw[-Latex] (opt.west) -| (param.south);
\draw[-Latex] (param.north) |- (pid.west);
\node[
rectangle,
above of = mid,
node distance = 1cm
] (sim) {System's simulation};
\node[
rectangle,
draw,
dashed,
fit = {(pid) (sim) (plant)}
] {};
\end{tikzpicture}
\end{document}
得到:
答案2
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,calc,math,shapes,arrows.meta,backgrounds,positioning}
\begin{document}
\begin{tikzpicture}[
terminal/.style={
rectangle,
minimum size=1cm,
text width=2cm,
align=center,
very thick,
draw=red!50!black!50, % 50% red and 50% black,
top color=white, % a shading that is white at the top...
bottom color=red!50!black!20, % and something else at the bottom
font=\itshape
}]
\tikzstyle{myarrows}=[line width=1mm,
draw=blue,
-triangle 45,
postaction={draw,
line width=3mm,
shorten >=4mm, -}]
\matrix[row sep=8mm,column sep=12mm] {
& \node [terminal](p1) {PID\\ Controller};
&
& \node [terminal](p2) {Plant}; \\
&
& \node [terminal] (p3){Stochastic Optimization Techniques};&\\
};
\draw [myarrows] (p1)--(p2);
\coordinate [left=1cm of p1.west] (p){};
\draw [myarrows] (p2.east)--++(1cm,0)|-
node[
near start,
fill=white,
align=center
]
{\scriptsize $Objective$\\\scriptsize $
Evaluation$}
(p3.east);
\draw [myarrows] (p3.west)-|
node[
near end,
fill=white,
align=center
]
{\scriptsize $PID$\\ \scriptsize $Parameters$}(p)-
-(p1);
\draw[dashed, ultra thick]
(155:5cm)--++
(0,-2cm)--++
(10cm,0cm)--++
(0,2cm)--
node[
below,
fill=white
]
{\scriptsize $System Simulation$}
(155:5cm);
\end{tikzpicture}
\end{document}
编辑——黑白答案——没有美化
平均能量损失
\documentclass[]{article}
\usepackage{tikz, tkz-euclide}% permet de dessiner des figures, des graphiques
\usetikzlibrary{matrix,arrows,calc,math,shapes,arrows.meta,backgrounds,positioning}
\begin{document}
\begin{tikzpicture}[
terminal/.style={
rectangle,
minimum size=1cm,
text width=2.2cm,
align=center,
very thick,
draw,
}
]
\tikzstyle{myarrows}=[
line width=2pt,
draw,
-latex,
]
\matrix[
row sep=4cm,
column sep=12mm
]
{%
&\node [terminal](p1) {PID\\ Controller};
&%
&\node [terminal](p2) {Plant}; \\
&
& \node [terminal] (p3){Stochastic Optimization Techniques};
& \\
};
\draw [myarrows] (p1)--(p2) ;
\coordinate [left=1cm of p1.west] (p){} ;
\draw [myarrows] (p2.east)--
++(1cm,0)|-
node[
near start,
fill=white,
align=center
]
{ Objective\\ Evaluation}
(p3.east);
\draw [myarrows] (p3.west)-|
node[
near end,
fill=white,
align=center
]
{PID\\ Parameters}(p)--
(p1);
\draw[
dashed, red,
ultra thick
]
($(p1.west)+(-.5,2)$)--
node[
below,
fill=white
]
{System Simulation}
++(10.6,0)--
++(0,-3) -|
($(p1.west)+(-.5,2)$)
;
\end{tikzpicture}
\end{document}