Example #1
0
 def __init__(self, vol):
     _custom_volume.__init__(self, vol)
     mat = material(steel.density, self._vol2cost(vol))
     s = self.cylS(vol)
     h = self._vol2mass(vol) / mat.density / s
     mat.cost = mat.cost / s / h * surface.unit_h
     volume.__init__(self, vol, self._name, C=0, D=0, S=surface(s, h, mat))
Example #2
0
 def __init__(self, vol):
     _custom_volume.__init__(self, vol)
     mat = material(steel.density, self._vol2cost(vol))
     s = self.cylS(vol)
     h = self._vol2mass(vol)/mat.density/s
     mat.cost = mat.cost/s/h*surface.unit_h
     volume.__init__(self, vol, self._name, C=0, D=0,
                     S=surface(s, h, mat))
Example #3
0
 def __init__(self, **kwargs):
     V = kwargs.get('V', -1.0)
     T = kwargs.get('T', -1.0)
     if V < 0 and T < 0: 
         raise ValueError("%s: either volume or torque should be provided." % self._name)
     if V < 0: V = self.S2V(T/(self._thickness*self._material.density*self._spec_torque))
     _custom_volume.__init__(self, V)
     volume.__init__(self, V, self._name, C=0, D=0,
                     S=surface(self.cylS(V), self._thickness, self._material))
Example #4
0
 def __init__(self, **kwargs):
     V = kwargs.get('V', -1.0)
     T = kwargs.get('T', -1.0)
     if V < 0 and T < 0:
         raise ValueError(
             "%s: either volume or torque should be provided." % self._name)
     if V < 0:
         V = self.S2V(
             T /
             (self._thickness * self._material.density * self._spec_torque))
     _custom_volume.__init__(self, V)
     volume.__init__(self,
                     V,
                     self._name,
                     C=0,
                     D=0,
                     S=surface(self.cylS(V), self._thickness,
                               self._material))
Example #5
0
    max_wys = [max(len(str(y[i])) for i in w) for y in ys]
    for i in w: 
        s += '%s%s ' % (x[i], ' '*(max_wx-len(str(x[i]))))
        for y, myw in zip(ys, max_wys): 
            s += ': %s%s ' % (y[i], ' '*(myw-len(str(y[i]))))
        s += '\n'
    return s
#end def


if __name__ == '__main__':
    scales = np.arange(0.5, 4.1, 0.5)
    
    inline1   = part('InlineHangar',
                     [volume(9.4, 'hull', C=1, D=0.02, 
                             S=surface(66.444, 0.004, Al_Li),
                             V=[volume(3.93, 'machinery', C=850, M=0.430)]),
                      volume(0.659*2, 'doors', C=1, D=0.02,
                             S=surface(9.32*2, 0.003, Al_Li)),
                      ],
                     size = 2,
                     add_mass=0,
                     add_cost=200) #docking port
    
    inline2   = part('InlineHangar2',
                     [volume(98.08, 'hull', C=1, D=0.02,
                             S=surface(268.11, 0.005, Al_Li),
                             V=[volume(53.66, 'top compartment', C=20, D=0.05,
                                       V=[volume(7.34, 'cabins', C=4000, M=0.35*3, N=2,
                                                 S=surface(25.19, 0.003, Al_Li)),
                                          volume(15.5, 'corridor', C=2, D=0.0012,
Example #6
0
 def __init__(self, S):
     self.energy = S * self._surface_energy
     _custom_volume.__init__(self, S * self._thickness)
     self._surface = surface(S, self._thickness, self._material)
Example #7
0
 def __init__(self, S):
     self.energy = S*self._surface_energy
     _custom_volume.__init__(self, S*self._thickness)
     self._surface = surface(S, self._thickness, self._material)
Example #8
0
            s += ': %s%s ' % (y[i], ' ' * (myw - len(str(y[i]))))
        s += '\n'
    return s


#end def

if __name__ == '__main__':
    scales = np.arange(0.5, 4.1, 0.5)

    inline1 = part('InlineHangar', [
        volume(9.4,
               'hull',
               C=1,
               D=0.02,
               S=surface(66.444, 0.004, Al_Li),
               V=[volume(3.93, 'machinery', C=850, M=0.430)]),
        volume(
            0.659 * 2, 'doors', C=1, D=0.02, S=surface(9.32 * 2, 0.003,
                                                       Al_Li)),
    ],
                   size=2,
                   add_mass=0,
                   add_cost=200)  #docking port

    inline2 = part('InlineHangar2', [
        volume(98.08,
               'hull',
               C=1,
               D=0.02,
               S=surface(268.11, 0.005, Al_Li),