PAK204-Cct-PP-CE-wingspread LTspice .asc code

Version 4
SHEET 1 3716 2156
WIRE -208 -240 -2048 -240
WIRE -1136 -80 -1264 -80
WIRE -1008 -80 -1072 -80
WIRE -864 -80 -928 -80
WIRE -1264 -64 -1264 -80
WIRE -1264 16 -1344 16
WIRE -864 16 -864 -80
WIRE -848 16 -864 16
WIRE -752 16 -768 16
WIRE -1536 64 -1568 64
WIRE -1264 112 -1264 96
WIRE -1136 112 -1264 112
WIRE -1008 112 -1072 112
WIRE -864 112 -864 16
WIRE -864 112 -928 112
WIRE -2064 176 -2064 -224
WIRE -192 192 -2048 192
WIRE -2064 688 -2064 208
WIRE -208 704 -2048 704
WIRE -832 752 -848 752
WIRE -2064 864 -2064 720
WIRE -208 880 -2048 880
FLAG -1920 368 0
FLAG -1920 288 0
FLAG -2064 720 0
FLAG -1872 320 0
FLAG -1872 400 0
FLAG -2016 224 0
FLAG -2016 304 0
FLAG -848 832 0
FLAG -832 752 Vp
IOPIN -832 752 In
FLAG -2048 192 0
FLAG -192 192 0
FLAG -2048 -240 0
FLAG -208 -240 0
FLAG -2064 176 0
FLAG -2064 -224 0
FLAG -2064 208 0
FLAG -208 704 0
FLAG -2064 688 0
FLAG -1968 336 0
FLAG -1968 256 0
FLAG -1824 352 0
FLAG -1824 432 0
FLAG -1776 384 0
FLAG -1776 464 0
FLAG -208 880 0
FLAG -2048 704 0
FLAG -1568 144 0
FLAG -752 16 0
FLAG -1344 16 in
IOPIN -1344 16 In
FLAG -1536 64 in
IOPIN -1536 64 Out
FLAG -2064 864 0
FLAG -1728 416 0
FLAG -1728 496 0
FLAG -1680 448 0
FLAG -1680 528 0
FLAG -1968 576 0
FLAG -1968 656 0
FLAG -2048 880 0
FLAG -1920 608 0
FLAG -1920 688 0
FLAG -2016 544 0
FLAG -2016 624 0
SYMBOL bi -1920 288 R0
WINDOW 3 64 -1 Left 2
SYMATTR Value I=Vt/Rs*Wex(I(B1)) ; Id1
SYMATTR InstName B3
SYMBOL bi -1872 320 R0
WINDOW 3 65 -2 Left 2
SYMATTR Value I=Vt/Rs*Wex(I(B2)) ;Id2
SYMATTR InstName B4
SYMBOL bi -2016 224 R0
WINDOW 3 59 -2 Left 2
SYMATTR Value I=(V(in)+Vb-Vk)/Vt ;PosArg
SYMATTR InstName B1
SYMBOL bv -848 736 R0
WINDOW 0 31 45 Left 2
SYMATTR InstName B1a
SYMATTR Value V=Vb
SYMBOL bi -1968 256 R0
WINDOW 3 64 -1 Left 2
SYMATTR Value I=(-V(in)+Vb-Vk)/Vt ;NegArg
SYMATTR InstName B2
SYMBOL bi -1824 352 R0
WINDOW 3 58 -2 Left 2
SYMATTR Value I=I(B3)-I(B4) ;I out
SYMATTR InstName B5
SYMBOL bi -1776 384 R0
WINDOW 3 59 -2 Left 2
SYMATTR Value I=1/Rs*We2(I(B1))/(1+We2(I(B1))) ;Gm1
SYMATTR InstName B6
SYMBOL voltage -1568 48 R0
WINDOW 3 27 94 Left 2
WINDOW 123 -58 -191 Left 2
WINDOW 39 0 0 Left 2
WINDOW 0 32 45 Left 2
SYMATTR Value PULSE({-Vin} {Vin} 0 {2*Vin})
SYMATTR InstName Vin1
SYMBOL res -912 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName Rs2
SYMATTR Value {Rs}
SYMBOL diode -1136 -96 M90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName D1
SYMATTR Value Dnpn
SYMBOL voltage -1264 -80 R0
WINDOW 0 32 37 Left 2
WINDOW 3 29 75 Left 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value {Vb}
SYMBOL voltage -1264 0 R0
WINDOW 3 34 73 Left 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
WINDOW 0 34 35 Left 2
SYMATTR Value {Vb}
SYMATTR InstName V2
SYMBOL diode -1072 128 M270
WINDOW 0 32 32 VTop 2
WINDOW 3 0 32 VBottom 2
SYMATTR InstName D2
SYMATTR Value Dpnp
SYMBOL res -1024 -64 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName Rs1
SYMATTR Value {Rs}
SYMBOL bi -1728 416 R0
WINDOW 3 65 0 Left 2
SYMATTR Value I=1/Rs*We2(I(B2))/(1+We2(I(B2))) ;Gm2
SYMATTR InstName B7
SYMBOL bi -1680 448 R0
WINDOW 3 62 6 Left 2
WINDOW 0 22 6 Left 2
SYMATTR Value I=I(B6)+I(B7) ;Gm Total
SYMATTR InstName B8
SYMBOL res -864 0 M90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 1m
SYMBOL bi -1968 576 R0
WINDOW 3 68 32 Left 2
WINDOW 0 -16 26 Left 2
SYMATTR Value I=If(I(B9)>-27,Sgn(V(in))*Vt/Rs*W( Exp(Abs(I(B1)-I(B2))) *(We(I(B9))*(1-(We(I(B2))/We(I(B1)))**Sgn(V(in))))),I(B3)-I(B4)) ;W(x) all Vin
SYMATTR InstName B10
SYMBOL bi -1920 608 R0
WINDOW 3 36 32 Left 2
WINDOW 0 -16 26 Left 2
SYMATTR Value I=If(I(B9)>-27,Sgn(V(in))*Vt/Rs*Wex( (Abs(I(B1)-I(B2))) +Ln(We(I(B9))*(1-(We(I(B2))/We(I(B1)))**Sgn(V(in))))),I(B3)-I(B4)) ;We(x) all Vin
SYMATTR InstName B11
SYMBOL bi -2016 544 R0
WINDOW 3 76 31 Left 2
WINDOW 0 -16 33 Left 2
SYMATTR Value I=(-Abs(V(in))+Vb-Vk)/Vt ;arg12
SYMATTR InstName B9
TEXT -2040 -120 Left 2 !;dc Vin1 {-Vin} {Vin} {1m*Vin}
TEXT -2040 -24 Left 2 !.param IS = 5e-12
TEXT -2032 720 Left 2 ;User Defined Functions
TEXT -2040 -56 Left 2 !.param Vt=0.02586 ;at 27C
TEXT -2040 -88 Left 2 !.param Vin= 2
TEXT -288 -224 Right 1 ;(c) Ian Hegglun Feb 2024
TEXT -2040 -152 Left 2 !.tran 0 {2*Vin} 0 {1m*Vin}
TEXT -888 720 Left 2 ;Read param
TEXT -2040 72 Left 2 !.param Kb= -0.188 ; Default bias in Vt's
TEXT -2040 112 Left 2 !.Step param Kb List -2 -1 0 1 2 3 5 10
TEXT -2040 40 Left 2 !.param Vb=Vk+Kb*Vt  ;bias Vspread
TEXT -2040 8 Left 2 !.param Vk=Vt*Ln(Vt/(Is*Rs)) -Is*Rs
TEXT -1072 -208 Center 4 ;Push-Pull Common Emitter -- Vdrive with Rs
TEXT -2040 144 Left 2 !.param Rs = 0.22
TEXT -2040 -216 Left 2 !.options plotwinsize=0
TEXT -680 120 Left 2 !.model Dnpn  d (IS={Is} Rs=0 N=1)\n.model Dpnp  d (IS={Is} Rs=0 N=1)
TEXT -1784 -216 Left 2 !.options reltol=1e-4
TEXT -1240 568 Center 3 ;New -> Single W(e^x) solution for Id1 - Id2
TEXT -2040 752 Left 2 !.function Le(X) { If(U(X-450), X, Ln(1+Exp(X))) } ;Unlimited Ln(1+e^X)
TEXT -2040 784 Left 2 !.function We1(X) {Le(X)*(1-ln(1+Le(X))/(2+Le(X)) )}  ;Unlimited W(e^X)) 2%
TEXT -2040 816 Left 2 !.function We2(X) {If(U(X+30), We1(X -Ln(1+We1(X)+ln(We1(X)) -X)), We1(X))} ;Unlimited 0.05%
TEXT -2040 848 Left 2 !.function W1(X) {If(U(X+0.6),Ln(1+X)*(1-ln(1+Ln(1+X))/(2+Ln(1+X)) ),-1)} ;Unlimited W(x) 2%
TEXT -2040 896 Left 2 !.function We(X) {(Le(X)*(1-ln(1+1.25*Le((X-1)/1.25))/(1.15+Le(X))))} ;New We1
TEXT -2040 960 Left 2 !.function W(X) {If(U(X+0.6),Ln(1+X)*(1-ln(1+1.25*Ln(1+0.45*X**0.8))/(1.15+Ln(1+X))),-1)} ;New W(x)
TEXT -2040 928 Left 2 !.function Wex(X) {If(U(X+30),We(X-Ln(1+We(X)+ln(We(X))-X)),We1(X))} ;New We2
TEXT -2040 -184 Left 2 !.options numdgt=7 ;double precision