电路图和网格分析 LaTeX

电路图和网格分析 LaTeX

因此,我尝试创建一个非常简单的电路,这是我的代码:

\begin{circuitikz}[american, scale = 1.5][americanvoltages]
  \draw (0,0)
  to[V=$V_{in}$] (0,2) % The voltage source
  to[R, v^<=$R_1$] (2,2) % The resistor
  to[C, v^<=$C_1$] (2,1) % Capacitor One
  to[C, v^<=$C_2$] (2,0) %Capacitor Two
  to[L, v^<=$L_1$] (0,0); %Inductor One

\draw[thin, <-, >=triangle 45] (1.25,0.5) arc (-60:170:0.5);

\end{circuitikz}

我所要做的就是能够在画出的细圆圈内写入 i_1 来表示流过电路的电流。

任何帮助都将非常感谢,谢谢。

答案1

将行更改\draw

\draw[thin, <-, >=triangle 45] (1,1)node{$i_1$}  ++(-60:0.5) arc (-60:170:0.5);

或许就是您所追求的。

在此处输入图片描述

\documentclass{article}
\usepackage{circuitikz}

\begin{document} 
\begin{circuitikz}[american, scale = 1.5][americanvoltages]
  \draw (0,0)
  to[V=$V_{in}$] (0,2) % The voltage source
  to[R, v^<=$R_1$] (2,2) % The resistor
  to[C, v^<=$C_1$] (2,1) % Capacitor One
  to[C, v^<=$C_2$] (2,0) %Capacitor Two
  to[L, v^<=$L_1$] (0,0); %Inductor One

\draw[thin, <-, >=triangle 45] (1,1)node{$i_1$}  ++(-60:0.5) arc (-60:170:0.5);

\end{circuitikz}

\end{document} 

答案2

您还可以使用path picture

\documentclass{article}
\usepackage{circuitikz}
\usetikzlibrary{bending}

\begin{document}
\begin{circuitikz}[american, scale = 1.5][americanvoltages]
  \draw (0,0)
  to[V=$V_{in}$] (0,2) % The voltage source
  to[R, v^<=$R_1$] (2,2) % The resistor
  to[C, v^<=$C_1$] (2,1) % Capacitor One
  to[C, v^<=$C_2$] (2,0) %Capacitor Two
  to[L, v^<=$L_1$] (0,0); %Inductor One

\draw[thin, <-, >=triangle 45,path picture={
            \node[anchor=center]  at (path picture bounding box.center) {$i_1$};
            }] (1.25,0.5) arc (-60:170:0.5);

\end{circuitikz}

\end{document}

请注意,我还使用了,\usetikzlibrary{bending}以便箭头弯曲得整齐。

在此处输入图片描述

答案3

您还可以尝试简单的弯曲箭头。

    \documentclass[border=2pt]{standalone}
    \usepackage{circuitikz}
    \usetikzlibrary{bending}

    \begin{document}
    \begin{circuitikz}[american, scale = 1.5][american voltages]
    \draw (0,0)
      to[V=$V_{in}$] (0,2) % The voltage source
      to[R, v^<=$R_1$] (2,2) % The resistor
      to[C, v^<=$C_1$] (2,1) % Capacitor One
      to[C, v^<=$C_2$] (2,0) %Capacitor Two
      to[L, v^<=$L_1$] (0,0); %Inductor One

      \draw[-stealth]  (0.5,1.5) to [bend left=90] node[left,node font=\tiny]{$i_1$} (0.5,0.5);     
      \end{circuitikz}

     \end{document}

弯曲较小的箭头 您会得到几乎不弯曲的箭。

答案4

我一般用这种方式:

\documentclass[border=2pt]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{bending}

\begin{document}
\begin{circuitikz}[american, scale = 1.5][american voltages]
\draw (0,0)
  to[V=$V_{in}$] (0,2) % The voltage source
  to[R, v^<=$R_1$] (2,2) % The resistor
  to[C, v^<=$C_1$] (2,1) % Capacitor One
  to[C, v^<=$C_2$] (2,0) %Capacitor Two
  to[L, v^<=$L_1$] (0,0); %Inductor One

\draw [magenta,latex-] (1.0,0.5) node[above,color=magenta]{$i_a$} arc (-90:165:5mm); 

\end{circuitikz}
\end{document}

在此处输入图片描述

相关内容