def apply_perpendicular_q_load(system: "SystemElements"): for element_id in system.loads_dead_load: element = system.element_map[element_id] q_perpendicular = element.all_q_load if q_perpendicular == 0: continue elif ( element.q_direction == "x" or element.q_direction == "y" or element.dead_load ): apply_parallel_q_load(system, element) kl = element.constitutive_matrix[1][1] * 1e6 kr = element.constitutive_matrix[2][2] * 1e6 if math.isclose(kl, kr): left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -left_moment rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = rleft else: # minus because of systems positive rotation left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -det_moment( kl, kr, q_perpendicular, element.l, element.EI, element.l ) rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = -det_shear( kl, kr, q_perpendicular, element.l, element.EI, element.l ) rleft_x = rleft * math.sin(element.a1) rright_x = rright * math.sin(element.a2) rleft_z = rleft * math.cos(element.a1) rright_z = rright * math.cos(element.a2) if element.type == "truss": left_moment = 0 right_moment = 0 primary_force = np.array( [rleft_x, rleft_z, left_moment, rright_x, rright_z, right_moment] ) element.element_primary_force_vector -= primary_force # Set force vector assert system.system_force_vector is not None system.system_force_vector[ (element.node_id1 - 1) * 3 : (element.node_id1 - 1) * 3 + 3 ] += primary_force[0:3] system.system_force_vector[ (element.node_id2 - 1) * 3 : (element.node_id2 - 1) * 3 + 3 ] += primary_force[3:]
def _apply_perpendicular_q_load(self): for element_id, g in self.loads_dead_load: element = self.element_map[element_id] q_perpendicular = element.all_q_load if q_perpendicular == 0: continue elif element.q_direction == "x" or element.q_direction == "y" or element.dead_load: self._apply_parallel_q_load(element) kl = element.constitutive_matrix[1][1] * 1e6 kr = element.constitutive_matrix[2][2] * 1e6 if math.isclose(kl, kr): left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -left_moment rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = rleft else: # minus because of systems positive rotation left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -det_moment(kl, kr, q_perpendicular, element.l, element.EI, element.l) rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = -det_shear(kl, kr, q_perpendicular, element.l, element.EI, element.l) rleft_x = rleft * math.sin(element.ai) rright_x = rright * math.sin(element.ai) rleft_z = rleft * math.cos(element.ai) rright_z = rright * math.cos(element.ai) primary_force = np.array([ rleft_x, rleft_z, left_moment, rright_x, rright_z, right_moment ]) element.element_primary_force_vector -= primary_force # Set force vector self.system_force_vector[(element.node_id1 - 1) * 3:(element.node_id1 - 1) * 3 + 3] += primary_force[0:3] self.system_force_vector[(element.node_id2 - 1) * 3:(element.node_id2 - 1) * 3 + 3] += primary_force[3:]
def apply_perpendicular_q_load(system): for element_id in system.loads_dead_load: element = system.element_map[element_id] q_perpendicular = element.all_q_load if q_perpendicular == 0: continue elif element.q_direction == "x" or element.q_direction == "y" or element.dead_load: apply_parallel_q_load(system, element) kl = element.constitutive_matrix[1][1] * 1e6 kr = element.constitutive_matrix[2][2] * 1e6 if math.isclose(kl, kr): left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -left_moment rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = rleft else: # minus because of systems positive rotation left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -det_moment(kl, kr, q_perpendicular, element.l, element.EI, element.l) rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = -det_shear(kl, kr, q_perpendicular, element.l, element.EI, element.l) rleft_x = rleft * math.sin(element.angle) rright_x = rright * math.sin(element.angle) rleft_z = rleft * math.cos(element.angle) rright_z = rright * math.cos(element.angle) if element.type == 'truss': left_moment = 0 right_moment = 0 primary_force = np.array([rleft_x, rleft_z, left_moment, rright_x, rright_z, right_moment]) element.element_primary_force_vector -= primary_force # Set force vector system.system_force_vector[(element.node_id1 - 1) * 3: (element.node_id1 - 1) * 3 + 3] += primary_force[0:3] system.system_force_vector[(element.node_id2 - 1) * 3: (element.node_id2 - 1) * 3 + 3] += primary_force[3:]
def apply_perpendicular_q_load(system: "SystemElements"): for element_id in system.loads_dead_load: element = system.element_map[element_id] if element.q_load is None and element.dead_load == 0: continue q_perpendicular = element.all_q_load parallel_load = False if isinstance(q_perpendicular, (float, int)): if not (math.isclose(element.q_load + element.dead_load, q_perpendicular)): parallel_load = True elif isinstance(q_perpendicular, list): if not (math.isclose(element.q_load[0] + element.dead_load, q_perpendicular[0]) or math.isclose(element.q_load[1] + element.dead_load, q_perpendicular[1])): parallel_load = True if parallel_load: apply_parallel_q_load(system, element) if q_perpendicular == 0: continue kl = element.constitutive_matrix[1][1] * 1e6 kr = element.constitutive_matrix[2][2] * 1e6 if isinstance(q_perpendicular, (float, int)): if math.isclose(kl, kr): left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -left_moment rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = rleft else: # minus because of systems positive rotation left_moment = det_moment(kl, kr, q_perpendicular, 0, element.EI, element.l) right_moment = -det_moment(kl, kr, q_perpendicular, element.l, element.EI, element.l) rleft = det_shear(kl, kr, q_perpendicular, 0, element.EI, element.l) rright = -det_shear(kl, kr, q_perpendicular, element.l, element.EI, element.l) elif isinstance(q_perpendicular, list): left_moment, right_moment = det_moment_linear( q_perpendicular[0], q_perpendicular[1], element.l) rleft, rright = det_shear_linear(q_perpendicular[0], q_perpendicular[1], element.l) rleft_x = rleft * math.sin(element.a1) rright_x = rright * math.sin(element.a2) rleft_z = rleft * math.cos(element.a1) rright_z = rright * math.cos(element.a2) if element.type == "truss": left_moment = 0 right_moment = 0 primary_force = np.array( [rleft_x, rleft_z, left_moment, rright_x, rright_z, right_moment]) element.element_primary_force_vector -= primary_force # Set force vector assert system.system_force_vector is not None system.system_force_vector[(element.node_id1 - 1) * 3:(element.node_id1 - 1) * 3 + 3] += primary_force[0:3] system.system_force_vector[(element.node_id2 - 1) * 3:(element.node_id2 - 1) * 3 + 3] += primary_force[3:]