3
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{circuitikz}
\usetikzlibrary{shapes.geometric, arrows}

 \begin{document}

 \begin{tikzpicture}
        \draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
        -- ++(0,1) node[op amp, anchor=+](A){}
        (a) to[R=$R_A$, *-] (a-|A.out) -- (A.out);
    \end{tikzpicture}
\end{document}

I try to make this but I have problems sorry for my English can anyone help

131

Bernard
  • 271,350
Amir
  • 31
  • welcome to the site -- have a look at the answer below -- a circuit in a box that can be repeatedly used as well as independently – js bibra Apr 14 '21 at 14:03
  • 1
    https://tex.stackexchange.com/a/592878/38080 ? – Rmano Apr 14 '21 at 15:54
  • It may help you: https://tex.stackexchange.com/questions/379911/how-to-draw-an-electric-circuit-with-the-help-of-circuitikz/379915#379915 – Zarko Apr 15 '21 at 07:46
  • @Amir would you like to accept and upvote the answer below if it met the requirement – js bibra May 03 '21 at 13:41

1 Answers1

2

Source--https://tex.stackexchange.com/a/592731/38080

Circuit in a box

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}

\newsavebox{\mycirc} \sbox{\mycirc}{% no stray spaces \begin{tikzpicture} \draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a) -- ++(0,1) nodeop amp, anchor=-, yscale=-1{} (a) to[R=$R_A$, *-] (a-|A.out) -- (A.out); \draw(A.out)to[short, -o,]++(1,0)node[above]{$V_{out}$}; \draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$}; \end{tikzpicture}% no stray spaces }

\begin{document}

\begin{tikzpicture}[]
    \node [draw, text width=3cm, align=center]{% no stray spaces
        \adjustbox{width=3cm, height=3cm, keepaspectratio}{\usebox{\mycirc}}%
    };
\end{tikzpicture}

\end{document}

Independent use

    \documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}

\begin{document}

\begin{tikzpicture} \draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a) -- ++(0,1) nodeop amp, anchor=-, yscale=-1{} (a) to[R=$R_A$, *-] (a-|A.out) -- (A.out); \draw(A.out)to[short, -o,]++(1,0)node[above]{$V_{out}$}; \draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$}; \end{tikzpicture} \end{document}

enter image description here

EDIT for Bill Nace query

  \documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
    \draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
    -- ++(0,1) node[op amp, anchor=-, yscale=-1](A){}
    (a) to[R=$R_A$, *-] (a-|A.out)coordinate[label={}](b) ;
    \draw(A.out)coordinate[ label=](c)to[short, -o,]++(1,0)node[above]{$V_{out}$}; 
    \draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$};
    \draw[<-, red, in=180, out=-45](b) to ++(2,-2)node[right](){\scriptsize (a) {\texttt {-|}}  (A.out)};
    \draw[circle,fill= green](c)circle(1pt);
    \draw[circle,fill= red](b)circle(1pt);
    \draw [<-, green, in=180, out=-45](c) to ++(2,-2)node[right](){\scriptsize (A.out)};
\end{tikzpicture}

\end{document}

enter image description here

js bibra
  • 21,280
  • 7
    Please cite the source when reusing code --- in this case mine https://tex.stackexchange.com/a/592731/38080 but in general (it's required by the site license). Thanks! – Rmano Apr 14 '21 at 15:52
  • 2
    done -oversight on my part – js bibra Apr 15 '21 at 00:02
  • Why must you draw from (a) to the intersection location and then up to (A.out)? Why doesn't the -| notation work as in (a) to[R=$R_A#, *-] -| (A.out) ? – Bill Nace Apr 15 '21 at 02:51
  • @BillNace so it works like this -- draw an imaginary horizontal line right from coordinate a and also draw an imaginary line downwards from A.out -- the intersection of these lines provides the end point of the circuit from R_A -- to complete the circuit you still need to draw a physical wire from the intersection of the 2 imaginary lines up to connect to A.out – js bibra Apr 15 '21 at 04:36
  • @BillNace have a look at the edit above – js bibra Apr 15 '21 at 05:08
  • @BillNace because the syntax is (coord) to[] (coord) to draw an element. What you say it's not correct because |- is already a path element; it would be like saying (coord) to[element] to[vertical and horizontal wire] (coord) so Tikz does not know the intermediate point. – Rmano Apr 15 '21 at 05:18
  • Thank you all, that's very helpful and illuminating. – Bill Nace Apr 16 '21 at 12:13