original_docstring: Stability analysis level 2.
  
          For the level 2 stability analysis additional sources that contribute
          to the rotor stability shall be considered such as:
          a)  labyrinth seals;
          b)  damper seals;
          c)  impeller/blade flow aerodynamic effects;
          d)  internal friction.
  
          Returns
          -------
          df_logdec: pandas dataframe
              A dataframe relating the logarithmic decrement for each
              case analyzed
  
          Example
          -------
          >>> import ross as rs
          >>> report = rs.report_example()
          >>> dataframe = report.stability_level_2()
          
docstring: Stability analysis level 2.
  For the level 2 stability analysis additional sources that contribute
  to the rotor stability shall be considered such as:
  a)  labyrinth seals;
  b)  damper seals;
  c)  impeller/blade flow aerodynamic effects;
  d)  internal friction.
  
  Returns
  
  pandas dataframe
  A dataframe relating the logarithmic decrement for each
  case analyzed
  
  Example
  
  
docstring_tokens: Stability analysis level 2 . For the level 2 stability analysis additional sources that contribute to the rotor stability shall be considered such as : a ) labyrinth seals ; b ) damper seals ; c ) impeller / blade flow aerodynamic effects ; d ) internal friction . Returns pandas dataframe A dataframe relating the logarithmic decrement for each case analyzed Example
code: def stability_level_2(self):
          """Stability analysis level 2.
  
          For the level 2 stability analysis additional sources that contribute
          to the rotor stability shall be considered such as:
          a)  labyrinth seals;
          b)  damper seals;
          c)  impeller/blade flow aerodynamic effects;
          d)  internal friction.
  
          Returns
          -------
          df_logdec: pandas dataframe
              A dataframe relating the logarithmic decrement for each
              case analyzed
  
          Example
          -------
          >>> import ross as rs
          >>> report = rs.report_example()
          >>> dataframe = report.stability_level_2()
          """
          # Build a list of seals
          seal_list = [
              copy(b) for b in self.rotor.bearing_elements if isinstance(b, SealElement)
          ]
  
          bearing_list = [
              copy(b)
              for b in self.rotor.bearing_elements
              if not isinstance(b, SealElement)
          ]
  
          log_dec_seal = []
          log_dec_disk = []
          log_dec_full = []
          data_seal = {}
          data_disk = {}
          data_rotor = {}
  
          # Evaluate log dec for each component - Disks
          if len(self.rotor.disk_elements):
              for disk in self.rotor.disk_elements:
                  aux_rotor = Rotor(
                      shaft_elements=self.rotor.shaft_elements,
                      disk_elements=[disk],
                      bearing_elements=bearing_list,
                      rated_w=self.maxspeed,
                  )
                  modal = aux_rotor.run_modal(speed=self.maxspeed)
                  non_backward = modal.whirl_direction() != "Backward"
                  log_dec_disk.append(modal.log_dec[non_backward][0])
  
              # Evaluate log dec for group bearings + disks
              disk_tags = [
                  "Shaft + Bearings + " + disk.tag for disk in self.rotor.disk_elements
              ]
  
              # Evaluate log dec for group bearings + all disks
              if len(self.rotor.disk_elements) > 1:
                  all_disks_tag = " + ".join(
                      [disk.tag for disk in self.rotor.disk_elements]
                  )
                  disk_tags.append("Shaft + Bearings + " + all_disks_tag)
  
                  aux_rotor = Rotor(
                      shaft_elements=self.rotor.shaft_elements,
                      disk_elements=self.rotor.disk_elements,
                      bearing_elements=bearing_list,
                      rated_w=self.maxspeed,
                  )
                  modal = aux_rotor.run_modal(speed=self.maxspeed)
                  non_backward = modal.whirl_direction() != "Backward"
                  log_dec_disk.append(modal.log_dec[non_backward][0])
  
              data_disk = {"tags": disk_tags, "log_dec": log_dec_disk}
  
          # Evaluate log dec for each component - Seals
          if len(seal_list):
              for seal in seal_list:
                  bearings_seal = deepcopy(bearing_list)
                  bearings_seal.append(seal)
  
                  aux_rotor = Rotor(
                      shaft_elements=self.rotor.shaft_elements,
                      disk_elements=[],
                      bearing_elements=bearings_seal,
                      rated_w=self.maxspeed,
                  )
                  modal = aux_rotor.run_modal(speed=self.maxspeed)
                  non_backward = modal.whirl_direction() != "Backward"
                  log_dec_seal.append(modal.log_dec[non_backward][0])
  
              seal_tags = ["Shaft + Bearings + " + seal.tag for seal in seal_list]
  
              if len(seal_list) > 1:
                  # Evaluate log dec for group bearings + seals
                  all_seals_tag = " + ".join([seal.tag for seal in seal_list])
                  seal_tags.append("Shaft + Bearings + " + all_seals_tag)
  
                  aux_rotor = Rotor(
                      shaft_elements=self.rotor.shaft_elements,
                      disk_elements=[],
                      bearing_elements=self.rotor.bearing_elements,
                      rated_w=self.maxspeed,
                  )
                  modal = aux_rotor.run_modal(speed=self.maxspeed)
                  non_backward = modal.whirl_direction() != "Backward"
                  log_dec_seal.append(modal.log_dec[non_backward][0])
  
              data_seal = {"tags": seal_tags, "log_dec": log_dec_seal}
  
          # Evaluate log dec for all components
          modal = self.rotor.run_modal(speed=self.maxspeed)
          non_backward = modal.whirl_direction() != "Backward"
          log_dec_full.append(modal.log_dec[non_backward][0])
          rotor_tags = [self.tag]
  
          data_rotor = {"tags": rotor_tags, "log_dec": log_dec_full}
  
          df_logdec_disk = pd.DataFrame(data_disk)
          df_logdec_seal = pd.DataFrame(data_seal)
          df_logdec_full = pd.DataFrame(data_rotor)
          df_logdec = pd.concat([df_logdec_disk, df_logdec_seal, df_logdec_full])
          df_logdec = df_logdec.reset_index(drop=True)
  
          self.df_logdec_disk = df_logdec_disk
          self.df_logdec_seal = df_logdec_seal
          self.df_logdec_full = df_logdec_full
          self.df_logdec = df_logdec
  
          return df_logdec
