Search found 7 matches

by SaeedT
Sat Aug 26, 2023 3:21 pm
Forum: OpenSeesPy
Topic: Rigid Diaphragm error in modal analysis
Replies: 0
Views: 69882

Rigid Diaphragm error in modal analysis

Hello Everyone,

The following data represents a very simple frame: it consists of 4 columns and 4 beams, with a diagonal stretching from one corner to another horizontally to approximate a diaphragm. The top 4 nodes are restrained against displacement in the Y-direction. When analyzing the frame for its modal response, the analysis proceeds smoothly and provides a reasonable period. However, as soon as I add a rigid diaphragm, the analysis fails to complete.

I'm certain that rigid diaphragms have been used extensively, so I suspect that something is amiss with my data setup, though I can't pinpoint what it is. Any hints to identify the error would be appreciated. Note that I haven't included the standard input for the modal analysis here; you can use any analysis setup you prefer.

Here's the portion of the script without the rigid diaphragm:

Code: Select all

def nodes():
	os.node(27, 0, 0, 215.984, '-mass', 0.237545, 0.237545, 0.237545, 0, 0, 0)
	os.node(25, 0, 360, 215.984, '-mass', 0.298616, 0.298616, 0.298616, 0, 0, 0) 
	os.node(23, 288, 0, 215.984, '-mass', 0.280315, 0.280315, 0.280315, 0, 0, 0) 
	os.node(21, 288, 360, 215.984, '-mass', 0.241083, 0.241083, 0.241083, 0, 0, 0)
	os.node(7, 0, 0, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0) 
	os.node(5, 288, 0, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0)
	os.node(3, 0, 360, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0)
	os.node(1, 288, 360, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0)

def fix_commands():
	os.fix(27, 0, 0, 0, 0, 0, 0)  
	os.fix(25, 0, 0, 0, 0, 0, 0)  
	os.fix(23, 0, 0, 0, 0, 0, 0)  
	os.fix(21, 0, 0, 0, 0, 0, 0)  
	os.fix(7, 1, 1, 1, 0, 0, 0)   
	os.fix(5, 1, 1, 1, 0, 0, 0)  
	os.fix(3, 1, 1, 1, 0, 0, 0)  
	os.fix(1, 1, 1, 1, 0, 0, 0) 

def transformations():
	os.geomTransf('Linear', 1, 0, -1, 0)
	os.geomTransf('Linear', 2, 0, -1, 0)
	os.geomTransf('Linear', 3, -0.78086880944303, -0.624695047554424, 0)
	os.geomTransf('Linear', 4, 1, -0, 0)
	os.geomTransf('Linear', 5, -1, 0, 0)
 
def frame_sections():
# this was a originally a big model but now only a few of the following sections are used in the shortened model.
	os.section('Elastic', 1, 29000, 61.8, 2140, 664, 11154, 64.7, 17.3, 48.6)
	os.section('Elastic', 2, 29000, 32, 1240, 447, 11154, 7.1, 7.5, 25.1)
	os.section('Elastic', 3, 29000, 46.7, 1900, 748, 11154, 19.7, 11.2, 37.1)
	os.section('Elastic', 4, 29000, 56.8, 2400, 931, 11154, 34.8, 13.8, 45.2)
	os.section('Elastic', 5, 29000, 46.3, 3060, 347, 11154, 25.2, 16, 32.5)
	os.section('Elastic', 6, 29000, 13, 843, 21, 11154, 0.8, 7.2, 5.9)
	os.section('Elastic', 7, 29000, 22.4, 2100, 82, 11154, 2.7, 10.5, 12.2)
	os.section('Elastic', 8, 29000, 27.6, 3270, 124, 11154, 4, 13.2, 14.9)
	os.section('Elastic', 9, 29000, 29, 3990, 128, 11154, 3.8, 15.4, 14.1)
	os.section('Elastic', 10, 29000, 26, 534, 179, 11154, 7.5, 6.5, 20.4)
	os.section('Elastic', 11, 29000, 29.3, 623, 207, 11154, 10.9, 7.5, 23.1)
	os.section('Elastic', 12, 29000, 32.9, 716, 236, 11154, 15.1, 8.6, 26)
	os.section('Elastic', 13, 29000, 20.9, 457, 457, 11154, 728, 8.6, 26)

 
