Issues Defining Releases in a 2D Truss Using PyNite Library #203
Unanswered
ugurfeyzullah
asked this question in
Q&A
Replies: 1 comment
-
Before I dive too deep into this and spend a lot of time... I just want to check for a common mistake... do you have a nodal instability? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm working on a simple 10-bar 2D truss model using the PyNite library. I'm encountering several issues and would appreciate your help with the following error:
`* Nodal instability detected: node 1 is unstable for rotation about the global Y axis.
Traceback (most recent call last):
File "c:\Users\ugury\OneDrive\Masaüstü\Opensees\v5.py", line 73, in
model.analyze(check_statics=True)
File "C:\Users\ugury\AppData\Roaming\Python\Python312\site-packages\PyNite\FEModel3D.py", line 1974, in analyze
K11, K12, K21, K22 = Analysis._partition(self, self.K(combo.name, log, check_stability, sparse).tolil(), D1_indices, D2_indices)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ugury\AppData\Roaming\Python\Python312\site-packages\PyNite\FEModel3D.py", line 1584, in K
if sparse: Analysis._check_stability(self, K.tocsr())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ugury\AppData\Roaming\Python\Python312\site-packages\PyNite\Analysis.py", line 123, in _check_stability
raise Exception('Unstable node(s). See console output for details.')
Exception: Unstable node(s). See console output for details.`
My code is :
`from PyNite import FEModel3D, Visualization
import time
Record the start time
start_time = time.time()
Create a new finite element model
model = FEModel3D()
Define nodes (x, y, z)
model.add_node("1", 0, 0, 360)
model.add_node("2", 360, 0, 360)
model.add_node("3", 720, 0, 360)
model.add_node("4", 0, 0, 0)
model.add_node("5", 360, 0, 0)
model.add_node("6", 720, 0, 0)
Define supports (node, x_restraint, y_restraint, z_restraint, x_rotation_restraint, y_rotation_restraint, z_rotation_restraint)
model.def_support('1', True, True, True, False, False, False)
model.def_support('4', True, True, True, False, False, False)
Define material (name, elastic modulus, poissons ratio, density)
E = 1000 # (ksi) Modulus of elasticity
G = 11400 # (ksi) Shear modulus
nu = 0.1 # Poisson's ratio
rho = 0.1 # (kci) Density
model.add_material('Steel', E, G, nu, rho)
Define separate lists for Iy, Iz, and A
Iy_list = [17.3, 16.5, 18.0, 16.8, 17.5, 17.2, 17.0, 16.9, 17.8, 16.7] # (in4) Weak axis moment of inertia
Iz_list = [204, 190, 210, 198, 205, 200, 198, 196, 207, 195] # (in4) Strong axis moment of inertia
A_list = [33.5, 1.62, 22,15.5,1.62,1.8,14.2,19.9,19.9,2.62] # (in2) Cross-sectional area
J_list = [7.65, 8.0, 7.0, 7.8, 7.5, 7.9, 7.2, 7.4, 8.2, 7.3] # (in4) Torsional constant
Define the members and their properties using the lists
members = [
('M1', '1', '2'),
('M2', '2', '3'),
('M3', '4', '5'),
('M4', '5', '6'),
('M5', '2', '5'),
('M6', '3', '6'),
('M7', '1', '5'),
('M8', '2', '4'),
('M9', '2', '6'),
('M10', '3', '5')
]
Create the model and add members with their respective properties
for i, member in enumerate(members):
name, node_i, node_j = member
Iy = Iy_list[i]
Iz = Iz_list[i]
A = A_list[i]
J = J_list[i]
model.add_member(name, node_i, node_j, 'Steel', Iy, Iz, J, A)
# Release the moments at the ends of the members to make model members
release_params = [False, False, False, False, True, True,False, False, False, False, True, True]
members = ['M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10']
for member in members:
model.def_releases(member, *release_params)
Add loads
model.add_node_load('5', 'FZ', -100)
model.add_node_load('6', 'FZ',-100)
Analyze the model
model.analyze(check_statics=True)
Retrieve and print maximum axial stress for all members
for member_name in model.Members:
member = model.Members[member_name]
max_axial_force = member.max_axial()
A = A_list[list(model.Members.keys()).index(member_name)] # Fetch A directly using member_name
max_axial_stress = max_axial_force / A
print(f"Member {member_name}: max axial stress = {max_axial_stress:.2f} ksi")
node_ids = ["1", "2", "3", "4", "5", "6"]
max_displacements = []
Retrieve and print deflections for all nodes
for node_id in node_ids:
node = model.Nodes[node_id]
dx = node.DX
dy = node.DY['Combo 1']
dz = node.DZ['Combo 1']
max_displacements.append(dz)
print(f"Node {node_id}: dx = {dx}, dy = {dy}, dz = {dz}")
print("max_displacements", max_displacements)
Calculate and print the weight of the structure
total_weight = 0.0
for i, member_name in enumerate(model.Members):
A = A_list[i]
L = model.Members[member_name].L()
weight = A * L * rho
total_weight += weight
print(f"Total weight of the structure: {total_weight:.2f} kip")
Record the end time
end_time = time.time()
Calculate and print the elapsed time
elapsed_time = end_time - start_time
print(f"Analysis runtime: {elapsed_time:.2f} seconds")
# Visualization (optional)
Visualization.render_model(model, annotation_size=10, deformed_shape=False, deformed_scale=1)
`
Also Since the truss members connected to pinned supports are already free to rotate, how should I define their releases? Do I need to specify releases for these members, and if so, what should they be? Although I'm designing a 2D truss, the library requires defining parameters for the third dimension. I'm not sure how to appropriately set the releases and other parameters for the third dimension. Could someone provide guidance on how to handle this?
I appreciate any guidance you can provide on these issues. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions