4

I want to implement this transformer model in Latex using circuitikz. I am able to draw the Basic elements like transformer, resistor and inductor. But i'm unable to place the arrows with Labels, the labelled circular arrows and also the dotted line around the ideal transformer block. I am not an expert with this tool. kindly please help me with this. Thanks a lot. enter image description here

Here is the code that i used, when i compiled it, the Output Looks a Little conjusted because of all the variables overlapping on each other. can some one please take this up and beautify it a Little more so that it matches the above figure.

\begin{figure}[h!]
\label{fig:tfmodel}
\begin{circuitikz}[european]
\draw (0,0)
to[short,o-*] (1,0) node[anchor=south]{$K_1$}
to[R, l^=$R_{p}$, v_>=$U_{R_{p}} I_{R_{p}}$, *-*] (3.5,0) node[anchor=south]{$K_2$}
to[L, l^=$L_{p_{sf}}$, v_>=$U_{L_{p_{sf}}} I_{L_{p_{sf}}}$, *-*] (6,0) node[anchor=south]{$K_3$}
to[short] (8.5,0)
(9.5,0) node[transformer core] (T) {} (T.B1) node[anchor=south]{$K_5$}
to[R, l^=$R_{s}$, v_>=$U_{R_{s}} I_{R_{s}}$, *-*] (12.5,0) node[anchor=south]{$K_6$}
to[L, l^=$L_{s_{sf}}$, v_>=$U_{L_{s_{sf}}} I_{L_{s_{sf}}}$, *-*] (15,0) node[anchor=south]{$K_7$}
to [short,-o] (15.5,0)
(6,0) to[R, l^=$R_{p}$, v_>=$U_{R_{p}} I_{R_{p}}$, *-*] (6,0|-T.A2) 
(6,0|-T.A2) to [short] (7.5,0|-T.A2)
(7.5,0) to [L, l^=$L_{p}$, v_>=$U_{L_{p}} I_{L_{p}}$] (7.5,0|-T.A2)
(7.5,0|-T.A2) -- (T.A2)
(0,0|-T.A2) to [short, o-*] (6,0|-T.A2)
(T.B2) to [short, -o] (15.5,0|-T.B2);
\draw[dashed] ($(T.south west)+(.2,.2)$) rectangle ($(T.north east)+(-.2,-.2)$)

;\end{circuitikz}
\caption{Transformer model}
\end{figure}

here is the Output of my code enter image description here

2
  • 2
    A warm welcome to TeX.SE! Please share your code, indent it 4 spaces so it will show as code. That will allow others to help you better.
    – A Feldman
    Apr 14 '16 at 14:29
  • 1
    Welcome to SE. The circuitikz is based on tikz package, meaning, you can use in it all its packages, shapes,commands etc. If you will show, what you try so far, we will can help you much easier. Other wise, your question is "do-it-for-me" ...
    – Zarko
    Apr 14 '16 at 14:31
8

Here are a few of the more difficult features.

\documentclass[border=2pt]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{calc}
\begin{document}
\begin{circuitikz}[european]
\draw (0,0) node[above] {$\textrm{K}_1$}
  to[R,l=$R_p$,v=\mbox{$U_{R_p},L_{R_p}$},*-*] (2,0);% \mbox hides the comma from the parser
% Transformer
\node (T) [transformer] at (1,-1) {};
\draw[dashed] ($(T.south west)+(.2,.2)$) rectangle ($(T.north east)+(-.2,-.2)$);
% Loop current.
\node (loop1) at (3,0) {$\textrm{M}_1 +$};
\draw[->] (loop1.west) arc[start angle=180, end angle=-90, radius=.5];
% It is possible to calculate the radius precisely using \pdfextractx
\end{circuitikz}
\end{document}

demo

3

After many number of Trials, i was finally able to finish the code. Thanks a lot John Kormylo for the suggesstions. They really helped me a lot. Here is the code and Output after all the changes. Some one may find it useful later on.

\documentclass{article}
\usepackage{graphicx}
\usepackage{circuitikz}
\usetikzlibrary{calc}
\begin{document}
\begin{figure}[htbp]
\label{fig:tfmodel}
\begin{flushleft}
\hspace*{-1.5cm}
\begin{circuitikz}[european]
\draw (0,0)
to[short,o-*] (1,0) node[anchor=south]{$K_1$}
to[R, l^=\rmfamily\tiny$R_{p}$, *-*] (3.1,0) node[anchor=south]{$K_2$}
to[L, l^=\rmfamily\tiny$L_{p_{sf}}$, *-] (5,0)
to [short] (6,0) node[anchor=south]{$K_3$}
to[short] (8.5,0)
(9.5,0) node[transformer core] (T) {} (T.B1) node[anchor=south]{$K_5$}
to[R, l^=\rmfamily\tiny$R_{s}$,*-*] (12.5,0) node[anchor=south]{$K_6$}
to[L, l^=\rmfamily\tiny$L_{s_{sf}}$, *-*] (15,0) node[anchor=south]{$K_7$}
to [short,-o] (15.5,0)
(6,0) to[R, *-*] (6,0|-T.A2) node[below]{$K_4$} 
(6,0|-T.A2) to [short] (7.5,0|-T.A2)
(7.5,0) to [L] (7.5,0|-T.A2)
(7.5,0|-T.A2) -- (T.A2)
(0,0|-T.A2) to [short, o-*] (6,0|-T.A2)
(T.B2) to [short, -o] (15.5,0|-T.B2);

