summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/examples/ex18.m4
blob: 201e8fee622818d75bc18d014a1b7aedf1dab62b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.PS
# ex18.m4
cct_init

[
   "$v_i$" rjust; dot
   resistor(right_ dimen_) ; llabel(,R_i)
T: dot
   line right_ linewid/4
A: opamp with .In1 at Here

   line from A.In2 to (T,A.In2)
   resistor(down_ dimen_) ; rlabel(,R_g)
   ground(,T)

   line right_ dimen_ from A.Out
   diode(up_ dimen_); dot
   {line right_ linewid/2; dot; "$v_o$" ljust }
   resistor(left_ to (A.Out,Here)) ; rlabel(,R_o); dot
   { diode(down_ to A.Out); dot }
   line to (T,Here) then to T
]

[
define(`dimen_',dimen_*1.25)

B: battery(up_ dimen_*2/3); rlabel(,V^o)
   move down dimen_/4
   resistor(up_ dimen_); rlabel(,R,)
   inductor(right_ elen_); b_current(i); rlabel(,L)
   { capacitor(down_ to (Here,B.start)); rlabel(,C); llabel(+,v,-) }
   line right_ dimen_
   diode(down_ to (Here,B.start),T); b_current(h(v))
   line to B.start
] with .nw at last [].ne+(20bp__,0)

.PE