Пример #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)
Пример #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)
Пример #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')
Пример #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)
Пример #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)
Пример #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)
Пример #7
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
Пример #8
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
Пример #9
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
Пример #10
0
 def __init__(self,node1,name='Ground'):
     occurence_matrix=np.array([[1,0]])# U1=0
     PhysicalBlock.__init__(self,[node1],[],occurence_matrix,[],name)
Пример #11
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