code_tokens: def stability_level_2 ( self ) : seal_list = [ copy ( b ) for b in self . rotor . bearing_elements if isinstance ( b , SealElement ) ] bearing_list = [ copy ( b ) for b in self . rotor . bearing_elements if not isinstance ( b , SealElement ) ] log_dec_seal = [ ] log_dec_disk = [ ] log_dec_full = [ ] data_seal = { } data_disk = { } data_rotor = { } if len ( self . rotor . disk_elements ) : for disk in self . rotor . disk_elements : aux_rotor = Rotor ( shaft_elements = self . rotor . shaft_elements , disk_elements = [ disk ] , bearing_elements = bearing_list , rated_w = self . maxspeed , ) modal = aux_rotor . run_modal ( speed = self . maxspeed ) non_backward = modal . whirl_direction ( ) != "Backward" log_dec_disk . append ( modal . log_dec [ non_backward ] [ 0 ] ) disk_tags = [ "Shaft + Bearings + " + disk . tag for disk in self . rotor . disk_elements ] if len ( self . rotor . disk_elements ) > 1 : all_disks_tag = " + " . join ( [ disk . tag for disk in self . rotor . disk_elements ] ) disk_tags . append ( "Shaft + Bearings + " + all_disks_tag ) aux_rotor = Rotor ( shaft_elements = self . rotor . shaft_elements , disk_elements = self . rotor . disk_elements , bearing_elements = bearing_list , rated_w = self . maxspeed , ) modal = aux_rotor . run_modal ( speed = self . maxspeed ) non_backward = modal . whirl_direction ( ) != "Backward" log_dec_disk . append ( modal . log_dec [ non_backward ] [ 0 ] ) data_disk = { "tags" : disk_tags , "log_dec" : log_dec_disk } if len ( seal_list ) : for seal in seal_list : bearings_seal = deepcopy ( bearing_list ) bearings_seal . append ( seal ) aux_rotor = Rotor ( shaft_elements = self . rotor . shaft_elements , disk_elements = [ ] , bearing_elements = bearings_seal , rated_w = self . maxspeed , ) modal = aux_rotor . run_modal ( speed = self . maxspeed ) non_backward = modal . whirl_direction ( ) != "Backward" log_dec_seal . append ( modal . log_dec [ non_backward ] [ 0 ] ) seal_tags = [ "Shaft + Bearings + " + seal . tag for seal in seal_list ] if len ( seal_list ) > 1 : all_seals_tag = " + " . join ( [ seal . tag for seal in seal_list ] ) seal_tags . append ( "Shaft + Bearings + " + all_seals_tag ) aux_rotor = Rotor ( shaft_elements = self . rotor . shaft_elements , disk_elements = [ ] , bearing_elements = self . rotor . bearing_elements , rated_w = self . maxspeed , ) modal = aux_rotor . run_modal ( speed = self . maxspeed ) non_backward = modal . whirl_direction ( ) != "Backward" log_dec_seal . append ( modal . log_dec [ non_backward ] [ 0 ] ) data_seal = { "tags" : seal_tags , "log_dec" : log_dec_seal } modal = self . rotor . run_modal ( speed = self . maxspeed ) non_backward = modal . whirl_direction ( ) != "Backward" log_dec_full . append ( modal . log_dec [ non_backward ] [ 0 ] ) rotor_tags = [ self . tag ] data_rotor = { "tags" : rotor_tags , "log_dec" : log_dec_full } df_logdec_disk = pd . DataFrame ( data_disk ) df_logdec_seal = pd . DataFrame ( data_seal ) df_logdec_full = pd . DataFrame ( data_rotor ) df_logdec = pd . concat ( [ df_logdec_disk , df_logdec_seal , df_logdec_full ] ) df_logdec = df_logdec . reset_index ( drop = True ) self . df_logdec_disk = df_logdec_disk self . df_logdec_seal = df_logdec_seal self . df_logdec_full = df_logdec_full self . df_logdec = df_logdec return df_logdec
short_docstring: Stability analysis level 2.
short_docstring_tokens: Stability analysis level 2 .
comment: """Stability analysis level 2.
  
          For the level 2 stability analysis additional sources that contribute
          to the rotor stability shall be considered such as:
          a)  labyrinth seals;
          b)  damper seals;
          c)  impeller/blade flow aerodynamic effects;
          d)  internal friction.
  
          Returns
          -------
          df_logdec: pandas dataframe
              A dataframe relating the logarithmic decrement for each
              case analyzed
  
          Example
          -------
          >>> import ross as rs
          >>> report = rs.report_example()
          >>> dataframe = report.stability_level_2()
          """$SEP$# Build a list of seals$SEP$# Evaluate log dec for each component - Disks$SEP$# Evaluate log dec for group bearings + disks$SEP$# Evaluate log dec for group bearings + all disks$SEP$# Evaluate log dec for each component - Seals$SEP$# Evaluate log dec for group bearings + seals$SEP$# Evaluate log dec for all components