Potential bug with the coordinate orientation?
Describe the bug When performing a L frame test, the node displacement at N3 X return positive value
To Reproduce Test file:
# pynite_L_frame_test.py
import numpy as np
from Pynite import FEModel3D
# --- 1. Define Model and Properties ---
E = 200e9
G = 76923076923.07692
L = 5.0
A = 0.01
Iy = 1e-4
Iz = Iy # Symmetrical pipe
J = 2*Iy
# Create a new FEA model
L_Frame = FEModel3D()
# --- 2. Define Nodes ---
L_Frame.add_node('N1', 0, 0, 0)
L_Frame.add_node('N2', 0, 0, L)
L_Frame.add_node('N3', L, 0, L)
# --- 3. Define Supports ---
# Fixed support at N1
L_Frame.def_support('N1', True, True, True, True, True, True)
# --- 4. Define Members ---
L_Frame.add_section('MySection', A, Iy, Iz, J)
L_Frame.add_material('Steel', E, G, nu=0.3, rho=7850)
L_Frame.add_member('M_col', 'N1', 'N2', 'Steel', 'MySection')
L_Frame.add_member('M_beam', 'N2', 'N3', 'Steel', 'MySection')
# --- 5. Define Loads ---
# Add a nodal load at N3
L_Frame.add_node_load('N3', 'FZ', -10000, case='L')
# --- 6. Define a Load Combination ---
L_Frame.add_load_combo('LC1', {'L': 1.0})
# --- 7. Analyze ---
L_Frame.analyze(check_stability=False, sparse=False)
# --- 8. Get and Print Results ---
# Get displacements at Node N3 for the load combination 'LC1'
d_N3 = L_Frame.nodes['N3'].DX['LC1']
dz_N3 = L_Frame.nodes['N3'].DZ['LC1']
# Get reactions at Node N1 for the load combination 'LC1'
R_N1 = L_Frame.nodes['N1'].RxnMY['LC1']
Rz_N1 = L_Frame.nodes['N1'].RxnFZ['LC1']
print("--- PyNiteFEA Verification Results ---")
print(f"Calculated N3 X-Deflection: {d_N3:.6f} m")
print(f"Calculated N3 Z-Deflection: {dz_N3:.6f} m")
print(f"Calculated N1 FZ-Reaction: {Rz_N1:.3f} N")
print(f"Calculated N1 MY-Reaction: {R_N1:.3f} Nm")
print(f"PyNite Code DX: {d_N3:.6f} m")
Expected behavior d_N3 is expected to DX: -0.031250 m
Hi Craig, just would like to double check the sign for internal forces in pynite is still defined as shown in below? When calling member.axial for example, I should get internal force for the axial load and I should get tension in positive?
@roger1017
Here is my plot of your model using my pynite_plotly visualization tool:
Based on this, it seems that the +dx makes sense.
One thing to note in Pynite is that the Z-axis is in/out of the screen (instead of up/down on the screen), with +ve Z being into the screen. This makes the Y-axis the gravity direction. In my plot, I had to rotate the model to show it in this orientation (which would be like looking at the model in plan).
My interpretation of the local force diagram is that compression would be +ve (since it is an axial force in the +ve direction of Fx). I checked the axial force in "M_col" in your model and it also shows +ve, which is what I would expect.
@roger1017 Compression is positive in Pynite. I think you are confusing internal and external loads. An external load applied at the i-node in the +X direction requires an internal load in the -X direction at any subsequent cross-section to be in equilibrium, and vis versa.
Perhaps an easier way to think of it: If I have a vertical column (i-node at the base, j-node at the top) loaded externally by gravity with its own self weight, the load is in the column's -X direction, but it takes an internal force in the member's +X direction to provide equilibrium if I cut a free body at a cross-section mid-height. Thus our column is in compression when the internal forces are positive, even though the external loads are negative. Actions and reactions: equal and opposite.