def fit_curve(): global data fa = eyemath.fit_exp(data[0], data[1]) if fa != None: pa = fa[1] rc = abs(1.0 / pa[1]) g.line(data[0],fa[0],1) dispmsg(_('RC = %5.2f mSec')%rc) else: dispmsg(_('Failed to fit the curve with V=Vo*exp(-t/RC)'))
def fit_curve(): global data, running if running == True or len(data[0])==0: return f = eyemath.fit_exp(data[0], data[1]) if f != None: g.line(data[0], f[0], 1) k = 1.38e-23 # Boltzmann const q = 1.6e-19 # unit charge Io = f[1][0] a1 = f[1][1] T = 300.0 # Room temp in Kelvin n = q/(a1*k*T) s = _('Fitted with Diode Equation : Io = %5.2e mA , Ideality factor = %5.2f')%(Io,n) msg.config(text = s)
def fit_curve(): global data, running if running == True or len(data[0]) == 0: return f = eyemath.fit_exp(data[0], data[1]) if f != None: g.line(data[0], f[0], 1) k = 1.38e-23 # Boltzmann const q = 1.6e-19 # unit charge Io = f[1][0] a1 = f[1][1] T = 300.0 # Room temp in Kelvin n = q / (a1 * k * T) s = _( 'Fitted with Diode Equation : Io = %5.2e mA , Ideality factor = %5.2f' ) % (Io, n) msg.config(text=s)
def fit_curve(): global data p.write_outputs(2) # Do some DC work to find the resistance of the Inductor time.sleep(.5) Rext = float(Res.get()) vtotal = 5.0 # Assume OD1 = 5 volts v = p.get_voltage(2) if v > 4.8: # Means user has connected OD1 to A2 vtotal = v Vind = p.get_voltage(0) # voltage across the Inductor i = (vtotal - Vind)/Rext Rind = Vind/i print v,Rind fa = eyemath.fit_exp(data[0], data[1]) if fa != None: pa = fa[1] print pa par1 = abs(1.0 / pa[1]) g.line(data[0],fa[0],1) dispmsg(_('L/R = %5.3f mSec : Rind = %5.0f Ohm : L = %5.1f mH')%(par1, Rind, (Rext+Rind)*par1)) else: dispmsg(_('Failed to Fit. Try fitting V=Vo*exp(-tR/L) with Xmgrace'))
def fit_curve(): global data p.set_state(10,1) # Do some DC work to find the resistance of the Inductor time.sleep(.5) Rext = float(Res.get()) vtotal = 5.0 # Assume OD1 = 5 volts v = p.get_voltage(3) if v > 4.8: # Means user has connected OD1 to A2 vtotal = v Vind = p.get_voltage(1) # voltage across the Inductor i = (vtotal - Vind)/Rext Rind = Vind/i # print v,Rind fa = eyemath.fit_exp(data[0], data[1]) if fa != None: pa = fa[1] # print pa par1 = abs(1.0 / pa[1]) g.line(data[0],fa[0],1) dispmsg(_('L/R = %5.3f mSec : Rind = %5.0f Ohm : L = %5.1f mH')%(par1, Rind, (Rext+Rind)*par1)) else: dispmsg(_('Failed to Fit. Try fitting V=Vo*exp(-tR/L) with Xmgrace'))