Truss Structure Problems¶
For the analysis or optimization of truss structures, there exist two problem formulations:
Truss Structure Analysis Problem¶
Truss Structure Analysis Class¶
- class engioptiqa.problems.structural.truss_structure.truss_structure.TrussStructure(output_path=None)¶
- add_load(node_id, force)¶
Add an external load to a node.
- Parameters:
node_id – ID of the node where the load is applied.
force – Tuple (Fx, Fy) representing the force components in x and y directions.
- add_member(node_0_id, node_1_id, A=None, E=None, member_id=None)¶
Add a truss member to the structure.
- Parameters:
node_0_id – ID of the first node.
node_1_id – ID of the second node.
A – Cross-sectional area of the member (optional).
E – Young’s modulus of the member (optional).
member_id – Unique identifier for the member (optional).
- add_node(node_id, coordinates)¶
Add a node to the truss structure.
- Parameters:
node_id – Unique identifier for the node (e.g., integer or string).
coordinates – Tuple (x, y) representing the node’s position.
- add_support(node_id, x_fixed=True, y_fixed=True)¶
Add a support condition to a node.
- Parameters:
node_id – ID of the node where the support is applied.
x_fixed – Boolean indicating if the x-direction is fixed (default: True).
y_fixed – Boolean indicating if the y-direction is fixed (default: True).
- analyze_results(results=None, analysis_plots=True, compute_errors=True, result_max=9223372036854775807)¶
Analyze results computed or returned by a solver.
- Parameters:
results – Optional results to analyze. If not provided, will attempt to use self.results computed by a solver.
- Returns:
List of solutions (dictionaries) containing information (bit array, energy, frequency).
- compute_member_forces()¶
Compute axial forces in the truss members using the method of joints. :return: Dictionary of member forces: {(node_1_id, node_2_id): force}.
- generate_discretization(n_qubits_per_var, binary_representation, lower_lim=None, upper_lim=None)¶
Discretize problem variables into binary representation.
- generate_problem_formulation(penalty_weight)¶
Generate problem formulation as an Amplify Model based on a polynomial in binary variables for the objective to be minimized including constraints.
- get_load_info()¶
Retrieve information about all loads in the structure.
- Returns:
Dictionary of node IDs and their applied forces.
- get_member_areas()¶
Get the cross-sectional areas for all members.
- get_member_info()¶
Retrieve information about all members in the structure.
- Returns:
List of dictionaries containing member properties.
- get_node_info()¶
Retrieve information about all nodes in the structure.
- Returns:
Dictionary of node IDs and their coordinates.
- get_support_info()¶
Retrieve information about all supports in the structure.
- Returns:
Dictionary of node IDs and their support conditions.
- set_member_areas(member_areas)¶
Set the cross-sectional areas for all members.
- Parameters:
member_areas – List of areas corresponding to each member.
- visualize(subtitle='')¶
Visualize the truss structure, including nodes, members, loads, and supports.
- Parameters:
subtitle – Subtitle for the plot.
Truss Structure Optimization Problem¶
Truss Structure Optimization Class¶
- class engioptiqa.problems.structural.truss_structure.truss_structure_optimization.TrussStructureOptimization(target_volume=None, output_path=None)¶
- generate_problem_formulation(penalty_weight)¶
Generate problem formulation as an Amplify Model based on a polynomial in binary variables for the objective to be minimized including constraints.