7

This time I dive into Circuitikz. Anyway, I've got a problem with the american and european styles of e.g. voltages.

IIRC Voltage drops are counted positive which means the voltage arrow in the pictures goes from + to -, where the current flows.

\documentclass{article}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\begin{document}
\begin{circuitikz}%[american]
  \draw
  (0,0) node[ground] {}
  to [V,v=$U_0$] (0,3) {}
  to [cspst=$t_0$] (2,3) {}
  to [L=$L$,v=$u_L$] (3,3) {}
  to [R=$R$,v=$u_R$] (6,3) {}
  to [C,l_=$C$,v^=$u_C$,i=$i$] (6,0) {}
  to [ground] (6,0) {};
\end{circuitikz}
\end{document}

enter image description here

enter image description here

Please use with/without american option. Please note the signs in american and the arrows in european style which are opposite. As the result the equations would be different using the common laws.

Is it a bug, intentionally or I'm wrong?

Further more, this example shows some other problems: At european style the inductor's arrow is not shown/hidden. At american the inductor's signs are cluttered also.

And, probably a TikZ problem, how to get the 2nd ground symbol?

PS: What's the preferred way to append pictures/pdf here - where to store?

3
  • It might indeed be a standard conflict. You should check the sign conventions. But you can change the voltage sign with > character as in v>=$u_L$. For the second ground symbol replace to [ground] (6,0) {}; with to (6,0) node[ground] {};.
    – percusse
    Dec 5, 2011 at 14:04
  • IMO this is basically a problem on writing multi language documents - the convention of counting voltages! Due this this problem here, I can't simply hop between american and e.g. german language/style. I do have to adjust the arrows in all the pictures! Therefore the title may doesn't fit up to 100% the problem here.
    – oltx
    Dec 9, 2011 at 6:33
  • I know this is a very old question, but you can check if the new options for voltages on circuitikz.github.io/circuitikz helps. Unfortunately, it seems that the convention on how to draw the "voltage arrow" changes with location; you can see github.com/circuitikz/circuitikz/issues/101 for a full discussion.
    – Rmano
    Apr 27, 2019 at 21:06

1 Answer 1

3

I don't know whether or not you want to hold on to circuitikz or are willing to use the circuits library of TikZ as well. I prefer the latter. This would be the code and resulting image using that instead. Note that the direction info option is added to show the arrows.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}
\begin{document}
\begin{tikzpicture}[circuit ee IEC,semithick,
                    every info/.style={font=\footnotesize},
                    small circuit symbols,
                    set resistor graphic=var resistor IEC graphic]
  \draw (0,0) to [ground={near start, rotate=180}] (0,1)
              to [voltage source={near start, direction info={info=$U_0$}}] (0,3)
              to [break contact={info=$t_0$}] (2,3)
              to [inductor={direction info={info=$L$},info'=$u_L$}] (3,3)
              to [resistor={direction info={info=$R$}, info'=$u_R$}] (6,3)
              to [capacitor={direction info={info'=$C$}, info=$u_C$}] (6,1)
              to [ground={near end}] (6,0);
\end{tikzpicture}
\end{document}

TikZ circuit using circuits library

You can change the direction in the direction info by simply adding a <-.

0

You must log in to answer this question.

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