* SPICE netlist
XU1 N011 N005 V+ V- N006 TL071 ;pnba In+)In-)V+)V-)OUT
V1 V+ 0 12V
V2 0 V- 12V
R2 N006 N005 47k
R3 OUT N006 680
XU2 0 N003 V+ V- N004 TL071 ;pnba In+)In-)V+)V-)OUT
R6 N006 0 100k
J1 N005 N002 0 2SK170
R1 N005 N004 1k
R4 N004 N003 22k
R5 N003 N009 1000k
Vin N009 0 5
R9 N011 0 47k
R11 N011 N004 1k
J2 N011 0 0 2SK170
XU3 0 N007 V+ V- N008 TL071 ;pnba In+)In-)V+)V-)OUT
D1 N008 N007 1N914
Q1 N002 N008 N001 0 2N3906
R7 N001 N007 10k
R8 N001 0 1k
R10 N007 N010 100k
Vcv N010 0 0
R12 N002 0 100k
.include TL071.mod
;op
.include 2SK170.mod
.dc Vcv -1 5 .01 Vin -5 5 0.5

* LTspice schematic (.asc)
Version 4
SHEET 1 2384 784
WIRE -968 -392 -1064 -392
WIRE -872 -392 -968 -392
WIRE -648 -392 -776 -392
WIRE -568 -392 -648 -392
WIRE -1064 -376 -1064 -392
WIRE -968 -376 -968 -392
WIRE 56 -296 24 -296
WIRE 168 -296 136 -296
WIRE 680 -296 632 -296
WIRE 808 -296 760 -296
WIRE -1064 -264 -1064 -296
WIRE -968 -264 -968 -296
WIRE -920 -264 -968 -264
WIRE -824 -264 -824 -328
WIRE -824 -264 -856 -264
WIRE -648 -264 -648 -392
WIRE -104 -232 -344 -232
WIRE 24 -232 24 -296
WIRE 24 -232 -24 -232
WIRE 24 -168 24 -232
WIRE 56 -168 24 -168
WIRE -1096 -152 -1192 -152
WIRE -968 -152 -968 -264
WIRE -968 -152 -1016 -152
WIRE -920 -152 -968 -152
WIRE 168 -152 168 -296
WIRE 168 -152 120 -152
WIRE 392 -152 168 -152
WIRE 424 -152 392 -152
WIRE 520 -152 504 -152
WIRE 632 -152 632 -296
WIRE 632 -152 520 -152
WIRE 680 -152 632 -152
WIRE 1192 -152 1144 -152
WIRE -1192 -136 -1192 -152
WIRE -824 -136 -824 -264
WIRE -824 -136 -856 -136
WIRE 56 -136 24 -136
WIRE 808 -136 808 -296
WIRE 808 -136 744 -136
WIRE 952 -136 808 -136
WIRE 1032 -136 952 -136
WIRE 1144 -136 1144 -152
WIRE 1144 -136 1112 -136
WIRE -920 -120 -968 -120
WIRE -344 -120 -344 -232
WIRE 632 -120 584 -120
WIRE 680 -120 632 -120
WIRE 952 -104 952 -136
WIRE 632 -88 632 -120
WIRE 392 -72 392 -152
WIRE 424 -72 392 -72
WIRE 584 -72 584 -120
WIRE 584 -72 504 -72
WIRE -968 -56 -968 -120
WIRE -648 -56 -648 -184
WIRE -1192 -24 -1192 -56
WIRE -344 24 -344 -40
WIRE -56 24 -344 24
WIRE 24 24 24 -136
WIRE 24 24 -56 24
WIRE 632 24 632 -8
WIRE 632 24 24 24
WIRE 952 24 952 -24
WIRE 952 24 632 24
WIRE 1176 24 952 24
WIRE -568 104 -568 -392
WIRE 392 104 -568 104
WIRE 584 136 584 -72
WIRE 696 136 584 136
WIRE 520 184 520 -152
WIRE 696 184 696 136
WIRE 392 248 392 104
WIRE 472 248 392 248
WIRE 488 248 472 248
WIRE 648 248 632 248
WIRE -472 264 -472 200
WIRE -312 264 -312 200
WIRE -56 264 -56 24
WIRE 632 296 632 248
WIRE 696 296 696 280
WIRE 696 296 632 296
WIRE 520 360 520 280
WIRE 696 360 696 296
WIRE 696 360 520 360
WIRE 520 376 520 360
WIRE -472 392 -472 344
WIRE -312 392 -312 344
FLAG -56 264 0
FLAG 1192 -152 OUT
IOPIN 800 208 Out
FLAG 520 376 0
FLAG -472 392 0
FLAG -312 392 0
FLAG -472 200 V+
FLAG 88 -184 V+
FLAG 712 -168 V+
FLAG -312 200 V-
FLAG 88 -120 V-
FLAG 712 -104 V-
FLAG -888 -168 V+
FLAG -888 -104 V-
FLAG -968 -56 0
FLAG -1064 -264 0
FLAG -1192 -24 0
FLAG -648 -56 0
DATAFLAG 752 208 ""
SYMBOL Opamps\\opamp2 712 -200 R0
SYMATTR InstName U1
SYMATTR Value TL071
SYMBOL voltage -472 248 R0
SYMATTR InstName V1
SYMATTR Value 12V
SYMBOL voltage -312 360 R180
SYMATTR InstName V2
SYMATTR Value 12V
SYMBOL res 776 -312 R90
SYMATTR InstName R2
SYMATTR Value 47k
SYMBOL res 1128 -152 R90
SYMATTR InstName R3
SYMATTR Value 680
SYMBOL Opamps\\opamp2 88 -216 R0
SYMATTR InstName U2
SYMATTR Value TL071
SYMBOL res 936 -120 R0
SYMATTR InstName R6
SYMATTR Value 100k
SYMBOL njf 472 184 R0
SYMATTR InstName J1
SYMATTR Value 2SK170
SYMBOL res 520 -168 R90
SYMATTR InstName R1
SYMATTR Value 1k
SYMBOL res 152 -312 R90
SYMATTR InstName R4
SYMATTR Value 22k
SYMBOL res -8 -248 R90
SYMATTR InstName R5
SYMATTR Value 1000k
SYMBOL voltage -344 -136 R0
SYMATTR InstName Vin
SYMATTR Value 5
SYMBOL res 616 -104 R0
SYMATTR InstName R9
SYMATTR Value 47k
SYMBOL res 520 -88 R90
SYMATTR InstName R11
SYMATTR Value 1k
SYMBOL njf 648 184 R0
SYMATTR InstName J2
SYMATTR Value 2SK170
SYMBOL Opamps\\opamp2 -888 -200 R0
SYMATTR InstName U3
SYMATTR Value TL071
SYMBOL diode -856 -280 R90
SYMATTR InstName D1
SYMATTR Value 1N914
SYMBOL pnp -776 -328 M270
SYMATTR InstName Q1
SYMATTR Value 2N3906
SYMBOL res -984 -392 R0
SYMATTR InstName R7
SYMATTR Value 10k
SYMBOL res -1080 -392 R0
SYMATTR InstName R8
SYMATTR Value 1k
SYMBOL res -1000 -168 R90
SYMATTR InstName R10
SYMATTR Value 100k
SYMBOL voltage -1192 -152 R0
SYMATTR InstName Vcv
SYMATTR Value 0
SYMBOL res -664 -280 R0
SYMATTR InstName R12
SYMATTR Value 100k