You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement Tangent Stiffness Matrix as function of elemental cross-section areas #13
Okay, here is a tutorial how to achieve this with the current code of TrussPy (please update TrussPy via pip first):
Create a Model
In a first step we have to create the Model and set the maximum allowed increments to 1 (0 is not possible in TrussPy). We call this function create_model.
In a second step we create a function which uses a list of elemental areas as its argument, runs the model and returns the stiffness matrix for the initial increment of zero deformation (may be adapted to your needs). Finally a reduced stiffness matrix for all active degree of freedoms (Kred) is returned. This may also be changed to the whole system stiffness matrix (K) or the one which is used by TrussPy (Kmod). See the documentation for further informations about Kmod.
defstiffness(list_of_areas):
'''Calculate the stiffness matrix as a function of elemental cross-section areas (passed as list).'''M=create_model()
M.Elements.assign_geometries('all', list_of_areas)
M.build()
M.run()
R0=M.Results.R[0]
# return K (full system), Kred (only active DOF) # or Kmod (see Documentation)returnR0.Kred
Now we have a function which evaluates the stiffness matrix based on a list of elemental areas.
Activity
adtzlr commentedon Jun 1, 2020
Okay, here is a tutorial how to achieve this with the current code of TrussPy (please update TrussPy via pip first):
Create a Model
In a first step we have to create the Model and set the maximum allowed increments to 1 (0 is not possible in TrussPy). We call this function
create_model.Function for stiffness evaluation
In a second step we create a function which uses a list of elemental areas as its argument, runs the model and returns the stiffness matrix for the initial increment of zero deformation (may be adapted to your needs). Finally a reduced stiffness matrix for all active degree of freedoms (
Kred) is returned. This may also be changed to the whole system stiffness matrix (K) or the one which is used by TrussPy (Kmod). See the documentation for further informations aboutKmod.Now we have a function which evaluates the stiffness matrix based on a list of elemental areas.
Code snippet inside a script
Have fun!
adtzlr commentedon Jun 1, 2020
@Giannis1993 please have a look - hope that helps!