Exemple #1
0
 def getKCLEquations(self, gnd):
     #!!
     """
     :param gnd: name of a node that will have its voltage assigned
      to 0 (string)
     :returns: a list of equations, one for each node.  For
      the ground node, it just asserts that its voltage is 0.  For
      the other nodes, the equation asserts that the sum of the
      currents going into the node minus the sum of currents going
      out of the node is equal to zero.
     """
     result = []
     for node in self.d.keys():
         if not node == gnd:
             (currents, signs) = apply(zip, self.d[node])
             result.append(le.Equation(signs, currents, 0.0))
     result.append(le.Equation([1], [gnd], 0))
     return result
Exemple #2
0
 def getEquation(self):
     return le.Equation([1.0, -1.0, -self.r],
                        [self.n1, self.n2, self.current], self.v)
Exemple #3
0
 def getEquation(self):
     #!!
     return le.Equation([1.0, -self.K, self.K],
                        [self.nOut, self.nPlus, self.nMinus], 0.0)
Exemple #4
0
 def getEquation(self):
     return le.Equation([1.0, -1.0], [self.n1, self.n2], 0)
Exemple #5
0
 def getEquation(self):
     return le.Equation([1.0], [self.current], self.i)