Пример #1
0
 def compute(self):
     t0 = time()
     self.resist = resist(self.field(), self.R1, self.R2)
     self.solution = solve(self.resist)
     # These are all PER VOLT
     self.V = self.solution['V']
     self.R = self.solution['R']
     self.I = self.solution['I']
     self.I_vect = self.solution['I_vect']
     self.I_mag = self.solution['I_mag']
     self.P = self.solution['P']
     dt = time() - t0
     self.computetime = dt
     print('R = {}. {} seconds'.format(self.R, dt))
Пример #2
0
    def compute(self, V_contact=1):
        t0 = time()
        computed = solve(self.resist(), V_contact)

        # These are all PER VOLT
        self.V = computed['V']
        self.R = computed['R']
        self.I = computed['I']
        self.Ix = computed['Ix']
        self.Iy = computed['Iy']
        self.I_mag = computed['I_mag']
        self.P = computed['P']
        self.Emag = computed['E']
        self.Ex = computed['Ex']
        self.Ey = computed['Ey']

        dt = time() - t0
        self.computetime = dt
Пример #3
0
    def compute(self, V_contact=1):
        t0 = time()
        # Approximate V_contact from number of pieces on the board
        computed = solve(self.resist(), V_contact)

        # These are all PER VOLT
        self.V = computed['V']
        self.R = computed['R']
        self.I = computed['I']
        self.Ix = computed['Ix']
        self.Iy = computed['Iy']
        self.I_mag = computed['I_mag']
        self.P = computed['P']
        self.Emag = computed['E']
        self.Ex = computed['Ex']
        self.Ey = computed['Ey']

        dt = time() - t0
        self.computetime = dt
        print('Done.  R = {}. {} seconds'.format(self.R, dt))