我是 Circuitikz 的新手。我想画这两个电路
我想知道该怎么做。谢谢大家的帮助。
答案1
基本语法是
\documentclass[standalone] % or article and other classes.
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (x1,y1) to[<circuit element like, R,L,C>, i=<value>,v=<value>,l=<label>,color=<color>]
(x2,y2) to[same as above]
(x3,y3) to[same as above]
...
(xn,yn);
\end{circuitikz}
\end{document}
以下是实现上述电路的代码
\documentclass[border=5mm,varwidth]{standalone}
\usepackage[american,siunitx]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (2,2.5) node[op amp] (opamp1) {$A_1$}
(0.8,0) node [ground] {} to [sV] (0.8,1) |- (opamp1.+)
(opamp1.-) -- + (0,1) -| (opamp1.out);
\draw (6,2) node[op amp] (opamp2) {$A_2$}
(opamp1.out) to [R=$10K$] (opamp2.-)
(4.8,1) node [ground] {}to [short] (opamp2.+)
(opamp2.-) -- +(0,1.5) to[R,l=$1M$] +(2.3,1.5) -|
(opamp2.out) to [short,-o] (8, 2)node[right]{$V_o$};
\end{circuitikz}\\
\begin{circuitikz}
\draw (0,1) to[battery1,l=$10V$] (0,4) to[R=$1K$,i=$I$] (3,4) to[D] (3,1)-- (0,1);
\end{circuitikz}
\end{document}