我需要有关我的 tikzPicture 的帮助(垂直点、排列等)

我需要有关我的 tikzPicture 的帮助(垂直点、排列等)

我想实现类似这样的目标:

然而,我对垂直点有困难。我不知道如何排列它们。

[代码已更新:问题已解决]

    \usepackage{tikz}
    \usetikzlibrary{shapes,arrows, positioning, quotes}
    \usetikzlibrary{arrows.meta, positioning, decorations.markings}

    \documentclass{article}
    \begin{document}
    \begin{tikzpicture}[
    block/.style={draw,minimum width=#1,minimum height=2em},
    block/.default=8em,high/.style={minimum height=2em},auto,
    node distance=10mm, % initially 1cm
    >=Stealth, delay/.style={draw, fill=white, rectangle, minimum height=2em, minimum width=2em},
    thick, scale = 0.9 , every node/.style={scale=0.9}, 
    Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
    dash pattern=on 0.1\pgflinewidth off #1\pgflinewidth,line cap=round,
    shorten >=#1\pgflinewidth/2,shorten <=#1\pgflinewidth/2},
    Dotted/.default=3]

    % Input 
    \node (a) at (0,0) {};

    % Block
    \node[block, high, right =4cm of a] (n1) {Process};

    % Intersection 
    \draw[->] (a) -- node[pos=0.1, above] {$u(k)$} (n1) 
    coordinate[pos=0.3] (a1); 
    \fill (a1) circle (2pt);

    % Output
    \coordinate (b) at ($(n1.east)+(7cm,0)$);
    \draw[->] (n1) -- node[pos=0.95, above] {$y(k)$} (b)
    coordinate[pos=0.7] (b1);
    \fill (b1) circle (2pt);

    % Input Delay Blocks
    \node[delay, below =9.5cm of a1] (d1) {$q^{-1}$};
    \node[delay, below =0.5cm of d1] (d2) {$q^{-1}$};
    \node[delay, below =1.25cm of d2] (d3) {$q^{-1}$};

    \draw[->] (a1) -- (d1);
    \draw[->] (d1) -- (d2);

    \draw[->] (d2.south) -- ++ (0,-1em) coordinate (aux1);
    \draw[<-] (d3.north) -- ++ (0,1em) coordinate (aux2);
    \draw[ultra thick,Dotted] (aux1) -- (aux2);

    % Function Approximator
    \node[draw, fill=white, rectangle, minimum height = 10cm, minimum width = 4cm] at ($(n1)+(2cm,-10cm)$) (n2) {\parbox{2cm}{\centering Nonlinear Static\\Approximator\\$f(.)$}};

    % Model Output
    \coordinate (e) at ($(b)+(0,-10cm)$);
    \draw[->] (n2) -- node[pos=0.92, above] {$\hat{y}(k)$} (e)
    coordinate[pos=0.2] (e1);
    \fill (e1) circle (2pt);

    \coordinate (e2) at ($(b1)+(0,-10cm)$);
    \fill (e2) circle (2pt);

    % Error Summation
    \coordinate (f) at ($(b1)+(0,-5cm)$);
    \node[draw,circle, minimum width=2mm, inner sep=0pt] (f) at (f) {};
    \draw[->] (e2) -- node[pos=0.9, left] {$-$} (f);
    \draw[->] (b1) -- (f); 

    % Error
    \coordinate (g) at ($(b)+(0,-5cm)$);
    \draw[->] (f) -- node[pos=0.85, above] {$e(k)$} (g);

    % Output Delay Blocks
    \node[delay] at ($(d1)+(2.5cm, 5cm)$) (o1) {$q^{-1}$};
    \node[delay, below =0.5cm of o1] (o2) {$q^{-1}$};
    \node[delay, below =1.25cm of o2] (o3) {$q^{-1}$};

    \draw[->] (o1) -- (o2);
    \draw[->] (o2.south) -- ++ (0,-1em) coordinate (o_aux1);
    \draw[<-] (o3.north) -- ++ (0,1em) coordinate (o_aux2);
    \draw[ultra thick,Dotted] (o_aux1) -- (o_aux2);


    % Connection Model Output - Output Delays
    \coordinate (h) at ($(e1)+(0,6cm)$);
    \coordinate (i) at ($(h)+(-7.1cm,0)$);

    \draw[-] (e1) -- (h);
    \draw[-] (h) -- (i);
    \draw[->] (i) -- (o1);

    % Connect Delay Blocks
    \draw[->] (d1) -- (d1 -| n2.west);
    \draw[->] (d2) -- (d2 -| n2.west);
    \draw[->] (d3) -- (d3 -| n2.west);

    \draw[->] (o1) -- (o1 -| n2.west);
    \draw[->] (o2) -- (o2 -| n2.west);
    \draw[->] (o3) -- (o3 -| n2.west);

\end{tikzpicture}
    \end{document}

谢谢你!

答案1

我希望这能给你提供足够的里程来完成这幅画。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,arrows.meta}

\begin{document}
\begin{tikzpicture}[
    block/.style={draw,minimum width=#1,minimum height=2em},
    block/.default=8em,high/.style={minimum height=2em},auto,
    node distance=10mm, % initially 1cm
    >=Stealth,bullet/.style={circle,draw,fill,inner sep=1.5pt,auto=false}, 
    delay/.style={draw, fill=white, rectangle, minimum height=2em, minimum width=2em},
    thick, scale = 0.9 , every node/.style={scale=0.9},
    Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
    dash pattern=on 0.1\pgflinewidth off #1\pgflinewidth,line cap=round,
    shorten >=#1\pgflinewidth/2,shorten <=#1\pgflinewidth/2},
    Dotted/.default=3]

    % Input 
    \node (a) at (0,0) {};

    % Block
    \node[block, high, right =4cm of a] (n1) {Block};

    % Intersection 
    \draw[->] (a) -- node[pos=0.1, above] {$u(k)$} (n1) 
    coordinate[pos=0.3,bullet] (a1); 

    % Output
    \coordinate (b) at ($(n1.east)+(4cm,0)$);
    \draw[->] (n1) -- node[pos=0.9, above] {$y(k)$} (b)
    coordinate[pos=0.6,bullet] (b1);
    \fill (b1) circle (2pt);

    % Input Delay Blocks
    \node[delay, below =9.5cm of a1] (d1) {$q^{-1}$};
    \node[delay, below =0.5cm of d1] (d2) {$q^{-1}$};
    \node[delay, below =1.25cm of d2] (d3) {$q^{-1}$};
    \draw[->] (a1) -- (d1);
    \draw[->] (d1) -- (d2);
    \draw[->] (d2.south) -- ++ (0,-1em) coordinate (aux1);
    \draw[<-] (d3.north) -- ++ (0,1em) coordinate (aux2);
    \draw[ultra thick,Dotted] (aux1) -- (aux2);


    \node[draw, fill=white, rectangle, minimum height = 10cm, minimum width = 5cm] at ($(n1)+(2cm,-10cm)$) (n2) {Block};

    \path ([yshift=-1em]n2.north west) -- ([yshift=-1em]n2.north west-|d1)
        node[midway,delay] (d1') {$q^{-1}$};
    \node[delay, below =0.5cm of d1'] (d2') {$q^{-1}$};
    \node[delay, below =1.25cm of d2'] (d3') {$q^{-1}$};
    \draw[->] (d1') -- (d2');
    \draw[->] (d2'.south) -- ++ (0,-1em) coordinate (aux1');
    \draw[<-] (d3'.north) -- ++ (0,1em) coordinate (aux2');
    \draw[ultra thick,Dotted] (aux1') -- (aux2');

    \path coordinate[right=2em of n2,bullet] (r1) coordinate[above=2em of n2]
    (t1);
    \draw[->] (r1) -- (r1|-t1) -| (d1');
    \foreach \X in {1,2,3} 
    {\draw[->] (d\X) -- (d\X-|n2.west);
    \draw[->] (d\X') -- (d\X'-|n2.west);}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容