def line_elements():
# Format: os.element('elasticBeamColumn', eleTag, *eleNodes, secTag, transfTag, <'-releasey', releaseCode>, <'-releasez', releaseCode>)
	os.element('elasticBeamColumn', 3, 27, 23, 9, 2)  # Story1, B7
	os.element('elasticBeamColumn', 8, 25, 21, 9, 2)  # Story1, B12
	os.element('elasticBeamColumn', 9, 25, 23, 13, 3)  # Story1, B46
	os.element('elasticBeamColumn', 4, 27, 25, 6, 4)  # Story1, B37
	os.element('elasticBeamColumn', 5, 23, 21, 6, 4)  # Story1, B42
	os.element('elasticBeamColumn', 1, 7, 27, 4, 5)  # Story1, C2
	os.element('elasticBeamColumn', 2, 5, 23, 4, 5)  # Story1, C14
	os.element('elasticBeamColumn', 6, 3, 25, 4, 5)  # Story1, C10
	os.element('elasticBeamColumn', 7, 1, 21, 4, 5)  # Story1, C15

And this is the data when the rigid diaphragm is included. Mass definition is taken from Etabs and includes the roational mass for the entire plate.

Code: Select all

def nodes():
	os.node(29, 141.99, 183.717, 216, '-mass', 1.057558, 1.057558, 0, 0, 0, 56175.525) 
	os.node(27, 0, 0, 215.984, '-mass', 0, 0, 0.237545, 0, 0, 0) 
	os.node(25, 0, 360, 215.984, '-mass', 0, 0, 0.298616, 0, 0, 0) 
	os.node(23, 288, 0, 215.984, '-mass', 0, 0, 0.280315, 0, 0, 0) 
	os.node(21, 288, 360, 215.984, '-mass', 0, 0, 0.241083, 0, 0, 0)
	os.node(7, 0, 0, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0) 
	os.node(5, 288, 0, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0)
	os.node(3, 0, 360, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0)
	os.node(1, 288, 360, 0, '-mass', 0.004496, 0.004496, 0.004496, 0, 0, 0) 

def fix_commands():
	os.fix(27, 0, 1, 0, 0, 0, 0)  
	os.fix(25, 0, 1, 0, 0, 0, 0)  
	os.fix(23, 0, 1, 0, 0, 0, 0)  
	os.fix(21, 0, 1, 0, 0, 0, 0) 
	os.fix(7, 1, 1, 1, 0, 0, 0)  
	os.fix(5, 1, 1, 1, 0, 0, 0)  
	os.fix(3, 1, 1, 1, 0, 0, 0)  
	os.fix(1, 1, 1, 1, 0, 0, 0)  

def diaph_fixities():
	os.rigidDiaphragm(3, 29, 21, 23, 25, 27 )
	
def master_node_fixities():
	os.fix(29, 0, 0, 1, 1, 1, 0)  
	
def transformations():
	os.geomTransf('Linear', 1, 0, -1, 0)
	os.geomTransf('Linear', 2, 0, -1, 0)
	os.geomTransf('Linear', 3, -0.78086880944303, -0.624695047554424, 0)
	os.geomTransf('Linear', 4, 1, -0, 0)
	os.geomTransf('Linear', 5, -1, 0, 0)
def frame_sections():
	os.section('Elastic', 1, 29000, 61.8, 2140, 664, 11154, 64.7, 17.3, 48.6)
	os.section('Elastic', 2, 29000, 32, 1240, 447, 11154, 7.1, 7.5, 25.1)
	os.section('Elastic', 3, 29000, 46.7, 1900, 748, 11154, 19.7, 11.2, 37.1)
	os.section('Elastic', 4, 29000, 56.8, 2400, 931, 11154, 34.8, 13.8, 45.2)
	os.section('Elastic', 5, 29000, 46.3, 3060, 347, 11154, 25.2, 16, 32.5)
	os.section('Elastic', 6, 29000, 13, 843, 21, 11154, 0.8, 7.2, 5.9)
	os.section('Elastic', 7, 29000, 22.4, 2100, 82, 11154, 2.7, 10.5, 12.2)
	os.section('Elastic', 8, 29000, 27.6, 3270, 124, 11154, 4, 13.2, 14.9)
	os.section('Elastic', 9, 29000, 29, 3990, 128, 11154, 3.8, 15.4, 14.1)
	os.section('Elastic', 10, 29000, 26, 534, 179, 11154, 7.5, 6.5, 20.4)
	os.section('Elastic', 11, 29000, 29.3, 623, 207, 11154, 10.9, 7.5, 23.1)
	os.section('Elastic', 12, 29000, 32.9, 716, 236, 11154, 15.1, 8.6, 26)
	os.section('Elastic', 13, 29000, 20.9, 457, 457, 11154, 728, 8.6, 26)
	
