def optimize_member_for_drift(self):
     """
     This method is used to decrease the member size such that the design is most economic.
     :return: update self.member_size
     """
     # Find the story which has the smallest drift
     target_story = np.where(self.elastic_response['story drift'] ==
                             np.min(self.elastic_response['story drift']))[0][0]
     # Update the interior column size in target story
     self.member_size['interior column'][target_story] = \
         decrease_member_size(self.element_candidate['interior column']['story %s' % (target_story + 1)],
                              self.member_size['interior column'][target_story])
     # Compute the section property of the interior column size
     reference_property = search_section_property(self.member_size['interior column'][target_story],
                                                  SECTION_DATABASE)
     # Determine the beam size based on beam-to-column section modulus ratio
     beam_size = search_member_size('Zx', reference_property['Zx'] * BEAM_TO_COLUMN_RATIO,
                                    self.element_candidate['beam']['floor level %s' % (target_story + 2)],
                                    SECTION_DATABASE)
     # "Push" the updated beam size back to the class dictionary
     self.member_size['beam'][target_story] = beam_size
     # Determine the exterior column size based on exterior/interior column moment of inertia ratio
     exterior_size = search_member_size('Ix', reference_property['Ix'] * EXTERIOR_INTERIOR_COLUMN_RATIO,
                                        self.element_candidate['exterior column']['story %s' % (target_story + 1)],
                                        SECTION_DATABASE)
     self.member_size['exterior column'][target_story] = exterior_size
 def initialize_member(self):
     """
     This method is used to initialize the member size
     :return: a dictionary which includes the initial size for interior columns, exterior columns, and beams
     """
     # Define initial sizes for columns and beams
     interior_column = []
     exterior_column = []
     beam = []
     for story in range(0, self.geometry['number of story']):
         # The initial column is selected as the greatest sizes in the candidate pool
         initial_interior = self.element_candidate['interior column']['story %s' % (story + 1)][0]
         initial_exterior = self.element_candidate['exterior column']['story %s' % (story + 1)][0]
         # Merge initial size of each story together
         interior_column.append(initial_interior)
         exterior_column.append(initial_exterior)
         # Compute the section property of the interior column size
         reference_property = search_section_property(initial_interior, SECTION_DATABASE)
         # Determine the beam size based on beam-to-column section modulus ratio
         beam_size = search_member_size('Zx', reference_property['Zx'] * BEAM_TO_COLUMN_RATIO,
                                        self.element_candidate['beam']['floor level %s' % (story + 2)],
                                        SECTION_DATABASE)
         # Merge initial beam size of each story together
         beam.append(beam_size)
     # Store all initial member sizes into the dictionary (which will be updated using optimization algorithm later)
     self.member_size = {'interior column': interior_column,
                         'exterior column': exterior_column,
                         'beam': beam}