PyAMS  (the software under revision)

PyAMS.Analog.Basic.Capacitor


Ideal linear electrical 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.

Parameters

NameDefaultDescription
C1µFCapacitance [F]

PyAMS definition

from PyAMS import Signal
from PyAMS import ddt

#Ideal linear electrical capacitor
class Capacitor:
     def __init__(self, p, n):
         self.Vc = Signal('in','potential',p,n)
         self.Ic = Signal('out','flow',p,n)
         self.C=1.0e-6    # C Capacitor Value
         
     def analog(self):
         self.Ic+=self.C*ddt(self.Vc)

Documentation generated by PyAMS