PyAMS  (the software under revision)

PyAMS.Analog.SPICE.Capacitor


Model SPICE-compatible capacitor

Information

The linear capacitor connects the branch voltage Vc with the branch current Ic by Ic = C*ddt(Vc) for "ddt" prestented the derivative by time. The Capacitance C is allowed to be positive, zero, or negative.

Temperature dependence

The block adjusts the specified or calculated resistance value for temperature "T" using the following equation:

C(T)=C*(1+TC1*(T-Tnom)+TC2*(T-Tnom)^2)

for Tnom is the nominal temperature. TNOM defaults to 27 °C

Parameters

NameDefaultDescription
C1µFCapacitance [F]
TC10.0Linear temperature coefficient [°C^-1]
TC20.0Quadratic temperature coefficient [°C^-1]

PyAMS definition

from PyAMS import Signal
from PyAMS import Qtemp
from PyAMS import ddt

#The SPICE Capacitor
class SCCapacitor:
     def __init__(self, a, b):
         self.Vc = Signal('in','potential',a,b)
         self.Ic = Signal('out','flow',a,b)
         self.C=1.0e-6    # C Capacitor Value
         self.VC1=0.0     # Linear voltage coefficient
         self.VC2=0.0     # Quadratic voltage coefficient
         self.TC1=0.0     # Linear temperature coefficient
         self.TC2=0.0     # Quadratic temperature coefficient
     def start(self):
         self.C=self.C*Qtemp(self.TC1,self.TC2)                          
     def analog(self):
         self.Ic+=self.C*ddt(self.Vc)
         

Documentation generated by PyAMS