TAKEC

大学院生の覚書

circuitikzを用いた回路図作成

回路図を書くソフトを色々探したが、結局latexで図を描画するパッケージであるtikzのcircuitikzライブラリを用いている。 f:id:takecccc:20170621151816p:plain

\documentclass[border=1mm]{standalone}
\usepackage[dvipdfmx]{graphicx}
\usepackage{circuitikz}
\usetikzlibrary{calc}

\begin{document}
\begin{circuitikz}
    \draw
    (0,0) node [op amp] (opamp1) {}
    (5,0) node [op amp] (opamp2) {}
    (10,0) node [op amp] (opamp3) {}
    (opamp1.-) to[R,-o,label=$R_3$] ++(-2,0) coordinate (V1) {}
    (V1) node[left] {$V_1$}

    (opamp1.out) to[R,label=$R_4$] ($(opamp2.-)!(opamp1.out)!(opamp2.+)$) -| (opamp2.-)
    (opamp2.out) to[R,label=$R_5$] ($(opamp3.-)!(opamp2.out)!(opamp3.+)$) -| (opamp3.-)
    (opamp3.out) to[short,-o] ++(1,0) coordinate (V2) {}
    (V2) node[right] {$V_2$}

    (opamp1.+) -- ++(0,-1) node[ground] {}
    (opamp2.+) -- ++(0,-1) node[ground] {}
    (opamp3.+) -- ++(0,-1) node[ground] {}

    (opamp1.-) ++(0,4) coordinate (p1) {}
    (p1) ++ (10,0) coordinate (p1') {}
    ($(p1)!(opamp3.out)!(p1')$) coordinate (p2) {}

    (opamp1.-) to[short,*-] (p1)  to[R,label=$R_2$] (p2) to[short,-*] (opamp3.out)

    (opamp1.-) ++(0,1.5) coordinate (p3) {}
    (p3) ++ (5,0) coordinate(p3') {}
    ($(p3)!(opamp1.out)!(p3')$) coordinate (p4) {}
    (p3) to[C,*-*,label=$C_1$] (p4) to[short,*-*] (opamp1.out)

    (opamp1.-) ++(0,3) coordinate (p5) {}
    (p5) ++ (5,0) coordinate(p5') {}
    ($(p5)!(opamp1.out)!(p5')$) coordinate (p6) {}
    (p5) to[R,*-,label=$R_1$] (p6) -- (p4)

    (opamp2.-) ++(0,1.5) coordinate (p7) {}
    (p7) ++ (5,0) coordinate (p7') {}
    ($(p7)!(opamp2.out)!(p7')$) coordinate (p8) {}
    (opamp2.-) to[short,*-] (p7) to[C,label=$C_2$] (p8) to[short,-*] (opamp2.out)

    (opamp3.-) ++(0,1.5) coordinate (p9) {}
    (p9) ++ (5,0) coordinate (p9') {}
    ($(p9)!(opamp3.out)!(p9')$) coordinate (p10) {}
    (opamp3.-) to[short,*-] (p9) to[R,-*,label=$R_5$] (p10)
    ;
\end{circuitikz}
\end{document}