有人能帮我用 LaTeX 做这个图表块吗?

有人能帮我用 LaTeX 做这个图表块吗?

航天器控制姿态

这是我的尝试,我不擅长 LateX 编码:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}

\tikzstyle{block} = [draw, fill=white, rectangle,
minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=white, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [block, right of=sum] (spacecraft) {spacecraft};
\node [block, below right of=spacecraft](thruster controller) {thruster controller};
\node [block, above right of=thruster controller](bruitblanc) {bruit blanc};
\node [block, right of=thruster controller](matrice Ac) {matrice Ac};
\draw [->] (spacecraft) -- node[name=x(k)] {$x(k)$} (thruster controller);
\draw [->] (thruster controller) -- node[name=Tc(k)] {$Tc(k)$} (matrice Ac);
\draw [->] (matrice Ac) -- node[name=Nt(k)] {$Nt(k)$} (sum);
\draw [->] (bruitblanc) -- node[name=Nw(k)] {$Nw(k)$} (thruster controller);
\node [output, right of=sum] (output) {};
\node [block, below of=spacecraft] (calibration torque) {Calibration torque};
\node [block, right of=calibration torque](Measurment Equation) {Measurment Equation};
\node [block, right of=Measurment Equation](RLS Estimation) {RLS Estimation};


\draw [draw,->] (input) -- node {known disturbance} (sum);
\draw [->] (sum) -- node {$e$} (spacecraft);
\draw [->] (spacecraft) -- (calibration torque);
\draw [->] (calibration torque) -- node[name=Nc(k)] {$Nc(k)$} (Measurment Equation);
\draw [->] (thruster controller) |- (calibration torque);
\draw [->] (Measurment Equation) -- node[name=R(k)] {$R(k)$} (RLS Estimation);
\draw [->] (RLS Estimation) -- node [name=Aec(k)] {$Aec(k)$}(output);
\end{tikzpicture}
\end{document}

答案1

或多或少从零开始:-)

  • 情况相当复杂...
  • 现在使用相对坐标进行节点定位,
  • 图片元素的样式定义为tikzpicture
\documentclass[tikz,
               border=3mm,
               ]{standalone}
\usetikzlibrary{arrows.meta,
                calc,
                ext.paths.ortho,
                fit,
                positioning,
                quotes,
                }
\pgfdeclarelayer{foreground}\pgfdeclarelayer{background}
\pgfsetlayers{background,main,foreground}

\usepackage{bm}

\begin{document}
    \begin{tikzpicture}[auto,
node distance = 2mm and 8mm,
   box/.style = {draw, text width=#1, fill=gray!30,
                 minimum height=5ex, align=center},
 box/.default = 5em,
   dot/.style = {circle, fill, inner sep=2pt, node contents={}},
     F/.style = {draw, densely dotted, fit=#1, node contents={}},
   lbl/.style = {font=\footnotesize\linespread{0.84}\selectfont, align=center},
   sum/.style = {circle, draw, inner sep=5pt, node contents={}},
   st/.style = {box, 
        append after command={\pgfextra{\let\LN\tikzlastnode
        \begin{pgfonlayer}{foreground}
                \draw[densely dotted]
                        ($(\LN.south) + (0,0.5ex)$) to ($(\LN.north) + (0,-0.5ex)$)
                        ($(\LN.west)  + (0.5ex,0)$) to ($(\LN.east)  + (-0.5ex,0)$);
                \draw[very thick, opacity=0.5]
            ($(\LN.south west) + (2ex,1ex)$) --
                ($(\LN.south) + (-1ex,1ex)$) |-
                ($(\LN.north east) + (-2ex,-1ex)$)
                ($(\LN.north) + (+1ex,-1ex)$) |-
                ($(\LN.south) + (-1ex,1ex)$);
        \end{pgfonlayer}
                    }% end \pgfextra
                            },% end after command
                },
    arr/.style = {-Stealth, semithick},
every edge/.append style = {draw, arr},
every edge quotes/.style = {font=\footnotesize, align=center}
                        ]
\coordinate (in1);
\coordinate[above=11mm of in1] (in2);
\node (d1)  [dot, right=of in1];
\node (sum) [sum, right=of d1];
\node (sad) [box, right=of sum] {Spacecraft Attitude Dynamics};
\node (d2)  [dot, right=of sad];
\node (st)  [st, above right=of d2]   {};
\node (tc)  [box, below right=of d2]   {Thruster Controller};
\node (d3)  [dot, right=of tc];
\node (ak)  [box, right=of d3]  {$\bm{A}(k)$};

\node[F=(st) (tc)];

\coordinate[above=of st] (aux1);
    \draw[arr]  (st.east) -|- [distance=-7em]  (aux1) -| (d1);
    \draw[arr]  (in2) node[lbl, left] {$N_d(k)$\\ Anknown\\ Disturbance}
                        -|  (sum);
\coordinate[below=of tc] (aux2);
\draw[arr]  (in1)   node[lbl, left] {Known\\ Disturbance} --  (d1);
    \draw[arr]  (d2) -|-    (st);
%
    \path   (d1)    edge    (sum)
            (sum)   edge    (sad)
            (sad)   edge    (d2);
    \draw[arr]  (d2) -|-    (tc);
    \draw   (tc)    edge["$T_i(k)$"]  (ak);
    \draw[arr]  (ak.east)   node[lbl, above right] {$N_k(k)$} 
                -|- [distance=-15em]  (aux2) 
                -|  (sum);
%%
\node (ct)  [box, below=12mm of sad] {Calibration torque};
\node (me)  [box=10em, 
             right=of ct]   {Measurment Equation\\
                             $N_c(k) = \bm{A}(k)\bm{T}_c(k)$};
\node (rls) [box, below=12mm of sad.south -| ak] {RLS\\ Estimation};

\coordinate[below=of sad] (aux3);
\coordinate[above=of me]  (aux4);
    \draw[arr]  (d1) |- ([yshift=-5pt] ct.west);
    \draw[arr]  (d2) |- (aux3) -|- [distance=4em] ([yshift=5pt] ct.west);
    \draw[arr]  (d3) |-  (aux4) 
                     -|- [distance=7em] ([yshift=5pt] me.west);
%
    \path   ([yshift=-5pt] ct.east)    edge    ([yshift=-5pt] me.west)
            (me)    edge    (rls)
            (rls.east)   edge[pos=1, right,"$\hat{A}(k)$"] ++ (1,0)
            ++ (1.3,0) coordinate (out);      
%%%%
\coordinate         (aux4) at (in1 |- {$(tc.south)!0.5!(me.north)$});
\draw[dashed, thick]    (aux4) -- (aux4 -| out); 
\draw[arr, shorten <=2pt]  (aux4) -- 
        node[lbl, align=right, left] {Attitude\\ Control\\ System}      ++ (0, 1);
\draw[arr, shorten <=2pt]  (aux4) -- 
        node[lbl, align=right, left] {Truster\\ Calibration\\ System}   ++ (0,-1);
   \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容