![使用 CircuiTikz 标记变压器的电压](https://linux22.com/image/469945/%E4%BD%BF%E7%94%A8%20CircuiTikz%20%E6%A0%87%E8%AE%B0%E5%8F%98%E5%8E%8B%E5%99%A8%E7%9A%84%E7%94%B5%E5%8E%8B.png)
我正在画一个整流电路,我想标记变压器绕组两端的电压(A1 和 A2,也介于B1 和 L2.midtap, 之间B2 和 L2.midtap)。我只能标记电路元件两端的电压,但我想标记两个节点之间的电压。
这是我的代码
\begin{circuitikz}[american, scale=0.8]
\ctikzset{t/.style={
transformer core,
inductors/width=1.8,
inductors/coils=8,
quadpoles/transformer core/height=2.4}
}
\draw (0,4) node[t, anchor=A1](T){};
\node [ocirc] at (T.A1){}; \node [ocirc] at (T.A2){};
\draw (T-L2.midtap) to[short, -*] (T.B1 |- T-L2.midtap) node[ground]{}
to[short,-] ++(1,0)
to[R=$R$,-] ++(1,0)
to[short,-*] ++(1,0) node[name=a]{};
\draw (T.B1) to[D=$D_1$] (T.B1 -| a)
--(a) --(T.B2 -| a);
\draw (T.B2) to[D=$D_2$] (T.B2 -| a);
\end{circuitikz}
答案1
我添加了示例中的所有标签。请参阅 tikz 手册以了解 calc 标签协议。还有其他方法可以定位节点,但我需要让它们同时对齐 circ 和文本。
\documentclass{standalone}
\usepackage{circuitikz}% includes calc
\begin{document}
\begin{circuitikz}[american, scale=0.8]
\ctikzset{t/.style={
transformer core,
inductors/width=1.8,
inductors/coils=8,
quadpoles/transformer core/height=2.4}
}
\draw (0,4) node[t, anchor=A1](T){};
\draw (T.A1) node[below]{$+$}
(T.A2) node[above]{$-$}
($(T.A1)!0.5!(T.A2)$) node{$v_I$}
(T.outer dot A1) ++(0,0.7cm) node[circ]{}
(T.outer dot B1) ++(0,0.7cm) node[circ]{} node[right]{$+$}
(T.outer dot B1) node[right]{$v_S$}
($(T.outer dot B1)!0.4!(T.outer dot B2)$) node[right]{$-$}
($(T.outer dot B1)!0.6!(T.outer dot B2)$) node[circ]{} node[right]{$+$}
(T.outer dot B2) node[right]{$v_S$}
(T.outer dot B2) ++(0,-0.7cm) node[right]{$-$};
\node [ocirc] at (T.A1){}; \node [ocirc] at (T.A2){};
\draw (T-L2.midtap) to[short, -*] (T.B1 |- T-L2.midtap) node[ground]{}
to[R=$R$,-*] ++(3,0) coordinate (a);
\draw (T.B1) to[D=$D_1$] (T.B1 -| a)
--(a) --(T.B2 -| a);
\draw (T.B2) to[D=$D_2$] (T.B2 -| a);
\end{circuitikz}
\end{document}