Discussion:
[circuitikz] Voltag drop european/american style
(too old to reply)
Paul
2011-12-02 06:51:03 UTC
Permalink
Hi,

at this time I dive into cicuitikz. Anyway, I've got a problem with the
defaults:

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

\begin{ circuitikz }
\draw (0,0) to [R=$R_1$, i =$i _1$, v=$v_1$] (2,0);
\end{ circuitikz }

shows a voltage drop (following the current direction) from + to -.
Following the convention mentioned above, the arrow should go from left
to right as the current flows. The same with voltage sources!!!

Now the american style:

\begin{ circuitikz }[american voltages]
\draw (0,0) to [V=$a_1$] (2,0);
\end{ circuitikz }

vs. the european style. The voltage direction differs also.

These finaly problem is that I can't simply change the american/european
style globaly without changing the equations (or even arrows)!

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

Thanks,
Paul
Paul
2011-12-02 07:42:33 UTC
Permalink
Here is a small (QTikZ) example:

\documentclass{article}
\usepackage{mathptmx}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usepackage{siunitx}
%\usepackage{color}
\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment[]{tikzpicture}
\PreviewEnvironment[]{pgfpicture}
\DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n}
\SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n}
\DeclareSymbolFontAlphabet{\mathcal}{symbolsb}
\begin{document}

\tikzset{help lines/.style={color=blue!50,very thin}}
\tikzset{my grid/.style={help lines,color=red!50}}

\begin{circuitikz}%[american voltages]
%\draw[help lines] (0,0) grid (6,3);
\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}

Please use ist with/without american option - the equations would be
different using the common lasws.

Further more, this example shows some other problems: For the inductor
the arrow is not shown - how to adjust the distance in general (uR, uC).

And, probably a TikZ problem, how to get the 2nd ground symbol?
Gabriel Cormier
2011-12-05 15:56:02 UTC
Permalink
Post by Paul
\documentclass{article}
\usepackage{mathptmx}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usepackage{siunitx}
%\usepackage{color}
\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment[]{tikzpicture}
\PreviewEnvironment[]{pgfpicture}
\DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n}
\SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n}
\DeclareSymbolFontAlphabet{\mathcal}{symbolsb}
\begin{document}
\tikzset{help lines/.style={color=blue!50,very thin}}
\tikzset{my grid/.style={help lines,color=red!50}}
\begin{circuitikz}%[american voltages]
  %\draw[help lines] (0,0) grid (6,3);
  \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}
Please use ist with/without american option - the equations would be
different using the common lasws.
Further more, this example shows some other problems: For the inductor
the arrow is not shown - how to adjust the distance in general (uR, uC).
And, probably a TikZ problem, how to get the 2nd ground symbol?
I don't know about the voltage drops; I just switch the direction I
draw the element. Instead of drawing from (3,3) to (6,3), I draw from
(6,3) to (3,3)...

And the ground symbol is a node, not a path operation. So your last
line would be:
to [C,l_=$C$,v^=$u_C$,i=$i$] (6,0) node[ground] {};

Gabriel

Loading...