在 Circuitikz 中添加电压箭头时出现黑色节点

在 Circuitikz 中添加电压箭头时出现黑色节点

我在 Circuitikz 中绘制了一个带有非反相运算放大器的电路,到目前为止,我所做的唯一修改是缩放了整个电路并改变了电压箭头的参数以使其笔直。现在,没有电压箭头,一切看起来都很好,但是当我添加它们时,输入和输出连接器(A 和 C)的上部节点突然变黑。我不知道为什么会发生这种情况,任何帮助都将不胜感激!

\documentclass[12pt]{article}
\usepackage[european]{circuitikz}
\usetikzlibrary{arrows}
\begin{document}
\begin center
\begin{circuitikz}[scale=.8,transform shape ]
\ctikzset{voltage/distance from node=.2}% defines arrow's distance from nodes
\ctikzset{voltage/distance from line=.02}% defines arrow's distance from wires
\ctikzset{voltage/bump b/.initial=.1}% defines arrow's curvature

\draw % draw nodes
(0, 0) node[op amp,yscale=-1] (opamp) {}
(-3,0.5) node[ocirc] (A) {}
(-3,-3.8) node [ocirc] (B) {}
(5,0) node[ocirc] (C) {}
(5,-3.8) node[ocirc] (D) {} 

(opamp.+) to (A)
(opamp.-) -|  (-1.5,-1.8)
to[short,*-] (.5,-1.8) 
to [C,l=$C$] (2,-1.8)
to [R,l=$R_1$] (3.2,-1.8)
to [short,-] (3.8,-1.8) to [short,-*] (3.8,0)
(opamp.out) to [short,-o] (C)
(B) to[short,-] (-1.5,-3.8) to [R,l=$R_2$,*-*] (-1.5,-1.8)
(-1.5,-3.8) [short,*-o] to (D)

%draw voltage arrows
(A) to [open,v=$u_e(t)$] (B)
(C) to [open, v^=$u_a(t)$] (D)
;
\end{circuitikz}
\end center
\end{document}

这是实际得到的电路:

同相运算放大器

答案1

通过在指定电压说明符后添加代码来添加电压说明符,而无需创建新节点。例如:(opamp.+) to (A) to [open,v=$u_e(t)$] (B)

建议

  • 不要指定手动选项,例如曲率,除非您确定这些不是您所在国家/地区使用的标准。有一个选项可以获取欧洲符号。
  • 不要使用center环境。\centering而应使用,通常在figure环境内部。

输出

在此处输入图片描述

代码

\documentclass[12pt]{article}
\usepackage[european]{circuitikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure}[hbt]
\centering
    \begin{circuitikz}[scale=.8,transform shape ]
    \ctikzset{voltage/distance from node=.2}% defines arrow's distance from nodes
    \ctikzset{voltage/distance from line=.02}% defines arrow's distance from wires
    \ctikzset{voltage/bump b/.initial=.1}% defines arrow's curvature

    \draw % draw nodes
    (0, 0) node[op amp,yscale=-1] (opamp) {}
    (-3,0.5) node[ocirc] (A) {}
    (-3,-3.8) node [ocirc] (B) {}
    (5,0) node[ocirc] (C) {}
    (5,-3.8) node[ocirc] (D) {} 

    (opamp.+) to (A) to [open,v=$u_e(t)$] (B)
    (opamp.-) -|  (-1.5,-1.8)
    to[short,*-] (.5,-1.8) 
    to [C,l=$C$] (2,-1.8)
    to [R,l=$R_1$] (3.2,-1.8)
    to [short,-] (3.8,-1.8) to [short,-*] (3.8,0)
    (opamp.out) to [short,-o] (C) to [open, v^=$u_a(t)$] (D)
    (B) to[short,-] (-1.5,-3.8) to [R,l=$R_2$,*-*] (-1.5,-1.8)
    (-1.5,-3.8) [short,*-o] to (D)
    ;
\end{circuitikz}
\end{figure}
\end{document}

相关内容