\node (loop1) at (3.5,-1.3) {\rmfamily\tiny $M_{1} +$};

\draw[->,blue] (loop1.west) arc[start angle=180, end angle=-90, radius=.35];

\node (loop4) at (12.5,-1.3) {\rmfamily\tiny $M_{4} +$};

\draw[->,blue] (loop4.west) arc[start angle=180, end angle=-90, radius=.35];

\node (loop2) at (6.75,-1.6) {\rmfamily\tiny $M_{2} +$};

\draw[->,blue] (loop2.west) arc[start angle=180, end angle=-90, radius=.35];

\node (loop3) at (8.0,-0.4) {\rmfamily\tiny $M_{3} +$};

\draw[->,blue] (loop3.west) arc[start angle=180, end angle=-90, radius=.35];

\draw[-latex,blue] ($(T.south west)+(.35,1.6)$) -- ($(T.south west)+(.35,.45)$);
\node(y1) at (8.6,-0.6){\rmfamily\tiny$N_{p}$};
\node(y2) at (8.6,-0.9){\rmfamily\tiny$U_{p}$};
\node(y3) at (8.6,-1.2){\rmfamily\tiny$I_{p}$};

\draw[-latex,blue] ($(T.north east)+(-.35,-.5)$) -- ($(T.north east)+(-.35,-1.6)$);
\node(y1) at (10.4,-0.6){\rmfamily\tiny$N_{s}$};
\node(y2) at (10.4,-0.9){\rmfamily\tiny$U_{s}$};
\node(y3) at (10.4,-1.2){\rmfamily\tiny$I_{s}$};

\draw[-latex,blue] (1.5,-0.35) -- (2.6,-.35) node[below,midway]   {\rmfamily\tiny\color{black} {$U_{R_{p},} I_{R_{p}}$}};

\draw[-latex,blue] (3.5,-0.35) -- (4.6,-.35) node[below,midway] {\rmfamily\tiny\color{black} {$U_{L_{p_{sf}},} I_{L_{p_{sf}}}$}};

\draw[-latex,blue] (5.7,-0.5) -- (5.7,-1.6) node[left,pos=0.5] {\rmfamily\tiny\color{black} {$U_{R_{ml}} $}};

\node(y1) at (5.25,-1.3){\rmfamily\tiny$I_{R_{ml}}$};
\node(y1) at (5.7,-0.3){\rmfamily\tiny$R_{ml}$};

\draw[-latex,blue] (7.2,-0.5) -- (7.2,-1.6) node[left,pos=0.1] {\rmfamily\tiny\color{black} {$U_{L_{p}} $}};

\node(y1) at (6.9,-0.9){\rmfamily\tiny$I_{L_{p}}$};
\node(y1) at (7.3,-0.3){\rmfamily\tiny$L_{p}$};

\draw[-latex,blue] (11,-0.35) -- (12.1,-.35) node[below,midway] {\rmfamily\tiny\color{black} {$U_{R_{s},} I_{R_{s}}$}};

\draw[-latex,blue] (13.2,-0.35) -- (14.3,-.35) node[below,midway] {\rmfamily\tiny\color{black} {$U_{L_{s_{sf}},} I_{L_{s_{sf}}}$}};

\draw[-latex,blue] (-0.75,0) -- (-0.1,0) node[above,midway] {\rmfamily\tiny\color{black} {$I_{in}$}};

\draw[-latex,blue] (-0.1,0|-T.A2) -- (-0.75,0|-T.A2) node[below,midway] {\rmfamily\tiny\color{black} {$I_{in}$}};

\draw[-latex,blue] (0,-0.15) -- (0,-2) node[left,midway] {\rmfamily\tiny\color{black} {$U_{in}$}};

\draw[-latex,blue] (15.6,0) -- (16.25,0) node[above,midway] {\rmfamily\tiny\color{black} {$I_{out}$}};

\draw[-latex,blue] (16.25,0|-T.B2) -- (15.6,0|-T.B2) node[below,midway] {\rmfamily\tiny\color{black} {$I_{out}$}};

\draw[-latex,blue] (15.5,-0.15) -- (15.5,-2) node[left,midway] {\rmfamily\tiny\color{black} {$U_{out}$}};

\draw[dashed,blue] ($(T.south west)+(-.1,-.5)$) rectangle ($(T.north east)+(.1,-.2)$);

\node at ($(T.south west)+(1.05,-.5)$) [above,blue] {\rmfamily\tiny\textit{Ideal Transformer} };

\node(g) at (9.5,-1.8){\rmfamily$\gamma$}
;\end{circuitikz}
\end{flushleft}
\caption{Transformer model}
\end{figure}
\end{document}

enter image description here Thanks a lot guys for your help and suggestions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.