Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eleResponse with "localForce" returns wrong values #289

Closed
em812 opened this issue May 24, 2023 · 3 comments
Closed

eleResponse with "localForce" returns wrong values #289

em812 opened this issue May 24, 2023 · 3 comments

Comments

@em812
Copy link

em812 commented May 24, 2023

Opensees verison == 3.3.0.0
Issue tested with beam column elements.

When eleReponse is called with the "localForce" argument, it returns the local forces at the previous time step (not at the current time).

On the contrary, when eleResponse is called with "force" or "globalForce", it returns the correct forces at the current time.

Note that if the response of an element in the global system is obtained with "force" or "globalForce" first and then "localForce" is requested, this returns the correct local forces at the current time step of the analysis.

Please see the code snippet below as an example:

import openseespy.opensees as ops
import numpy as np

# %%
# SET UP ----------------------------------------------------------------------------
ops.wipe()						       # clear opensees model
ops.model('basic', '-ndm', 3, '-ndf', 6)	       # 2 dimensions, 3 dof per node
# file mkdir data 				   # create data directory

# define GEOMETRY -------------------------------------------------------------
# nodal coordinates:
ops.node(1, 0., 0., 0.)				   # node#, X Y
ops.node(2, 0., 0., 0.5)
ops.node(3, 0., 0., 1.)

# Single point constraints -- Boundary Conditions
ops.fix(1, 1, 1, 1, 1, 1, 1) 			           # node DX DY RZ

# Define ELEMENTS ------------------------------------------------------
# define geometric transformation: performs a linear geometric transformation of beam stiffness and resisting force from the basic system to the global-coordinate system
ops.geomTransf('Linear', 1, *[0, 1, 0])  		       # associate a tag to transformation

# connectivity:
# eleTag, *eleNodes, E_mod, G_mod, Area, Iz, Jxx, Iy, Iz, Avy, Avz, transfTag
D = 1
t = 0.10
Area = np.pi / 4 * (D ** 2 -  (D - 2* t) ** 2)
Iz = np.pi * (D ** 4 - (D - 2 * t) ** 4) / 64
Jxx = 2 * Iz
Iy = Iz
Avy = 0.01555194137
Avz = Avy
E = 2.1e11
G = E / (2 * (1 + 0.3))

ops.element('ElasticTimoshenkoBeam', 1, 1, 2, E, G, Area, Jxx, Iy, Iz, Avy, Avz, 1)
ops.element('ElasticTimoshenkoBeam', 2, 2, 3, E, G, Area, Jxx, Iy, Iz, Avy, Avz, 1)

# %%
# # define loads-------------------------------------------------
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1,)
ops.load(2, -2000., 0., 0.,0,0,0)

ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.algorithm('Linear')
ops.integrator('LoadControl', 0.5)
ops.analysis('Static')
ops.analyze(2)

response = {}
response["eleResponse_localForce"] = ops.eleResponse(1, "localForce")
response["eleResponse_globalForce"] = ops.eleResponse(1, "globalForce")
response["eleResponse_forces"]=ops.eleResponse(1, "force")
response["eleForce"] = ops.eleForce(1)
response["eleResponse_localForce_atTheEnd"] = ops.eleResponse(1, "localForce")

for key,value in response.items():
    print(f"{key} : {value}")

@mhscott
Copy link
Collaborator

mhscott commented May 24, 2023

Not the issue, but please upgrade your openseespy!

Can you try with algorithm Newton instead of Linear?

@em812
Copy link
Author

em812 commented May 24, 2023

Many thanks for the quick response.

Indeed when using Newton I do not have the same issue. What is the source of this problem? Would you recommend against using the Linear algorithm?

@mhscott
Copy link
Collaborator

mhscott commented Jun 7, 2023

Generally, yes, I would not use the Linear algorithm

@mhscott mhscott closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants