Closed JiaweiChenKodomo closed 5 years ago
I will take a look. Thank you!
Please try a transformation constraint handler
constraints("Transformation")
the plain handler not work for non-homogeneous constraints
Thank you. That solves the problem.
Dear Dr. Zhu, I tried to apply a displacement pattern to one node using the single-point constraint sp(nodeTag, dof, dofValues) command. However, the output I got using the nodeDisp() and the eleForce() commands were all zeros. When I applied a load using the load(nodeTag, loadValues) command, I got what seemed to be a correct result. What is wrong with my use of the single-point constraint command? Thank you so much!
Here is the model:
import sys sys.path.append('E:/OpenseesFile/openseespy/win') from opensees import * import numpy as np import matplotlib.pyplot as plt
# ------------------------------ # Start of model generation # -----------------------------
# set modelbuilder wipe() model('basic', '-ndm', 2, '-ndf', 2)
# variables A = 1.0 Nsteps = 1000 Px = 400.0 Py = 0.0
#material fy=300.0 E0=200000.0 b=0.05 R0=10.0 cR1=0.925 cR2=0.15 params=[R0,cR1,cR2]
# create nodes node(1, 0.0, 1.0) node(2, 1.0, 0.0) node(3, 1.0, 1.0)
# set boundary condition fix(1, 1, 1) fix(2, 1, 1)
# define materials uniaxialMaterial("Steel02", 1, fy, E0, b, *params)
# define elements element("Truss",1,1,3,A,1) element("Truss",2,2,3,A,1)
# create TimeSeries timeSeries("Linear", 1)
# create a plain load pattern pattern("Plain", 1, 1)
# Create the nodal load #load(3, Px, Py) u_ref=1.0 sp(3, 1, u_ref)
# ------------------------------ # Start of analysis generation # ------------------------------
# create SOE system("ProfileSPD")
# create DOF number numberer("Plain")
# create constraint handler constraints("Plain")
# create integrator integrator("LoadControl", 1.0/Nsteps)
# create algorithm algorithm("Newton")
# create test test('NormUnbalance',1e-8, 10)
# create analysis object analysis("Static")
# ------------------------------ # Finally perform the analysis # ------------------------------
# perform the analysis data = np.zeros((Nsteps+1,2)) for j in range(Nsteps): analyze(1) data[j+1,0] = nodeDisp(3,1) data[j+1,1] =-eleForce(1,1)
plt.plot(data[:,0], data[:,1]) plt.xlabel('Horizontal Displacement') plt.ylabel('Horizontal Load') plt.show()