LaTeX 图形,如何制作?

LaTeX 图形,如何制作?

我想画这个图 在此处输入图片描述

但我失败了。这是我从代码中得到的结果。 在此处输入图片描述

你能帮我吗?这是我的代码。谢谢。

\documentclass[11pt, letterpaper]{article}
\usepackage{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{pgf}
\usepackage{schemabloc} 

\begin{document}



\begin{tikzpicture}
\centering
\sbStyleLien{ very thick}
\sbStyleBloc{fill=black!30, very thick}
\sbEntree{E}

\sbComp[5]{a}{E}
\sbComp[5]{a1}{a}
\sbBloc[3]{b}{$\dfrac{1}{1+\tau_{rv}s}$}{a1}
          \sbRelier[$\Delta P_{ref}(s)$]{E}{a}
                    \sbRelier[$\Delta P_{ref}(s)$]{a}{a1}
                    \sbRelier[$\Delta P_{rv}(s)$]{a1}{b}

                    \sbBloc[3]{c}{$\dfrac{1}{1+\tau_{T}s}$}{b}
                    \sbRelier[$\Delta P_{v}(s)$]{b}{c}
\sbComph[5]{a2}{c}                  
                    \sbRelier[$\Delta P_{m}(s)$]{c}{a2}
                    \sbBlocL[3]{d}{$\dfrac{1}{2Hs+D}$}{a2}

\sbSortie[4]{S1}{d}
\sbRelier{d}{S1}
\sbNomLien[0.8]{S1}{$\Delta \omega (s)$}


\sbDecaleNoeudy[5.5]{d}{v}


\sbBlocr[-1.5]{r2}{$\dfrac{1}{R}$}{v}


\sbRelieryx{d-S1}{r2}

\sbRelierxy{r2}{a1}



\sbDecaleNoeudy[10]{d}{u}


\sbBlocr[-1.5]{r1}{$\dfrac{K_I}{s}$}{u}
\sbDecaleNoeudx[-2]{d}{u}
\sbDecaleNoeudx[-3]{d}{v}
\sbRelieryx{d-S1}{r1}

\sbRelierxy{r1}{a}

%\sbDecaleNoeudx[-5]{v}{u}


\sbEntree{E1}
\sbDecaleNoeudy[-5]{a2}{E1}

\sbRelier[$\Delta P_{L}(s)$]{E1}{a2}

\end{tikzpicture}
\end {document}

答案1

一个不完美的起点,没有schemabloc...

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{positioning,arrows.meta,calc}
\tikzset{
  block/.style={
    shape=rectangle,
    fill=white,
    draw=black,
    minimum width=1.25cm,
    minimum height=0.75cm,
    label=above:\strut#1
  },
  sum/.style args={+ #1 - #2}{
    shape=circle,
    fill=white,
    draw=black,
    minimum size=0.75cm,
    label={#1:$+$},
    label={#2:$-$}
  },
  sum/.default={+ 195 - 255},
  flow/.style={
    draw=gray,
    -Triangle
  },
  Delta (s)/.style args={"#1_#2" #3}{
    insert path={
      node [midway, #3=0.25cm] {$\Delta #1_{\scriptsize#2}(s)$}
    }
  }
}
\begin{document}
\begin{tikzpicture}[node distance=1.25cm]
\coordinate (start);
\node [sum, right=of start] (s1) {$\Sigma$};
\node [sum, right=of s1] (s2) {$\Sigma$};
\node [block=Governor, right=of s2] (governor) {$\frac{K_g}{1+sT_g}$};
\node [block=Turbine, right=of governor] (turbine) {$\frac{K_t}{1+sT_t}$};
\node [sum={+ 165 - 105}, right=of turbine] (s3) {$\Sigma$};
\coordinate [above=of s3] (input);
\node [block=Power system, right=of s3] (power system) {$\frac{1}{2Hs+D}$};

\node [block=Speed drop, below=1.5cm of turbine] (speed drop) {$\frac{1}{R}$};
\node [block, below=0.75cm of speed drop] (block) {$\frac{K1}{s}$};
\coordinate [right=2cm of power system] (end);

\draw [flow] (start)    -- (s1)       [Delta (s)={"P_\textit{ref}" above}];
\draw [flow] (s1)       -- (s2)       [Delta (s)={"P_\textit{ref}" above}];
\draw [flow] (s2)       -- (governor) [Delta (s)={"P_g" below}];
\draw [flow] (governor) -- (turbine)  [Delta (s)={"P_v" below}];
\draw [flow] (turbine)  -- (s3)       [Delta (s)={"P_m" below}];
\draw [flow] (input)    -- (s3)       [Delta (s)={"P_L" right, near start}];
\draw [flow] (s3) -- (power system);
\draw [flow] (power system) -- (end)  [Delta (s)={"\omega_" above, near end}];
\draw [flow] ($(power system.east)!1/4!(end)$) |- (speed drop)
  node [midway, above left] {Primary loop};
\draw [flow] (speed drop) -| (s2);
\draw [flow] ($(power system.east)!1/2!(end)$) |- (block)
  node [midway, above left] {Secondary loop};
\draw [flow] (block) -| (s1);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

我从中学到了一些想法这个帖子texample.net;我试图在你的问题中画出一些接近你想要的东西。

在此处输入图片描述

%pdfLaTeX
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{shapes,arrows}

\begin{document}

\tikzset{%
  block/.style      = {draw, thick, rectangle, minimum height = 3em, minimum width = 3em},
  sum/.style        = {draw, circle},
  input/.style      = {coordinate}
}

\begin{tikzpicture}[auto, thick, node distance=3cm, >=triangle 45]
    \draw
    node [input, name=initial] {} 
    node [sum, right of=initial] (circle01) {$\sum$}
    node [sum, right of=circle01] (circle02) {$\sum$}
    node [block, right of=circle02,label=above:Governor] (block01) {$\dfrac{K_g}{1+s{T}_g}$}
    node [block, right of=block01,label=above:Turbine] (block02) {$\dfrac{K_t}{1+s{T}_t}$}
    node [sum, right of=block02] (circle03) {$\sum$}
    node [input, above of=circle03] (midpoint01) {} 
    node [block, right of=circle03,label=above:Power System] (block03) {$\dfrac{1}{2Hs+D}$}
    node [input, right of=block03] (midpoint02) {}
    node [input, node distance=1.50cm, right of=block03] (midpoint03) {} 
    node [input, node distance=2.00cm, right of=block03] (midpoint04) {} 
    node [block, below of=block02,label=above:Speed Drop] (block04) {$\dfrac{1}{R}$}
    node [block, below of=block04] (block05) {$\dfrac{Kl}{s}$}
    ;

\draw[->](initial) -- node {$\Delta P_{ref}(s)$}
                               node [pos=0.95, below] {$+$} (circle01);
\draw[->](circle01) -- node {$\Delta P_{ref}(s)$}
                                   node [pos=0.95, below] {$+$} (circle02);
\draw[->](circle02) -- node [below] {$\Delta P_{rv}(s)$}(block01);
\draw[->](block01) -- node [below] {$\Delta P_{v}(s)$}(block02);
\draw[->](block02) -- node [below] {$\Delta P_{m}(s)$}
                                    node [pos=0.95, above] {$+$} (circle03);
\draw[->](circle03) -- node {}(block03);
\draw[->](midpoint01) -- node {$\Delta P_{L}(s)$}
                                        node [pos=0.95, left] {$-$} (circle03);
\draw[->](block03) -- node {$\Delta \omega (s)$}(midpoint02);
\draw[->](midpoint03) |- node {}(block04);
\draw[->](midpoint04) |- node {}(block05);
\draw[->](block04) -| node {Primary Loop}
                                   node [pos=0.97, left] {$-$} (circle02);
\draw[->](block05) -| node {Secondary Loop}
                                   node [pos=0.985, left] {$-$} (circle01);

\end{tikzpicture}
\end{document}

相关内容