我有下面的电路,想在电路中画出电压环路,这样它就类似于下面的图片了。不过,我见过有人使用电弧,但这不是我所希望的。希望有人能帮助我。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{circuitikz}
\usepackage{float}
\usepackage{calc}
\begin{document}
\begin{circuitikz}[american, straight voltages]
\draw (-1,0)
to [american voltage source, v=$V_P$, invert, voltage shift=1] (-1,4) %Input voltage Vp
to [R, R=$R_p$, i^>=$i_p$] (2,4)
to [R=$R_L$] (4,4)
to [L, l_=$L$, v^<=$v_L$, i=$i_L$, voltage shift=1.5] (7,4)
to [Tnigbt,bodydiode] (10,4)
to [short] (12,4)
to [american voltage source, v^<=$V_{out}$, voltage shift=1] (12,0)
to [short] (-1,0)
(2.0,4) to [R=$R_Ci$, i=$i_{Ci}$] (2.0,1.5)
to [C, l_=$C_i$, v^<=$v_{Ci}$] (2.0,0)
(7.2,4) to [Tnigbt,bodydiode, invert] (7.2,0)
(10.0,4) to [R=$R_Co$, i=$i_{Co}$] (10.0,1.5)
to [C, l_=$C_o$, v^<=$v_{Co}$] (10.0,0)
(8.5,5) node[align=center]{$G_2$}
(6.1,2) node[align=center]{$G_1$}
(7.2,0) node[circ, scale=1.5]{$1$}
(7.2,4) node[circ, scale=1.5]
(2,0) node[circ, scale=1.5]
(2,4) node[circ, color=red, scale=1.5]
(10,4) node[circ, color=red, scale=1.5]
(10,0) node[circ, color=red, scale=1.5]
;
\end{circuitikz}
\end{document}
这是我正在尝试重建的电路
答案1
我建议定义一个宏,它可以将“椭圆”箭头放在网格的中心,并向其提供三个角和标签。它可以进行很多调整,但或多或少,想法可能是以下一个:
\documentclass[margin=3mm]{standalone}
\usepackage[siunitx,RPvoltages]{circuitikz}
\newcommand{\mesharrow}[5][red]{% optional: color, default red
% mandatory: corner 1, corner 2, corner 3, label
\coordinate (tmp-c) at ($(#2)!0.5!(#4)$);
\node[#1] at (tmp-c) {#5};
\draw[thick, -Stealth, #1]
let \p1 = ($(#3)-(#2)$), \p2=($(#4)-(#3)$),
\n1={0.3*veclen(\x1,\y1)}, \n2={0.3*veclen(\x2,\y2}
in ($(tmp-c)+(0.3*\x1,0)$) arc(0:270:\n1 and \n2);
}
\begin{document}
\tikzset{% this definition is at tikz level, because
% it will be used with a `node[... ]` element
bigO/.style={circle, draw, fill=red, inner sep=2pt},
}
\begin{circuitikz}
\draw (0,0) coordinate(start)
% this number here (5)--v is the one referenced below in text
to [battery=$V_p$] ++(0,5) coordinate(corner1)
to[R=$R_p$, f=$i_p$] ++(4,0) coordinate(corner2)
to[R=$R_{ci}$, f=$i_{ci}$] ++(0,-2) coordinate(rci)
to[C=$C_i$, v=$v_{ci}$, -*] (corner2|-start) coordinate(corner3)
-- (start);
%% rest of the circuit...
\draw[dashed] (corner2) -- ++(1,0) (corner3) -- ++(1,0);
%% red blobs
\node [bigO] at (corner2) {};
\node [bigO] at (rci) {};
%%
\mesharrow{corner1}{corner2}{corner3}{$i_1$}
\end{circuitikz}
\end{document}
请注意,椭圆会自动调整到网格;如果我将5
上面标记的数字更改为4
或,3
则会出现:
注意:
- 该宏将使用并重用名为 的坐标
tmp-c
。Ti 中的坐标是全局的钾是,因此请使用其他地方未使用过的名称。 - 您可以使用https://tex.stackexchange.com/a/123187/38080更好地控制弧的位置和角度。