def line_elements():
	os.element('elasticBeamColumn', 3, 27, 23, 9, 2) 
	os.element('elasticBeamColumn', 8, 25, 21, 9, 2)  
	os.element('elasticBeamColumn', 9, 25, 23, 13, 3)  
	os.element('elasticBeamColumn', 4, 27, 25, 6, 4)  
	os.element('elasticBeamColumn', 5, 23, 21, 6, 4) 
	os.element('elasticBeamColumn', 1, 7, 27, 4, 5)  
	os.element('elasticBeamColumn', 2, 5, 23, 4, 5) 
	os.element('elasticBeamColumn', 6, 3, 25, 4, 5)  
	os.element('elasticBeamColumn', 7, 1, 21, 4, 5) 
by SaeedT
Thu Aug 24, 2023 9:50 pm
Forum: OpenSeesPy
Topic: TwoNodeLink: invalid orientation vector error
Replies: 0
Views: 70103

TwoNodeLink: invalid orientation vector error

Hello Everyone,
I have an 'ElasticPP' element assigned to two nodes that makes it perfectly vertical in the Z direction(X and Y coordinates the same but different Z values). I get "invalid orientation vector". There is another similar element that is not perfectly vertical and I don't get this error for it. If it was just a warning, I could ignore it but it kicks out the execution. The model is too big to post here. I may move nodes a bit to go around it but I thought this should be reported.

Thanks,
SaeedT
by SaeedT
Tue Aug 15, 2023 10:52 am
Forum: OpenSeesPy
Topic: Does the cyclic analysis work in python?
Replies: 3
Views: 7711

Re: Does the cyclic analysis work in python?

Thank you for your response.
Then the example must be working as it is. However, there is no unpacking asterisk.
Since the same happens for fiber command where patch commands just follow and the python interpreter relates those based on the order of execution, I assumed the same style has been used for the pattern and the related load commands. This is a bit different from the Tcl syntax.

I will try the SmartAnalyze.py.

As always very helpful and prompt.

Thank you
by SaeedT
Mon Aug 14, 2023 11:44 am
Forum: OpenSeesPy
Topic: Does the cyclic analysis work in python?
Replies: 3
Views: 7711

Does the cyclic analysis work in python?

Hello Everyone,
I was able to run the Pushover analysis example 5, Ex5, in Tcl. However, I couldn't run the example given in OpenSeesPy. Has anyone tried to run this example:
https://openseespydoc.readthedocs.io/en ... tuni2.html

For Pattern command, part of the "Plain Pattern" says: "The command to generate LoadPattern object contains in { } the commands to generate all the loads and the single-point constraints in the pattern."
https://openseespydoc.readthedocs.io/en ... ht=pattern
I couldn't get this but one may think curly braces are required somewhere. Actually if the Python version could mimic the Tcl format that could be the best, however, the example does not include the curly braces. In Tcl the loads associated with the Pattern are placed into {}, but in Python, it is just order of execution that related the loads to the Pattern as I understood. Am I missing something here?

Another related question is about this part of the python code:

Nsteps = int(Dmax/ Dincr)

ok = op.analyze(Nsteps)
print(ok)

# for gravity analysis, load control is fine, 0.1 is the load factor increment (http://opensees.berkeley.edu/wiki/index ... ad_Control)

test = {1:'NormDispIncr', 2: 'RelativeEnergyIncr', 4: 'RelativeNormUnbalance',5: 'RelativeNormDispIncr', 6: 'NormUnbalance'}
algorithm = {1:'KrylovNewton', 2: 'SecantNewton' , 4: 'RaphsonNewton',5: 'PeriodicNewton', 6: 'BFGS', 7: 'Broyden', 8: 'NewtonLineSearch'}

for i in test:
for j in algorithm:

if ok != 0:
if j < 4:
op.algorithm(algorithm[j], '-initial')

else:
op.algorithm(algorithm[j])

op.test(test, Tol, 1000)
ok = op.analyze(Nsteps)
print(test, algorithm[j], ok)
if ok == 0:
break
else:
continue

u2 = op.nodeDisp(2, 1)
print("u2 = ", u2)

Is this based on a common experience in solving cyclic analysis in OpenSees? Do we have to try all of these algorithms to find one that MAY work?
Regardless, can't this code print a trial value that has failed at the end of trials as u2? Maybe we need to move the print under "if ok==0:" before the "break"?

Using Python libraries with OpenSeesPy is a great advantage and I am trying to do all my research with OpenSeesPy.
Thank you for helping with this question.
SaeedT
by SaeedT
Sun Jul 09, 2023 5:40 pm
Forum: OpenSeesPy
Topic: Parametric Optimization
Replies: 0
Views: 69831

Parametric Optimization

As far as I know OpenSees does not include optimization itself. However, it can be used with other python packages. I was wondering if anyone has code example or experience with using different optimization methods in python libraries to share here?
by SaeedT
Sun Jul 09, 2023 5:28 pm
Forum: OpenSeesPy
Topic: Viscous Damper example works in tcl but not in python
Replies: 2
Views: 4660

Re: Viscous Damper example works in tcl but not in python

Thank you for your quick response and valuable information. After upgrading to the latest version of OpenSeesPy, it worked.
by SaeedT
Sat Jul 08, 2023 6:26 pm
Forum: OpenSeesPy
Topic: Viscous Damper example works in tcl but not in python
Replies: 2
Views: 4660

Viscous Damper example works in tcl but not in python

Hello Everyone,
There is tcl viscous damper example provided by OpenSees at: https://opensees.berkeley.edu/wiki/inde ... us_Dampers
Using this code, I prepared a one bay model which is a chevron with one viscous damper mounted on one diagonal only. It worked. Then I converted the data to Python version trying to use OpenSeesPy. Unfortunately, it did not work. I used the same ground motion that is used in the above link, where the viscous damper example in tcl is provided by OpenSees, which is TakY.th. Therefore, I do not include the ground motion file here. I appreciate if the reason for failure can be pointed out. Also, it would be very helpful if a python verification for a viscous damper example could be provided. I have debugged both python and tcl code in VS Code and Komodo IDEs. Since the tcl code works, there is no need to include it here. But the python data is as follows :
# please change the folder address per your system and download the ground motion file, TakY.th in that folder in order to run.)
# The tcl version of this data works to the end. This code fails on the Analyze command with error code: analyze failed, returned: -3 error flag
# The data is originally prepared in Etabs, then converted to OpenSees. The comments on nodes, etc. are related to that and should be ignored here.
import openseespy.opensees as os
import vfo.vfo as vfo
import matplotlib.pyplot as plt
import numpy as np
import math
import os as osw
Model = 'SDOF1'
nModes = 5
plot_node = 61
ele_number = 64
g = 386.2
pi = 3.1415927
E_s = 29000.
v = 0.3 # Poisson's ratio
G_s = float(E_s / 2 / (1 + v)) # Shear modulus

os.wipe()
os.model('basic', '-ndm', 3, '-ndf', 6)
os.node(69, 432, 0, 120, '-mass', 2.184143, 2.184143, 0, 0, 0, 41616.427) # Story Story1, Point 2
os.node(67, 432, 0, 120, '-mass', 0, 0, 0.170248, 0.005, 0.005, 0.005) # Story Story1, Point 4
os.node(65, 288, 0, 120, '-mass', 0, 0, 0.002056, 0, 0, 0) # Story Story1, Point 833
os.node(63, 576, 0, 120, '-mass', 0, 0, 0.002056, 0, 0, 0) # Story Story1, Point 839
os.node(61, 324, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 3
os.node(59, 360, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 14
os.node(57, 396, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 5
os.node(55, 468, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 26
os.node(53, 504, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 19
os.node(51, 540, 0, 120, '-mass', 0, 0, 0.001631, 0, 0, 0) # Story Story1, Point 27
os.node(3, 288, 0, 0, '-mass', 0.001253, 0.001253, 0.001253, 0.005, 0.005, 0.005) # Story Base, Point 833
os.node(1, 576, 0, 0, '-mass', 0.003178, 0.003178, 0.003178, 0, 0, 0) # Story Base, Point 839

os.fix(65, 0, 1, 0, 1, 0, 0) # Story: Story1, Point: 833
os.fix(63, 0, 1, 0, 1, 0, 0) # Story: Story1, Point: 839
os.fix(3, 1, 1, 1, 0, 0, 0) # Story: Base, Point: 833
os.fix(1, 1, 1, 1, 0, 0, 0) # Story: Base, Point: 839

# Story: Story1, Point: 2
os.rigidDiaphragm(3, 69 , 67, 65, 63, 61, 59, 57, 55, 53, 51)

os.fix(69, 0, 1, 1, 1, 1, 0) # Story: Story1, Node: 69

os.geomTransf('Linear', 0, 0, 1, 0)
os.geomTransf('Linear', 1, 0, 1, 0)
os.geomTransf('Linear', 2, 0, -1, 0)
os.geomTransf('Linear', 3, -1, 0, 0)

# os.section('Elastic', secTag, E_mod, A, Iz, Iy, G_mod, Jxx, alphaY=None, alphaZ=None)
os.section('Elastic', 1, 29000, 28.2, 833, 270, 11154, 6.8, 7, 22)
os.section('Elastic', 2, 29000, 113.51, 1526, 4037, 11154, 5884, 94.6, 94.6)
os.section('Elastic', 3, 29000, 61.8, 2140, 664, 11154, 64.7, 17.35, 48.6)

# Format: os.element('elasticBeamColumn', eleTag, *eleNodes, secTag, transfTag, <'-releasey', releaseCode>, <'-releasez', releaseCode>)
os.element('elasticBeamColumn', 3, 1, 67, 3, 1, '-releasez', 3) # Story1, D1
os.element('elasticBeamColumn', 4, 65, 61, 2, 2, '-releasez', 1) # Story1, B43
os.element('elasticBeamColumn', 5, 61, 59, 2, 2) # Story1, B44
os.element('elasticBeamColumn', 6, 59, 57, 2, 2) # Story1, B45
os.element('elasticBeamColumn', 7, 57, 67, 2, 2) # Story1, B46
os.element('elasticBeamColumn', 8, 67, 55, 2, 2) # Story1, B47
os.element('elasticBeamColumn', 9, 55, 53, 2, 2) # Story1, B48
os.element('elasticBeamColumn', 10, 53, 51, 2, 2) # Story1, B49
os.element('elasticBeamColumn', 11, 51, 63, 2, 2) # Story1, B50
os.element('elasticBeamColumn', 1, 3, 65, 3, 3) # Story1, C14
os.element('elasticBeamColumn', 2, 1, 63, 3, 3) # Story1, C20

print("the model is built.")
# render the model after defining all the nodes and elements
vfo.plot_model()

os.constraints('Transformation')
Lambda = os.eigen('-genBandArpack', nModes)
periods = [2 * math.pi / math.sqrt(eigenvalue) for eigenvalue in Lambda]

Omega = Lambda[0] ** 0.5
xDamp = 0.03 # 3% damping ratio
beta_k_comm = 2 * (xDamp / Omega)
os.rayleigh(0.0, 0.0, 0.0, beta_k_comm)
print("Rayleigh damping specified.")
os.uniaxialMaterial('ViscousDamper', 1, 5000, 200, 0.2)
os.element('twoNodeLink', 69, 67, 3, '-mat', 1, '-dir', 1) # K1 in DAMPER

vfo.plot_model()

gmFolder = 'C:\_OpenSees\DRS-SDOF\OpenSeesData'
record = gmFolder + '\\' + "TakY.th"
GM_fact = g
time_series_tag = 100
npts = 4096
dt = 0.01
os.timeSeries('Path', time_series_tag, '-dt', dt, '-filePath', record, '-factor', GM_fact, '-startTime', 0.0)
print("Ground motion loaded:"+record)
GM_direction = 1
pattern_tag = 10
os.pattern('UniformExcitation', pattern_tag, GM_direction, '-accel', time_series_tag)
os.wipeAnalysis()
os.constraints('Transformation')
os.numberer('RCM')
os.system('UmfPack')
os.test('EnergyIncr', 1e-10, 100)
os.algorithm('KrylovNewton')
os.integrator('Newmark', 0.5, 0.25)
os.analysis('Transient')
os.analyze(10*npts, dt/10)

print("done!")
os.wipe()