PyAMS  (the software under revision)

PyAMS.Analog.Basic.Polarised Capacitor


Ideal linear electrical Polarised Capacitor

Information

The linear capacitor connects the branch voltage v with the branch current i by i = C * dv/dt. The Capacitance C is allowed to be positive, zero, or negative, for v starting with initiale value.

Parameters

NameDefaultDescription
C1µFCapacitance [F]
Vinit0.5Initial voltage [V]

PyAMS definition

from PyAMS import Signal
from PyAMS import ddt


#Ideal linear electrical polarised capacitor
class InitCap:
     def __init__(self, a, b):
         #Signal
         self.Vc = Signal('in','voltage',a,b)
         self.Ic = Signal('out','current',a,b)
         #Parameter
         self.C=1.0e-6         # C Capacitor Value
         self.Vinit=0.5        # Vinit Initial Voltage Value
     def analog(self):
         self.Ic+=self.C*ddt(self.Vc,self.Vinit)

Documentation generated by PyAMS