我想用 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}
\sbComp[5]{a}%{r1}
\sbBloc[3]{b}{$\dfrac{1}{1+\tau_{rv}s}$}{a}
%\sbRelier[$\Delta P_{ref}(s)$]{r1}{a}
\sbRelier[$\Delta P_{rv}(s)$]{a}{b}
\sbBloc[3]{c}{$\dfrac{1}{1+\tau_{T}s}$}{b}
\sbRelier[$\Delta P_{v}(s)$]{b}{c}
\sbComph[5]{a1}{c}
\sbRelier[$\Delta P_{m}(s)$]{c}{a1}
\sbBlocL[3]{d}{$\dfrac{1}{2Hs+D}$}{a1}
\sbSortie[4]{S1}{d}
\sbRelier{d}{S1}
\sbNomLien[0.8]{S1}{$\Delta \omega (s)$}
\sbDecaleNoeudy[5.5]{d}{v}
\sbBlocr[10]{r2}{$\dfrac{1}{R}$}{v}
\sbRelieryx{d-S1}{r2}
\sbRelierxy{r2}{a}
\sbDecaleNoeudx[-1]{S1}{t}
\sbDecaleNoeudy[10]{d}{u}
\sbDecaleNoeudy[-0.30]{t}{t}
\sbBlocr[10]{r1}{$\dfrac{K_I}{s}$}{u}
\sbRelieryx{t}{r1}
\sbDecaleNoeudx[-5]{a}{r11}
\sbRelierxy{r1}{r11}
\sbRelieryx{r11}{a}
\sbEntree{E1}
\sbDecaleNoeudy[-5]{a1}{E1}
\sbRelier[$\Delta P_{L}(s)$]{E1}{a1}
\end{tikzpicture}
\end {document}
答案1
由于您使用 Tikz,这里有一个替代版本。
输出
代码
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usetikzlibrary{calc,arrows.meta,positioning}
\tikzset{
rect/.style={draw, rectangle, minimum width=1.8cm},
circ/.style={draw, circle, path picture={\draw
(path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east);
}},
every label/.style={draw=none,font=\scriptsize},
}
\begin{document}
\begin{tikzpicture}[-{Stealth}, node distance=4em]
\node[rect] (n1) at (0,0) {$\dfrac{1}{1+\tau_{rv}s}$};
\node[rect, right=of n1] (n2) {$\dfrac{1}{1+\tau_{T}s}$};
\node[circ, label={[label distance=-4mm]90:$-$},label={[label distance=-4mm]180:$+$}, minimum size=8mm, right = of n2] (c1) {};
\node[rect, right= 1.5cm of c1] (n3) {$\dfrac{1}{2Hs+D}$};
\node[rect, below=1cm of n2] (n4) at (n2.south east) {$\dfrac{1}{R}$};
\node[rect, below=2cm of n1] (n5) at (n1.south east) {$\dfrac{K_I}{s}$};
\node[circ, label={[label distance=-4mm]-90:$-$},label={[label distance=-4mm]180:$+$}, minimum size=8mm, left =of n1] (c2) {};
% Arrows
\draw (n1) -- (n2) node[midway, above] {$\Delta P_{v}(s)$};
\draw (n2) -- (c1) node[midway, above] {$\Delta P_{m}(s)$};
\draw ($(c1)+(0,2)$) -- (c1) node[midway, right] {$\Delta P_{L}(s)$};
\draw (n3) --++ (3cm,0) node[midway, above] (na) {$\Delta \omega (s)$};
\draw (c1) -- (n3);
\draw (na) -- (na|-n4.east) -- (n4);
\draw (n4) -- (n4-|c2.south) -- (c2);
\draw (na.330) -- (na.330|-n5.east) -- (n5);
\draw (n5) -- (n5-|c2.south) --++ (-2,0) coordinate (a) -- (a|-c2.west) -- (c2);
\draw (c2) -- (n1);
\end{tikzpicture}
\end{document}
答案2
默认情况下,似乎\sbRelier
总是绘制arrows
,但你可以用 更改线条样式\sbStyleLien
。由于此命令会影响所有后续线条,因此最好在本地范围内定义{\sbStyleLien{...}\sbRelier...}
看起来还\sbEntree
定义了一个具有特定大小的未绘制节点,但您仍然可以将其用作.center
参考。这就是我绘制第二条反馈线的方法。
schemabloc
已经加载TikZ
包。
\documentclass[11pt, letterpaper]{article}
\usepackage{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{amssymb}
%\usepackage{tikz}
%\usepackage{pgf}
\usepackage{schemabloc}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\centering
\sbStyleLien{very thick}
\sbStyleBloc{fill=black!30, very thick}
\sbEntree{r1}
\sbComp[3]{a}{r1}
\sbBloc[5]{b}{$\dfrac{1}{1+\tau_{rv}s}$}{a}
\sbRelier[{$\Delta P_{rv}(s)$}]{a}{b}
\sbBloc[4]{c}{$\dfrac{1}{1+\tau_{T}s}$}{b}
\sbRelier[$\Delta P_{v}(s)$]{b}{c}
\sbComph[7]{a1}{c}
\sbRelier[$\Delta P_{m}(s)$]{c}{a1}
\sbBlocL[3]{d}{$\dfrac{1}{2Hs+D}$}{a1}
\sbSortie[4]{S1}{d}
\sbRelier{d}{S1}
\sbNomLien[0.8]{S1}{$\Delta \omega (s)$}
\sbDecaleNoeudy[5.5]{d}{v}
\sbBlocr[10]{r2}{$\dfrac{1}{R}$}{v}
\sbRelieryx{d-S1}{r2}
\sbRelierxy{r2}{a}
\sbDecaleNoeudx[-1]{S1}{t}
\sbDecaleNoeudy[10]{d}{u}
\sbDecaleNoeudy[-0.30]{t}{t}
\sbBlocr[10]{r11}{$\dfrac{K_I}{s}$}{u}
\sbRelieryx{t}{r11}
\sbEntree{E1}
\sbDecaleNoeudy[-5]{a1}{E1}
%
\sbRelier[$\Delta P_{L}(s)$]{E1}{a1}
{
\sbStyleLien{-, line cap=rect}
\sbRelierxy{r11}{r1.center}
}
\sbRelier{r1.center}{a}
%
\end{tikzpicture}
\end {document}
更新
你可以理解,\sbRelier[$\Delta P_{c}(s)$]{r1.center}{a}
如果你看看第 11 页Schemabloc
文档。它是用法语写的,TikZ
但是TikZ
:
\sbReiler
有三个参数,一个可选文本(#1
)和线路起点和终点坐标。由于选项,此文本写在线上方/下方,参考点是和auto
之间的中点。r1.center
a
有两种解决方案可以避免文本与比较器重叠:
增加原点和比较器之间的距离:
\sbEntree{r1}
\sbComp[3]{a}{r1} %<---- Change 3 with 4, 5, ...
node
或者使用命令(和positioning
库)添加注释:
\sbRelier{r1.center}{a}
\node[above left= .333pt of a.west]{$\Delta P_{c}(s)$};