我發現了很多關於將節點與運算放大器輸出對齊的方法。但假設 tikzpicture 中有一個節點,並且我想放置一個運算放大器,使其輸入與該節點對齊。
我該怎麼做呢?
例如我們的情況,想將 C1 連接到運算放大器的正極輸入。
\documentclass[]{article}
%opening
\title{}
\author{}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usepackage[siunitx]{circuitikz} % Loading circuitikz with siunitx option
\begin{document}
\maketitle
\begin{abstract}
\end{abstract}
\section{}
\begin{figure}[!htbp]
\centering
\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
\begin{tikzpicture}
\draw
node[op amp,yscale=-1] (opamp) {}
node[ocirc, left=3cm of opamp.+] (B) {}
node[ocirc, below=5cm of B] (A) {}
%node[op amp,yscale=-1] (opamp1) {}
coordinate[right=0.5cm of opamp.out] (tmpout1)
node[circ, below=2cm of tmpout1] (div1) {}
(tmpout1 |- A) coordinate (tmpgndout1)
coordinate[left=0.5cm of opamp.-] (opamp1-)
(B) -- (opamp.+)
(A) -- (tmpgndout1)
(opamp.-) -- (opamp1-) -- (opamp1- |- div1) -- (div1)
(opamp.out) -- (tmpout1) to[R, l=$R_1$] (div1)
(div1) to[R, l=$R_2$] (tmpgndout1)
node[circ, right=2cm of tmpout1] (stage2in) {}
(tmpout1) to[C,l=C$_1$] (stage2in)
(stage2in) to[R,l=$R_3$] (stage2in |- A) -- (tmpgndout1)
node[op amp,right=1cm of stage2in,yscale=-1] (opamp) {}
;
\end{tikzpicture}
\caption{Active Envelope Detector Circuit}
\label{fig:detector_circuit_active}
\end{figure}
\end{document}
答案1
無論如何,您自己找到了解決方案,我建議您查看以下電路代碼(我認為更一致):
\documentclass[margin=3mm]{standalone}
\usepackage{siunitx}
\usepackage[siunitx]{circuitikz} % Loading circuitikz with siunitx option
\begin{document}
\begin{tikzpicture}
\node [op amp, yscale=-1] (oa1) {};
\draw (oa1.+) to[short,-o] ++ (-1,0) coordinate (in)
(oa1.out) to [R=$R_1$,*-*] ++ (0,-2) coordinate (aux1)
to [R=$R_2$,-*] ++ (0,-2)
(oa1.out) to [C=$C_1$,-*] ++ (2,0) coordinate (aux2)
to [R=$R_3$,-*] ++ (0,-4) coordinate (aux3)
to [short,-o] (in |- aux3)
(aux1) -| (oa1.-)
(aux2) to[short] ++ (1,0)
node[op amp, yscale=-1,anchor=+] (oa2) {}
(oa2.out) to [short,-o] ++ (1,0) coordinate (out)
(aux3) to[short,-o] (aux3 -| out);
\end{tikzpicture}
\end{document}
在我的 MWE 中,我只專注於圖像,所以我使用standalone
文檔類別。只要您提供有關電路的信息,方案就完成了。它可能會幫助您繪製電路。
答案2
我找到了答案,我認為應該沒問題。
node[op amp, right= 2cm of stage2in, anchor=+, yscale=-1] (opamp2) {}