How can I get the internal forces, forces, reaction and displacement? #59
Answered
by
adtzlr
Martin15135215
asked this question in
Q&A
-
Currently, I have this code with units mm and N:
|
Beta Was this translation helpful? Give feedback.
Answered by
adtzlr
Nov 9, 2023
Replies: 2 comments 1 reply
-
Hi Martin, sorry that the examples in the docs aren't clear enough. Unfortunately, my free time is very limited right now and it will take me a few days to answer your question. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please have a look at the comments in the code-block: 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 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Martin15135215
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please have a look at the comments in the code-block: