PyAMS  (the software under revision)

Exponential Voltage


Rising and falling exponential voltage source

Parameters

NameDefaultDescription
VMax5.0Upper bound for rising edge
RiseTime0.5Rise time [s]
RiseTimeConst0.1Rise time constant [s]
FallTimeConstriseTimeConstFall time constant [s]
Offset0Voltage offset [V]
startTime0Time offset [s]

PyAMS definition

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

#Generate exponentially voltage
class SourceVExponential:
     def __init__(self, a, b):
         self.Ve = Signal('out','voltage',a,b)
         self.VMax=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.Ve+=self.Offset
         y_riseTime = self.VMax*(1-exp(-self.RiseTime/self.RiseTimeCons)); 
         if (time > (self.StartTime+self.RiseTime)):
            self.Ve+=self.VMax*(1-exp(-(time -self.StartTime)/self.RiseTimeCons))
         else:
            self.Ve+=y_riseTime*exp(-(time -self.StartTime - RiseTime)/self.FallTimeConst); 
 
    
         
Documentation generated by PyAMS