PyAMS  (the software under revision)

Exponential Current


Rising and falling exponential Current source

Parameters

NameDefaultDescription
IMax5.0Upper bound for rising edge
RiseTime0.5Rise time [s]
RiseTimeConst0.1Rise time constant [s]
FallTimeConstriseTimeConstFall time constant [s]
Offset0Current offset [A]
startTime0Time offset [s]

PyAMS definition

from PyAMS import RealTime,Signal
from math import exp,pi

#Generate exponentially Current
class SourceVExponential:
     def __init__(self, a, b):
         self.Ie = Signal('out','current',a,b)
         self.IMax=5.0            #Upper bound for rising edge
         self.RiseTime=0.5        #Rise time    
         self.RiseTimeCons=0.1    #Rise time constant 
         self.FallTimeConst=0.1   #Fall time constant 
         self.Offset=0.0
         self.StartTime=0.0
     def analog(self):
         time=RealTime()
         self.Ie+=self.Offset
         y_riseTime = self.IMax*(1-exp(-self.RiseTime/self.RiseTimeCons)); 
         if (time > (self.StartTime+self.RiseTime)):
            self.Ie+=self.IMax*(1-exp(-(time -self.StartTime)/self.RiseTimeCons))
         else:
            self.Ie+=y_riseTime*exp(-(time -self.StartTime - RiseTime)/self.FallTimeConst); 
 
    
         

Documentation generated by PyAMS