Пример #1
0
 def __str__(self):
     from py2md.classes import MDTable
     outstr = '# Turning Trim State ' + self.name + ' for ' + self.sys.name + '\n'
     table = MDTable()
     table.add_column('Speed', '.3f', data=[self.speed])
     table.add_column('Density', '.3f', data=[self.density])
     table.add_column('Dyn. Press.', '.3f', data=[self.dynpres])
     outstr += table._repr_markdown_()
     table = MDTable()
     table.add_column('Mass', '.3f', data=[self.mass.mass])
     table.add_column('Grav. Acc.', '.5f', data=[self.gravacc])
     table.add_column('Weight', '.3f', data=[self.weight])
     outstr += table._repr_markdown_()
     table = MDTable()
     table.add_column('Bank Angle (deg)', '.1f', data=[self.bankang])
     table.add_column('Load Factor', '.3f', data=[self.loadfac])
     table.add_column('Lift', '.3f', data=[self.lift])
     table.add_column('CL', '.5f', data=[self.CL])
     outstr += table._repr_markdown_()
     table = MDTable()
     table.add_column('Acceleration', '.3f', data=[self.acc])
     table.add_column('Turn Radius', '.3f', data=[self.rad])
     table.add_column('Pitch Rate', '.5f', data=[self.prate])
     table.add_column('Roll Rate', '.5f', data=[self.rrate])
     outstr += table._repr_markdown_()
     return outstr
Пример #2
0
 def __str__(self):
     outstr = '# Panel System '+self.name+'\n'
     table = MDTable()
     table.add_column('Name', 's', data=[self.name])
     table.add_column('Sref', 'g', data=[self.sref])
     table.add_column('cref', 'g', data=[self.cref])
     table.add_column('bref', 'g', data=[self.bref])
     table.add_column('xref', '.3f', data=[self.rref.x])
     table.add_column('yref', '.3f', data=[self.rref.y])
     table.add_column('zref', '.3f', data=[self.rref.z])
     outstr += table._repr_markdown_()
     table = MDTable()
     if self.grds is not None:
         table.add_column('# Grids', 'd', data=[self.numgrd])
     else:
         table.add_column('# Grids', 'd', data=[0])
     if self.pnls is not None:
         table.add_column('# Panels', 'd', data=[self.numpnl])
     else:
         table.add_column('# Panels', 'd', data=[0])
     if self.hsvs is not None:
         table.add_column('# Horseshoe Vortices', 'd', data=[self.numhsv])
     else:
         table.add_column('# Horseshoe Vortices', 'd', data=[0])
     if self.ctrls is not None:
         table.add_column('# Controls', 'd', data=[self.numctrl])
     else:
         table.add_column('# Controls', 'd', data=[0])
     if len(table.columns) > 0:
         outstr += table._repr_markdown_()
     return outstr
Пример #3
0
 def __str__(self):
     from py2md.classes import MDTable
     outstr = '# Level Trim State ' + self.name + ' for ' + self.sys.name + '\n'
     table = MDTable()
     table.add_column('Speed', '.3f', data=[self.speed])
     table.add_column('Density', '.3f', data=[self.density])
     table.add_column('Dyn. Press.', '.3f', data=[self.dynpres])
     outstr += table._repr_markdown_()
     table = MDTable()
     table.add_column('Mass', '.3f', data=[self.mass.mass])
     table.add_column('Grav. Acc.', '.5f', data=[self.gravacc])
     table.add_column('Weight', '.3f', data=[self.weight])
     outstr += table._repr_markdown_()
     table = MDTable()
     table.add_column('Lift', '.3f', data=[self.lift])
     table.add_column('CL', '.5f', data=[self.CL])
     outstr += table._repr_markdown_()
     return outstr
Пример #4
0
 def __str__(self):
     outstr = '# Lattice System ' + self.name + '\n'
     table = MDTable()
     table.add_column('Name', 's', data=[self.name])
     table.add_column('Sref', 'g', data=[self.sref])
     table.add_column('cref', 'g', data=[self.cref])
     table.add_column('bref', 'g', data=[self.bref])
     table.add_column('xref', '.3f', data=[self.rref.x])
     table.add_column('yref', '.3f', data=[self.rref.y])
     table.add_column('zref', '.3f', data=[self.rref.z])
     outstr += table._repr_markdown_()
     table = MDTable()
     if self.strps is not None:
         table.add_column('# Strips', 'd', data=[len(self.strps)])
     if self.pnls is not None:
         table.add_column('# Panels', 'd', data=[len(self.pnls)])
     if self.ctrls is not None:
         table.add_column('# Controls', 'd', data=[len(self.ctrls)])
     if len(table.columns) > 0:
         outstr += table._repr_markdown_()
     return outstr
Пример #5
0
 def __str__(self):
     from py2md.classes import MDTable
     outstr = '# ' + self.name + '\n'
     table = MDTable()
     table.add_column('Speed', 'g', data=[self.speed])
     table.add_column('Density', 'g', data=[self.rho])
     outstr += table._repr_markdown_()
     if self._phi is not None:
         table = MDTable()
         table.add_column('Label', 's')
         table.add_column('Type', 's')
         table.add_column('Value', 'g')
         table.add_row(['Di', 'Objective', self.return_induced_drag()])
         if self.constr is not None:
             for constr in self.constr:
                 val = constr.evaluate()
                 table.add_row([constr.param, 'Constraint', val])
         if self.record is not None:
             for record in self.record:
                 val = record.evaluate()
                 table.add_row([record.param, 'Record', val])
         outstr += table._repr_markdown_()
     return outstr