Example #1
0
 def __init__(self,
              node_rotation,
              node_translation,
              wheels_radius,
              name='Wheel'):
     occurence_matrix = np.array([[1, 0, 1, 0], [0, 1, 0, 1]])
     self.wheels_radius = wheels_radius
     PhysicalBlock.__init__(self, [node_rotation, node_translation], [0, 1],
                            occurence_matrix, [], name)
Example #2
0
    def __init__(self,
                 node1,
                 wmin,
                 wmax,
                 Tmax_map,
                 fuel_flow_map,
                 name='Thermal engine'):
        occurence_matrix = np.array([[0, 1]])
        command = Variable('Requested engine throttle')
        self.wmin = wmin
        self.wmax = wmax
        self.Tmax = Tmax_map
        self.fuel_flow_map = fuel_flow_map
        self.max_torque = Variable('max torque')
        self.throttle = Variable('Engine throttle')

        PhysicalBlock.__init__(self, [node1], [0], occurence_matrix, [command],
                               name)
Example #3
0
 def __init__(self,
              node1,
              node2,
              u_min,
              u_max,
              c,
              initial_soc,
              r,
              name='Battery'):
     # 1st eq: U2=signal, U1=0
     occurrence_matrix = np.array([[1, 1, 1, 0], [0, 1, 0, 1]])
     # occurrence_matrix=np.array([[1,1,1,0]]) # 1st eq: U2=signal, U1=0
     PhysicalBlock.__init__(self, [node1, node2], [0, 1], occurrence_matrix,
                            [], name)
     self.u_max = u_max
     self.u_min = u_min
     self.c = c
     self.r = r
     self.initial_soc = initial_soc
     self.soc = Variable('Battery SoC', [initial_soc])
     self.u = Variable('Battery voltage')
Example #4
0
 def __init__(self, node1, Tmax, name='Brake'):
     occurence_matrix = np.array([[0, 1]])
     command = Variable('Brake command')
     self.Tmax = Tmax
     PhysicalBlock.__init__(self, [node1], [0], occurence_matrix, [command],
                            name)
Example #5
0
 def __init__(self, node1, node2, ratio, name='Gear ratio'):
     occurence_matrix = np.array([[1, 0, 1, 0], [0, 1, 0, 1]])
     self.ratio = ratio
     PhysicalBlock.__init__(self, [node1, node2], [0, 1], occurence_matrix,
                            [], name)
Example #6
0
 def __init__(self, node1, node2, Tmax, name='Clutch'):
     occurence_matrix = np.array([[0, 1, 0, 0], [0, 1, 0, 1]])
     command = Variable('Clutch command')
     self.Tmax = Tmax
     PhysicalBlock.__init__(self, [node1, node2], [0, 1], occurence_matrix,
                            [command], name)
Example #7
0
 def Evaluate(self, it, ts):
     return np.dot(np.array([1, -1]), self.InputValues(it))
Example #8
0
 def Evaluate(self, it, ts):
     value1, value2 = self.InputValues(it)
     return np.array([value1 * value2])
Example #9
0
 def Evaluate(self, it, ts):
     return np.array([self.function(self.InputValues(it)[0])])
Example #10
0
 def Evaluate(self, it, ts):
     return np.array([np.sum(self.InputValues(it))])
Example #11
0
 def __init__(self,node1,node2,voltage_signal,name='GeneratorGround'):
     occurence_matrix=np.array([[1,0,1,0]]) # 1st eq: U2=signal, U1=0 
     PhysicalBlock.__init__(self,[node1,node2],[0,1],occurence_matrix,[],name)
     self.voltage_signal=voltage_signal
Example #12
0
 def __init__(self,node1,node2,R,name='Resistor'):
     occurence_matrix=np.array([[1,1,1,0],[0,1,0,1]])#1st eq: (U1-U2)=R(i1-i2) 2nd: i1=-i2
     PhysicalBlock.__init__(self,[node1,node2],[0,1],occurence_matrix,[],name)
     self.R=R
Example #13
0
 def __init__(self,node1,node2,L,name='Inductor'):
     occurence_matrix=np.array([[1,1,1,0],[0,1,0,1]])#1st eq: (U1-U2)=Ldi1/dt 2nd: i1=-i2
     PhysicalBlock.__init__(self,[node1,node2],[0,1],occurence_matrix,[],name)
     self.L=L
Example #14
0
 def __init__(self,node1,name='Ground'):
     occurence_matrix=np.array([[1,0]])# U1=0
     PhysicalBlock.__init__(self,[node1],[],occurence_matrix,[],name)
Example #15
0
 def __init__(self, node1, node2, c, name='Capacitor'):
     # 1st eq: (U1-U2)=R(i1-i2) 2nd: i1=-i2
     occurrence_matrix = np.array([[1, 0, 1, 0], [0, 1, 0, 1]])
     PhysicalBlock.__init__(self, [node1, node2], [0, 1], occurrence_matrix,
                            [], name)
     self.c = c