What is the reason for the slightly different result with Stab2D? #60
-
This is the truss example: This is the TrussPy code: import trusspy as tp
M = tp.Model(log=0)
# create nodes
with M.Nodes as MN:
MN.add_node(1, (0, 0, 0)) # mm
MN.add_node(2, (0, 0, 3000)) # mm
MN.add_node(3, (-4000, 0, 3000)) # mm
MN.add_node(4, (-4000, 0, 6000)) # mm
# create element
with M.Elements as ME:
ME.add_element(1, [2, 1])
ME.add_element(2, [2, 3])
ME.add_element(3, [2, 4])
ME.assign_geometry("all", [1000]) # Area mm²
ME.assign_material("all", [1000]) # E-Modulus N/mm²
# create displacement (U) boundary conditions
with M.Boundaries as MB:
MB.add_bound_U(1, (0, 0, 0)) # support
MB.add_bound_U(2, (1, 0, 1)) # smooth pin
MB.add_bound_U(3, (0, 0, 0)) # support
MB.add_bound_U(4, (0, 0, 0)) # support
# create external forces
with M.ExtForces as MF:
MF.add_force(2, (100000, 0, -100000)) # N
# TrussPy is a nonlinear truss analysis - it incrementally searches for the equilbrium
# by scaling given external forces. If you are not interested in the deformation path,
# set the number of increments ``incs`` to one, the allowed increase in displacements to
# infinity or a high value ``du`` and the increase of the load-proportionality-factor
# ``dlpf`` to one.
M.Settings.incs = 1 # evaluate only one increment
M.Settings.du = 1e8 # turn off max. incremental displacement
M.Settings.dlpf = 1 # apply the load proportionality factor in one increment
M.build()
fig, ax = M.plot_model(force_scale=0.01, view="xz")
M.run()
# results of last solution
res = M.Results.R[-1]
# verify the applied load-proportionality-factor of the result
# assert res.lpf == 1.0
# (element) truss forces in N
# see https://trusspy.readthedocs.io/en/latest/theory/truss.html#kinetics
res.element_force
# (nodal) displacements in mm
# see e.g. https://trusspy.readthedocs.io/en/latest/theory/equilibrium.html
res.U
# (nodal) fixing forces in N
# see https://trusspy.readthedocs.io/en/latest/theory/assembly.html
res.r Those are the TrussPy results: Now I build the same truss in Stab2D. This software can be freely downloaded for educational purpose etc.
For example, the x-axis displacement is 10 mm off |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Does this software give you the linearized solution? The code I provided for TrussPy is the nonlinear result, even for one increment, nonlinear geometric exact kinematics are used. The result is obtained by a Newton Rhapson iterative method. The linearized solution could be slightly different (depends on the model). That could be one reason. We could enforce the linear result in TrussPy by setting the tolerance of the equilibrium equations to infinity, which will stop the Newton method after one iteration. I'll have a look later on how to set that parameter. |
Beta Was this translation helpful? Give feedback.
-
Okay, I figured out that the differences in the results are due to effects of nonlinearity. Equal results with Stab2D are obtained only by setting the load-proportionality factor to a very small value in TrussPy. Due to the nonlinear path-following algorithm, extended equilibrium equations are used for the numeric continuation. However, there is no direct access implemented to the linearized solution other than applying very small loads which lead to small displacements and (nearly) no effects of nonlinearity. With
as well as the fixing forces
and the element forces which are all consistent with Stab2D.
FYI: if you are interested in the stiffness matrix for the active degrees of freedom, it is located here
from which the linear solution may be found manually by
Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
I have a question regarding this: Does TrussPy calculate all trusses in the first order theory or second order theory or third order theory or the full nonlinear theory? I don't know which of the theories you mean with “nonlinear result”. Below are the definitions according to IFC.
|
Beta Was this translation helpful? Give feedback.
Okay, I figured out that the differences in the results are due to effects of nonlinearity. Equal results with Stab2D are obtained only by setting the load-proportionality factor to a very small value in TrussPy.
Due to the nonlinear path-following algorithm, extended equilibrium equations are used for the numeric continuation. However, there is no direct access implemented to the linearized solution other than applying very small loads which lead to small displacements and (nearly) no effects of nonlinearity.
With
M.Settings.dlpf = 1e-5
you'll get the displacements