我需要 tikz 绘图方面的帮助

我需要 tikz 绘图方面的帮助

我对 tikz 包还不太熟悉。我需要以下模型的帮助。 数学模型

答案1

在此处输入图片描述

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning,calc}
\usetikzlibrary {shapes,matrix}

\begin{document}
\begin{tikzpicture}[
terminal/.style={
    % The shape:
    rectangle,
    % The size:
    minimum width=2cm,
    minimum height=1cm,
    % The border:
    very thick,
    draw=blue,
    % Font
    font=\itshape,
},
]
\matrix[row sep=2cm,column sep=2cm] {%
    % First row:
    \node [terminal](p1) {First};   & & & \\
    %Second row
    \node [terminal](p2) {Second};& & & \\
    % Third row:
    \node [terminal](p3) {Third}; & & &\\
    % Fourth row:
    \node [terminal](p4) {Fourth}; & & &\\
};
\draw   ($(p1.north)+(0pt,20pt)$) edge [->,>=stealth,thick] (p1);
\draw   (p1) edge [->,>=stealth,thick] (p2)
        (p2) edge [->,>=stealth, thick] (p3);
\draw   (p3) edge [->,>=stealth,thick] (p4);
\draw   ($(p4.north)+(10pt,0)$) edge [->,>=stealth,thick] ($(p3.south)+(10pt,0)$) ;     
\draw   (p4) edge [->,>=stealth,thick,out=180,in =180,looseness=1.2] (p1);  
\draw   (p4) edge [->,>=stealth,thick,out=0,in =0,looseness=1.2] (p2);
\end{tikzpicture}
\end{document}

第一个数字

在此处输入图片描述

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning,calc}
\usetikzlibrary {shapes,matrix}

\begin{document}
\begin{tikzpicture}[
terminal/.style={
    % The shape:
    rectangle,
    % The size:
    minimum width=0.5cm,
    minimum height=0.5cm,
    % The border:
    very thick,
    draw=blue,
    % Font
    font=\itshape,anchor=south,
},
]
\matrix[row sep=1cm,column sep=2cm] {%
    % Zeroth row:
            &\node [terminal](n) {N};    & & \\
    % First row:
    \node [terminal](s) {S};    & &\node [terminal](c) {C}; & \\
    %Second row
    \node [terminal](l) {L};& & & \\
    % Third row:
    \node [terminal](h) {H}; & & &\\
    % Fourth row:
    \node [terminal](t) {T}; & & \node [terminal](r) {R};&\\
};
\draw   (n.south) edge [->,>=stealth,thick] (s.north)
        (n.south) edge [->,>=stealth, thick] (c.north);
\draw   (s) edge [->,>=stealth,thick] (l);
\draw   (l) edge [->,>=stealth,thick] (h);
\draw   (h) edge [->,>=stealth,thick] (t);
\draw   (t) edge [->,>=stealth,thick] (r);
\draw   (t) edge [->,>=stealth,thick] (c);
\draw   (h) edge [->,>=stealth,thick] (c);
\draw   (l) edge [->,>=stealth,thick] (c);
\draw   (s) edge [->,>=stealth,thick] (c);
\draw   (s) edge [->,>=stealth,thick] (r);
\draw   (l) edge [->,>=stealth,thick] (r);
\draw   ($(c.west)+(0pt,3pt)$) edge [->,>=stealth,thick] ($(s.east)+(0pt,3pt)$);
\draw   ($(h.north)+(3pt,0pt)$) edge [->,>=stealth,thick] ($(l.south)+(3pt,0pt)$);
\foreach \i in {s,l,h}
\draw ($(\i.west)+(0pt,0pt)$) edge [->,>=stealth,thick] ($(\i.west)+(-5pt,0pt)$);
\draw   ($(c.east)+(0pt,0pt)$) edge [->,>=stealth,thick] ($(c.east)+(5pt,0pt)$);
\end{tikzpicture}
\end{document}

相关内容