PyAMS  (the software under revision)

PyAMS.Analog.Basic.Resistor


Ideal linear electrical resistor

Modelica.Electrical.Analog.Basic.Resistor


Information

The linear resistor connects the branch voltage v with the branch current i by i= v/R. The Resistance R is allowed to be positive or negative.

Parameters

NameDefaultDescription
R100Resistance [Ohm]

PyAMS definition

from PyAMS import Signal

#Ideal linear electrical resistor
class Resistor:
     def __init__(self, p, n):  
         self.Vr = Signal('in','voltage',p,n)
         self.Ir = Signal('out','current',p,n)
         self.R=100.0     # R Resistor Value

     def analog(self):
         self.Ir+=self.Vr/self.R

Documentation generated by PyAMS