**********************************************************************
* GENERIC: 12AT7 / ECC81
* MODEL:   NH12AT7
* NOTES:   No heater model
**********************************************************************
.SUBCKT NH12AT7 A G K
XV1 A G K TRIODENH
+PARAMS: LIP= 1 LIF= 0.0037 RAF= 0.09869 RAS= 1 CDO=-0.5 
+ RAP= 0.1 ERP= 1.4 
+ MU0= 45.093 MUR= 0.012937 EMC= 0.00000863 
+ GCO=-0.5 GCF= 0.00012 
+ CGA=1.60E-12 CGK=2.30E-12 CAK=4.00E-13
.ENDS


.SUBCKT TRIODENH A G K
+PARAMS: LIP=1 LIF=3.7E-3 RAF=18E-3 RAS=1 CDO=0 RAP=4E-3
+ ERP=1.5
+ MU0=17.3 MUR=19E-3 EMC=9.6E-6 GCO=0 GCF=213E-6
+ CGA=3.9p CGK=2.4p CAK=0.7p 

************************************************************************
*
* Anode/grid model
*
* Models reduction in mu at large negative grid voltages
* Models change in Ra with negative grid voltages
* Models limit in Ia with high +Vg and low Va
*
* PARAMETERS
*
*	LIP Conduction limit exponent
*	LIF Conduction limit factor
*	CDO Conduction offset
*	RAF Anode resistance factor for neg grid voltages
*	RAP Anode resistance factor for positive grid voltages
*	ERP Emission power
*	MU0 Mu between grid and anode at Vg=0
*	MUR Mu reduction factor for large negative grid voltages
*	EMC Emission coefficient
*	GCO Grid current offset in volts
*	GCF Grid current scale factor
*
************************************************************************

Elim  LI 0  VALUE {PWR(LIMIT(V(A,K),0,1E6),{LIP})*{LIF}}
Egg   GG 0  VALUE {V(G,K)-{CDO}}
Erpf  RP 0  VALUE {1-PWR(LIMIT(-V(GG)*{RAF},0,0.999),{RAS})+LIMIT(V(GG),0,1E6)*{RAP}}
Egr   GR 0  VALUE {LIMIT(V(GG),0,1E6)+LIMIT((V(GG))*(1+V(GG)*{MUR}),0,-1E6)}
Eem   EM 0  VALUE {LIMIT(V(A,K)+V(GR)*{MU0},0,1E6)}
Eep   EP 0  VALUE {PWR(V(EM),ERP)*{EMC}*V(RP)}
Eel   EL 0  VALUE {LIMIT(V(EP),0,V(LI))}
Eld   LD 0  VALUE {LIMIT(V(EP)-V(LI),0,1E6)}
Ga    A  K  VALUE {V(EL)}

************************************************************************
*
* Grid current model
*
* Models grid current, along with rise in grid current at low Va
*
************************************************************************
Egf   GF 0  VALUE {PWR(LIMIT(V(G,K)-{GCO},0,1E6),1.5)*{GCF}}
Gg    G  K  VALUE {(V(GF)+V(LD))}
*
* Capacitances and anti-float resistors
*
CM1	G	K	{CGK}
CM2	A	G	{CGA}
CM3	A	K	{CAK}
RF1	A	0	1000MEG
RF2	G	0	1000MEG
RF3	K	0	1000MEG

.ENDS
