I am working on presentation and I searched for best way to draw electrical circuits and found out it is in LaTeX
. I worked a little bit in LaTeX
, but not enough to draw these, so if there is anyone who would help me I would be very grateful. BTW, I need to recreate these circuits:
1 Answer
Here's the first circuit, I'll leave the second as an exercise for the reader :).
\documentclass[border=20, tikz]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) to[L, l=\(L_1\)] (0, 4);
\draw (2, 0) to[C, l=\(C_1\), *-*] (2, 4);
\draw (2, 4) to[R, l=\(R_1\), *-*] (4, 4);
\draw (4, 0) to[C, l=\(C_2\), *-*] (4, 4);
\draw (6, 0) to[R, l=\(R_2\), *-] (6, 2);
\draw[fill=black] (6, 2) to[diode, l=\(D_1\), -*] (6, 4);
\draw (8, 0) to[R, l=\(R_3\), *-] (8, 2);
\draw[fill=black] (8, 4) to[diode, l=\(D_2\), *-] (8, 2);
\node[op amp, xscale=-1, yscale=-1] (opamp) at (14, 2) {};
\draw ($(opamp.out) + (-1, 0)$) to[short, *-] (opamp.out);
\draw ($(opamp.out) + (-1, 0)$) -- ($(opamp.out) + (-1, 1.5)$);
\draw ($(opamp.out) + (-1, 0)$) -- ($(opamp.out) + (-1, -1.5)$);
\coordinate (opamp plus) at (opamp.+);
\coordinate (opamp minus) at (opamp.-); % - sign in opamp.- causes errors with the |- notation
\draw (opamp plus) -- (opamp plus|-(0, 3.5));
\draw ($(opamp.out) + (-1, 1.5)$) to[R, n=R4, -*] (opamp plus|-(0, 3.5));
\node[below] at (R4.s) {\(R_4\)}; % want name to appear below below
\draw (opamp minus) -- (opamp minus|-(0, 0.5));
\draw ($(opamp.out) + (-1, -1.5)$) to[R, l=\(R_5\), -*] (opamp minus|-(0, 0.5));
\draw (0, 4) -- (2, 4);
\draw (4, 4) -- (opamp plus|-(0, 4));
\draw (15.2, 4) -- (opamp plus);
\draw (0, 0) -- (8, 0);
\draw (8, 0) to[R, l=\(R_6\)] (opamp minus|-(0, 0));
\draw (15.2, 0) -- (opamp minus);
\node[ground] at (8, 0);
\end{tikzpicture}
\end{document}
-
Thanks guys you helped me a lot!!!– user239512Apr 10, 2021 at 18:58
-
Nice. Can you elaborate why you say
% - sign in opamp.- causes errors with the |- notation
? Normally adding a space solves the problem, but I am not sure...– RmanoApr 10, 2021 at 21:19 -
You could very well be right that adding a space fixes it, aliasing the mode was just the first solution I thought of Apr 10, 2021 at 21:46
circuitikz
package: ctan.org/pkg/circuitikz