3

I'm currently getting started with circuiTikz and have a little of trouble drawing transformers. I don't really get how to place the nodes correctly? Here's what I'm trying to draw:

Circuit

And the code I have so far (the main difference is that I am replacing the Rg, Re and Le by a generic impedance Ze):

\begin{center}
\begin{circuitikz}
    \draw 
    (0,0)   to[V,v=$U_{in}$]    
    (0,2) to[generic,l=$Z_{e}$]
    (2,2) node[transformer] (T) {}
    (T.A1) node[anchor=east] {}
    (T.A2) node[anchor=east] {}
    (T.B1) node[anchor=west] {}
    (T.B2) node[anchor=west] {}
    (T.base) node{1:S$_{d}$}
    (4,2)   to[R=$R_{ms}$] 
    (6,2) to[C=$C_{ms}$] 
    (8,2) to[L=$M_{ms}$] 
    (10,2);
\end{circuitikz}
\end{center}

This code gives me this pretty messy diagram:

My messy result

I think I didn't quite got the placement and node things correctly so if anyone could help me understand this it would be great! Thanks in advance!

1
  • Note [transformer core] (p 29), and [mirror] and [invert] (p 43). Jun 5, 2018 at 10:51

1 Answer 1

4

try:

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}
    \draw
    (2,2) node[transformer] (T) {}
    (T.A2)  -- + (-2,0) coordinate (aux1)
            to[V^=$U_{in}$]    (aux1  |- T.A1) 
            to[generic,l=$Z_{e}$] (T.A1)           
    (T.B1)  to[R=$R_{ms}$] + (2,0)
            to[C=$C_{ms}$] + (2,0)
            to[L=$M_{ms}$] + (2,0) |- (T.B2);
\end{circuitikz} 
\end{document}

in above mwe are first positioned transformer. then are relative to it placed other circuit elements.

enter image description here

9
  • Thanks Zarko, that looks really nice! How can I get the voltage generator to point upwards?
    – Choups
    Jun 5, 2018 at 9:57
  • @Choups, see edited answer.
    – Zarko
    Jun 5, 2018 at 12:21
  • Thanks again. I don't understand what's the "(T.A2) -- + (-2,0) coordinate (aux1)" is doing exactly, could you detail a bit more?
    – Choups
    Jun 5, 2018 at 12:57
  • @Choups: Please have a look at the circuitikz manual. Jun 5, 2018 at 12:59
  • @Choups, (T.A2) -- + (-2,0) coordinate (aux1) draw line from transformer terminal T.A2 for 2cm to the left direction and on its end determine new coordinate named aux1 for latter use in drawing. -- + (...) means that you draw line in direction and amount determined with ....
    – Zarko
    Jun 5, 2018 at 13:09

You must log in to answer this question.

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