3

I am trying to draw two different circuits for several days and just can't get all the parts together. I tried different packages like TikZ and circuitikz but not sure which one is the best for these cases. Could you please give me some light on how to draw them? I attached the pictures below. Thanks a lot in advance for suggestions and/or support.

enter image description here

enter image description here

2 Answers 2

3

This can give you an idea of how to draw the first one using TikZ:

enter image description here

The code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.markings,arrows,fit,patterns}

\tikzset{
mybox/.style={
  draw,
  text width=5pt,
  minimum height=25pt
  },
pointdec/.style={
  decoration={
    markings,
    mark=at position 0.5 with
      {
      \node[circle,fill,inner sep=1.5pt] (#1) {};
      }  
    },
  postaction=decorate  
  },  
twoline/.style={
  decoration={
    markings,
    mark=at position 0.5 with
      {
      \node[inner sep=0pt,text width=10pt,minimum height=2pt,fill=white] (twodec) {};
      \draw[solid] (twodec.north east) -- (twodec.north west);
      \draw[solid] (twodec.south east) -- (twodec.south west);
      \node[anchor=north west] at (twodec.south east) {$C_e'$};
      }  
    },
  postaction=decorate  
  },  
twolinev/.style={
  decoration={
    markings,
    mark=at position 0.5 with
      {
      \node[rotate=90,inner sep=0pt,text width=10pt,minimum height=2pt,fill=white] (twodec) {};
      \draw[solid] (twodec.north east) -- (twodec.north west);
      \draw[solid] (twodec.south east) -- (twodec.south west);
      \node[anchor=north] at ([yshift=8pt]twodec.north) {$C_e'$};
      }  
    },
  postaction=decorate  
  }  
}
\begin{document}

\begin{tikzpicture}[node distance=0.6cm and 1cm]

\node[mybox] at (5,0) (box1) {};
\node[mybox,below=of box1] (box2) {};
\node[mybox,below=of box2] (box3) {};
\node[mybox,below=of box3] (box4) {};
\node[mybox,below=of box4] (box5) {};
\draw[pointdec=a] (box1) -- (box2);
\draw[pointdec=b] (box2) -- (box3);
\draw[pointdec=c] (box3) -- (box4);
\draw[pointdec=d] (box4) -- (box5);
\coordinate[below=0.3cm of box5] (aux1);
\coordinate[above=1.2cm of box1] (aux2);
\draw (box5) -- (aux1);
\draw[pointdec=e,o-] (aux2) -- (box1);

\draw 
  ([xshift=50pt]aux1) coordinate (aux6) -- 
  ++([xshift=-50pt]-5,0) coordinate (origin);
\coordinate (aux3) at ([xshift=-1.5cm]aux1);
\coordinate (aux4) at ([xshift=-2.5cm]aux1);
\coordinate (aux5) at ([xshift=-3.5cm]aux1);

\draw (origin) -- (origin|-aux2);

\draw[dashed,twoline] 
  (b) to[out=180, in=90] 
  ([yshift=3cm]aux5) -- 
  (aux5);
\draw[dashed,twoline] 
  (c) to[out=180, in=90] 
  ([yshift=2cm]aux4) -- 
  (aux4);
\draw[dashed,twoline] 
  (d) to[out=180, in=90] 
  ([yshift=1cm]aux3) -- 
  (aux3);

\draw[dashed,twolinev]
  (a) -- (origin|-a);
\draw[dashed,twolinev]
  (e) -- (origin|-e);

\draw[-o] (d) -- ++(40pt,0) coordinate (aux7);
\draw[->,shorten >= 2pt,shorten <= 4pt] (aux7) -- 
  node[right] {$u_2(t)$} (aux7|-aux5);

\node[fit={(origin|-aux2) (-0.3,0|-aux5)}, inner sep=0pt, pattern=north east lines] {};
\node[fit={(origin) (0,-7-|aux6)}, inner sep=0pt, pattern=north east lines] {};
\end{tikzpicture}

\end{document}

The second one seems more "conventional" and I think that circuitikz could be used there.

1
  • @Ed- You're welcome. Now that your question has received answers, don't forget that you can accept the one you consider best solved your problem by clicking the checkmark to its left. In case of doubt, please see How do you accept an answer?. Feb 22, 2015 at 17:47
4

A second alternative via circuitikz and decoration library.

enter image description here

Code

\documentclass{article}
\usepackage{circuitikz}
\usetikzlibrary{patterns}

\begin{document}

\begin{circuitikz}
\draw[thick] 
(10,0) to[generic,l_=$Z_2'$,-*] 
(10,3) to[generic,l_=$Z_1'$,-*] 
(10,6) to[generic,l_=$Z_1'$,-*]
(10,9) to[generic,l_=$Z_1'$,-*]
(10,12)to[generic,l_=$Z_1'$,-*] 
(10,15)to[short,-o] 
(10,16)node[right](){$u_1(t)$};

\draw[dashed] 
(8,0)  to[C,l_=$C_e'$] (8,2) to[out=90,in=180] (10,3)
(6,0)  to[C,l_=$C_e'$] (6,4) to[out=90,in=180] (10,6) 
(4,0)  to[C,l_=$C_e'$] (4,6) to[out=90,in=180] (10,9)
(0,12) to[C,l_=$C_e'$] (10,12)
(0,15) to[C,l_=$C_e'$] (10,15); 

\draw (10,3) to[short,-o] (12,3)node(a){};
\draw[->,](a)--node[midway,right]{$u_2(t)$}(12,0);

\path (8,0)  to[C,l_=$C_e'$] (8,2)
      (6,0)  to[C,l_=$C_e'$] (6,4)
      (4,0)  to[C,l_=$C_e'$] (4,6) 
      (0,12) to[C,l_=$C_e'$] (10,12)
      (0,15) to[C,l_=$C_e'$] (10,15); 

\path[pattern=north east lines, pattern color=red]  (-0.5,-0.5) -- ++(14,0) -- ++
 (0,0.5) -- ++(-13.5,0) --++(0,16)--++(-0.5,0) --cycle;
\end{circuitikz}

\end{document}
1
  • That solution is very smart to deal with different geometries in the circuit. Thanks a lot for the answer. Ed-
    – Ed-
    Feb 22, 2015 at 17:46

You must log in to answer this question.

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