1

I want to draw a simple circuit in which a large parallel plate capacitor with a dielectric in between is connected to a battery like this: enter image description here

I tried the following code so far:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) to [battery] (0,5) -- (5,5) to [capacitor] (5,0) -- (0,0); 
\end{circuitikz}
\end{document}

For the above code I get this output:

enter image description here

What is the correct procedure to get an output similar to the first picure?

2 Answers 2

2

You can always try by hand:

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{positioning,decorations.markings}
\begin{document}

\begin{tikzpicture}[
    plus/.style={decoration={markings,
            mark=between positions 0 and 1 step 0.1 
                with {\draw (1pt,0)--(5pt,0);\draw (3pt,-2pt)--(3pt,2pt);}}},
    minus/.style={decoration={markings,
            mark=between positions 0 and 1 step 0.1 
                with {\draw (1pt,0)--(5pt,0);}}}]

\draw (-.5,.05) -- coordinate (aux) (.5,.05);
\draw (-.3,-.05) -- coordinate (aux1) (.3,-.05);
\node at (-.7,0) {$V$};
\node[draw,minimum width=2cm, minimum height=15mm] at (4,0) (c) {};
\draw ([yshift=1mm]c.north west)--coordinate (aux2) ([yshift=1mm]c.north east);
\path[postaction={decorate,plus}] ([yshift=2mm]c.north west)-- ([yshift=2mm]c.north east);
\path[postaction={decorate,minus}] ([yshift=-1mm]c.north west)-- ([yshift=-1mm]c.north east);
\draw ([yshift=-1mm]c.south west)--coordinate(aux3) ([yshift=-1mm]c.south east);
\path[postaction={decorate,plus}] ([yshift=1mm]c.south west)-- ([yshift=1mm]c.south east);
\path[postaction={decorate,minus}] ([yshift=-2mm]c.south west)-- ([yshift=-2mm]c.south east);
\draw (aux)--++(90:2cm) -| (aux2);
\draw (aux1)--++(-90:2cm) -| (aux3);
\draw[<->] ([shift={(-1mm,1mm)}]c.north west) -- node [left] {$d$}([shift={(-1mm,-1mm)}]c.south west);

\draw[->] ([shift={(3mm,1mm)}]c.north east) -- ++(-90:18mm) node [below] {$E=V/d$};

\end{tikzpicture}
\end{document}

enter image description here

0

A second option with circuitikz is available via "/tikz/circuitikz/bipoles/length=xcm" where x=4 cm in this demonstration is changeable. (But need to change the coordinates accordingly). A second capacitor in the middle of the default size is shown for comparison.

enter image description here

Code

\documentclass[tikz,border=10pt]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{decorations.markings}
\tikzset{
plus/.style={decoration={markings,
mark=between positions 0 and 1 step 0.05 with 
{\draw (1pt,0)--(5pt,0);\draw (3pt,-2pt)--(3pt,2pt);}}
,preaction={decorate}
},
minus/.style={decoration={markings,
mark=between positions 0 and 1 step 0.05 
with {\draw (1pt,0)--(5pt,0);}}
,preaction={decorate}
},
}
\begin{document}

\begin{circuitikz}
\draw (0,0) to [battery1,l=V] (0,5) -- (5,5) to    
[capacitor,/tikz/circuitikz/bipoles/length=4cm] (5,0) -- (0,0); 
\draw (2,5) to[capacitor](2,0);                             % for comparison
\path[plus] (4,3)--(6,3) (4,2.2)--(6,2.2);                  % charges
\path[minus] (4,2.8)--(6,2.8) (4,2.0)--(6,2.0);             % charges
\draw (4,2.86) rectangle (6,2.15);
\draw[<->] (3.7,2.9) -- node [left] {$d$}(3.7,2.1);         % label
\draw[->] (6.3,3) -- node [below,pos=1] {$E=V/d$} (6.3,2.0);% label
\end{circuitikz}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .