如何在 LaTeX 中绘制下图的传递图?

如何在 LaTeX 中绘制下图的传递图?
\documentclass[tikz,border=3.4mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}

\begin{figure}[htbp]
\centering
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\begin{tikzpicture}[auto, node distance=2cm,>=latex,block/.style={draw, fill=white, rectangle, 
    minimum height=3em, minimum width=4em}]
 %\node[block] (S) {S};
 \node[block] (H) {H};
 \node[block, right=of H] ($C_{1}$) {$C_{1}$};
 \node[block, right=of $C_{1}$] ($C_{2}$) {$C_{2}$};
 \node[block, below=of $C_{1}$] (A) {A};
 \node[block, above=of H] (S) {S};
 \node[block, above=of $C_{1}$] (E) {E};
 \node[block, above=of $C_{2}$] (I) {I};
 \node[block, right=of S] (E) {E};
 \node[block, right=of E] (I) {I};
 \node[block, right=of I] (T) {T}; 
  
 \draw[->] (H) -- node[pos=0.5,above]{$\beta_{3}$} ($C_{1}$);
 \draw[->] ($C_{2}$) -- node[pos=0.5,above]{$\kappa_{1}$} ($C_{2}$);
 \draw[->] (H.-45) -- node[pos=0.5,below,sloped] {$\delta_{1}$} (A.-60);
 \draw[->] ($C_{1}$) -- node[pos=1,right] {$\delta_{2}$} (A);
 \draw[->] ($C_{2}$.-45) -- node[pos=0.5,below,sloped] {$\delta_{3}$} (A.-60);
 \draw[->] ($C_{2}$.-135) -- ++ (0,-3) -| node[pos=0.25] {$r_{3}$} (H.-135);
 \draw[->] (H.45) -- ++ (1,0) node[above]{$\mu$};
 \draw[->] ($C_{2}$.0) -- ++ (1,0) node[right]{$d+\mu$};
 \draw[->] (A.0) -- ++ (1,0) node[right]{$\alpha+\mu$};
 \draw[->] ($C_{1}$.-135) -- ++ (0,-1) node[below]{$\mu$}; 
 \draw[->] (S.45) -- ++ (0,1) -| node[pos=0.25,above]{$(1-m) \beta \left( \frac{I+C_{2}}{N}  \right)$} (I); 
 \draw[->] (S) -- node[pos=0.5,below]{$m \beta \left( \frac{I+C_{2}}{N}\right)$}(E);
 \draw[->] (E) -- node[pos=0.5,above]{$\kappa$} (I);
 \draw[->] (E.90) -- ++ (0,0.5) node[right] {$\mu$};
 \draw[->] (I) -- node[pos=0.4,above] {$r_1$} (T);
 \draw[->] (T.-135) -- ++ (0,-0.5) -| node[pos=0.25] {$q\delta$} (E.-45);
 \draw[->] (T.90) -- ++ (0,2) -| node[pos=0.25,above] {$(1-q)\delta$} (S.90);
 \draw[<-] (S.180) -- ++ (-1,0) node[left] {$\Lambda$};
 \draw[->] (T.0) -- ++ (1,0) node[right]{$\mu$};
 \draw[->] (S.135) -- ++ (0,0.5) node[above]{$\mu$};
 \draw[->] (I.45) -- ++ (0,0.5) node[right]{$\mu+d_1$};
 
 \end{tikzpicture}
\caption{The transfer diagram of HIV-TB transmission dynamic.}
\label{fig:1_p5}
\end{figure}
\end{document}

转移图

答案1

对您的代码进行一些修改。

A

这是TransferDiagram.tex为了将 Tikz 图形生成为独立图形。在数学文本中列出节点的助记名称并不方便。

%%% File TransferDiagram.tex

\documentclass[tikz,border=3.4mm]{standalone}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}

\begin{document}
    
        \begin{tikzpicture}[auto, node distance=2cm,>=latex,block/.style={draw, fill=white, rectangle, 
                minimum height=3em, minimum width=4em}]     
            \node[block]             (H)    {$H$};
            \node[block, right=of H] (C1)   {$C_1$};
            \node[block, right=of C1](C2)   {$C_2$};
            \node[block, below=of C1](A)    {$A$};
            \node[block, above=of H] (S)    {$S$};
            \node[block, right=of S] (E)    {$E$};
            \node[block, right=of E] (I)    {$I$};
            \node[block, right=of I] (T)    {$T$};          
        
            \draw[->] (S) -- node[pos=0.5,left]{$\beta_{1}$} (H);
            \draw[<-] (S.west) -- ++ (-1,0) node[left] {$\Lambda$};
            \draw[->] (S.-45) -- ++ (0,-0.5) node[below]{$\mu$};
            \draw[->] (S.45) -- ++ (0,1) -| node[pos=0.25,above]{$(1-m) \beta \left( \frac{I+C_{2}}{N}  \right)$} (I); 
            \draw[->] (S) -- node[pos=0.5,above]{$m \beta$}(E);
            \draw[->] (E) -- node[pos=0.5,above]{$\kappa$} (I);
            \draw[->] (E) -- node[pos=0.5,left]{$\beta_{1}$} (C1);
            \draw[->] (I) -- node[pos=0.4,above] {$r_1$} (T);
            \draw[->] (T.east) -- ++ (1,0) node[right]{$\mu$};
            \draw[->] (I.45) -- ++ (0,0.5) node[right]{$\mu$};  
            \draw[->] (T.south) -- ++ (0,-0.5) -| node[pos=0.25] {$q\delta$} (E.-45);
            \draw[->] (T.north) -- ++ (0,2) -| node[pos=0.25,above] {$(1-q)\delta$} (S.north);              
                    
            \draw[->] (H) -- node[pos=0.5,above]{$\beta_{3}$} (C1);
            \draw[->] (H.south) -- node[pos=0.5,below,sloped] {$\delta_{1}$} (A.west);
            \draw[->] (H.45) -- ++ (0,0.5) node[right] {$\mu$};
            \draw[->] (C1) -- node[pos=0.5,right] {$\delta_{2}$} (A);
            \draw[->] (C1.-135) -- ++ (0,-0.5) node[below]{$\mu$};          
            \draw[->] (C1) -- node[pos=0.5,above]{$\kappa_{1}$} (C2);   
            \draw[->] (C2.south) -- node[pos=0.5,below,sloped] {$\delta_{3}$} (A.east);
            \draw[->] (C2.-45) -- ++ (0,-3.5) -| node[pos=0.25] {$r_{3}$} (H.-135);
            \draw[->] (C2.east) -- ++ (1,0) node[right]{$\mu$};
            \draw[->] (A.-25) -- ++ (1,0) node[right]{$\alpha+\mu$};        
                    
        \end{tikzpicture}
\end{document}

main.tex这是将传输图插入主文档的文件。

%% File main.tex

\documentclass[12pt,a4paper]{article}

\usepackage{graphicx}

\begin{document}    
        
\begin{figure}[ht!]
    \centering
    \includegraphics{TransferDiagram.pdf}
    \caption{The transfer diagram of HIV-TB transmission dynamic.}
    \label{fig:1_p5}
\end{figure}
\end{document}

相关内容