2

does someone know how can I modify this code which offers as a result:

enter image description here

\begin{tikzpicture}
%--------start graphics code --------
\draw[step=0.5,very thin,black!20] (-1,-0.5);
\path (0,0) coordinate (ref_gnd);
\draw
  (ref_gnd) to[american voltage source=\(V\),invert] ++(0,2)
            to[R=\(R_1\)] ++(3,0) 
            to[L=\(L_1\)] ++(3,0) 
            to[american voltage source=\(V\)] ++(0,-2) 
  -- (ref_gnd);
%--------end graphics code ----------
\end{tikzpicture}

To create this: enter image description here

Thank you so much

3

A rude but working solution:

Edit: now added with voltage source symbol as shown in image in the question:

Edit (2): removed is not used code fragments and further simplified code with use mirror option for inductance.

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{circuitikz}[american, cute inductors, node distance=0mm]
%--------start graphics code --------
\coordinate (ref_gnd);
\draw
  (ref_gnd) to[esource, l=\(e(t)\),name=VS1] ++(0,2)
            to[R=\(R_1\)] ++(3,0) 
            to[L=\(L_1\), mirror] ++(3,0)
            to[esource, l=\(e(t)\),name=VS2] ++(0,-2)
            to[short,f_=\(i(t)\), current arrow scale=16] (ref_gnd);
\node[above left=of VS1.e] {+}; % "e": east
\node[above right=of VS2.w] {+};% "w"; west
%--------end graphics code ----------
\end{circuitikz}
\end{document}

enter image description here

2
  • Thank you so much for all. It's perfect Nov 22 '20 at 7:16
  • @AlejandroFernándezSuárez, you are welcome! See edited answer, now the code is more simple.
    – Zarko
    Nov 22 '20 at 7:55
2

enter image description here

from page 53 of the manual -- you need to change the following line in your code

(ref_gnd) to[american voltage source=\(V\),invert] ++(0,2)

to

(ref_gnd) to[esource, l=$v(t)$] ++(0,2)

this will give a blank voltage source

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.