I've tried a couple of behavior cases that don't seem to run. I hope I haven't abused the capability. I'm simply seeing if a mos divider circuit will work. I have two devices and behavioral nmos and pmos with the gate, drain of both the pmos and nmos tied together. I have tried three different cases. Let me know what you think. #!/usr/bin/python from eispice import * # -- PyB Defined Model -- class pmos_sat(dev.PyB): def __init__(self, p, n, g, s, b, kp=2e-6,wp=2,lp=1,power=2.0): dev.PyB.__init__(self, p, n, Current, v(g), v(s), v(b)) self.kp = kp self.wp = wp self.lp = lp self.vtp= 0.7 self.betap = kp*wp/lp self.power=power def model(self, Vg, Vs): if ((Vs - Vg)> self.vtp): return 0.5*self.betap*(Vs - Vg - self.vtp)**self.power else : return 0 class nmos_sat(dev.PyB): def __init__(self, p, n, g, s, b, kn=5e-6,wn=2,ln=1,power=2.0): dev.PyB.__init__(self, p, n, Current, v(g), v(s), v(b)) self.kn = kn self.wn = wn self.ln = ln self.vtn= 0.7 self.betan = kn*wn/ln self.power=power def model(self, Vg, Vs): if ((Vg - Vs)> self.vtp): return 0.5*self.betan*(Vg - Vs - self.vtn)**self.power else : return 0 # Now to use the model kp = 2e-6 wp = 2 lp = 1 vtp= 0.7 betap = kp*wp/lp power=2 kn = 5e-6 wn = 2 ln = 1 vtn= 0.7 betan = kn*wn/ln d = Deck('PyB Defined Behavioral MOS divider') d.V0 = dev.V(1, GND, 3.3) #d.pmosx = pmos_sat(4, GND, 4, 1, 1) #d.pmosx = dev.B('4', GND, 'i',"0.5*betap*(v(1,4)-vtp)^2") d.pmosx = dev.B('4', GND, 'i',"0.5*2e-6*(v(1,4)-0.7)^2") #d.nmosx = nmos_sat(4, GND, 4, GND, GND) #d.nmosx = dev.B(4, GND, 'i',"0.5*betan*(v(4,GND)-vtn)^2") d.nmosx = dev.B(4, GND, 'i',"0.5*5e-6*(v(4,GND)-0.7)^2") d.rout = dev.R(4,GND, 100000) d.op() d.plot() _________________________________________________________________ Get live scores and news about your team: Add the Live.com Football Page www.live.com/?addtemplate=football&icid=T001MSN30A0701 ------------------------------------------------------------------ To unsubscribe from the eispice list send an email to: eispice-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field