I need a code of opensees python for 3d structure for IDA analysis please introduce a good source for this.
1)Install python
2)Install OpenSeesPy package
pip install openseespy
import openseespy.opensees as ops
import numpy as np
import matplotlib.pyplot as plt
# Function to define the 3D structure
def define_structure():
ops.model('basic', '-ndm', 3, '-ndf', 6)
# Define nodes
ops.node(1, 0.0, 0.0, 0.0)
ops.node(2, 0.0, 0.0, 3.0)
ops.node(3, 4.0, 0.0, 0.0)
ops.node(4, 4.0, 0.0, 3.0)
# Define fixities
ops.fix(1, 1, 1, 1, 1, 1, 1)
ops.fix(3, 1, 1, 1, 1, 1, 1)
# Define materials
ops.uniaxialMaterial('Elastic', 1, 3000.0)
# Define elements
ops.element('truss', 1, 1, 2, 10.0, 1)
ops.element('truss', 2, 3, 4, 10.0, 1)
ops.element('truss', 3, 2, 4, 10.0, 1)
ops.element('truss', 4, 1, 3, 10.0, 1)
def perform_ida(ground_motion_file, dt, scale_factors):
# Time series and pattern for ground motion
ops.timeSeries('Path', 1, '-filePath', ground_motion_file, '-dt', dt, '-factor', 1.0)
ops.pattern('UniformExcitation', 1, 1, '-accel', 1)
# Define recorder
ops.recorder('Node', '-file', 'disp.out', '-time', '-node', 4, '-dof', 1, 'disp')
# Run IDA for different scale factors
displacements = []
for scale in scale_factors:
ops.timeSeries('Path', 1, '-filePath', ground_motion_file, '-dt', dt, '-factor', scale)
ops.wipeAnalysis()
ops.system('BandGeneral')
ops.numberer('Plain')
ops.constraints('Transformation')
ops.integrator('Newmark', 0.5, 0.25)
ops.algorithm('Newton')
ops.analysis('Transient')
ops.analyze(int(ground_motion_duration/dt), dt)
disp = ops.nodeDisp(4, 1)
displacements.append(disp)
ops.remove('loadPattern', 1)
return displacements
# Main code
define_structure()
ground_motion_file = 'path/to/ground_motion.txt'
dt = 0.01
ground_motion_duration = 20.0 # duration of ground motion in seconds
scale_factors = np.linspace(0.1, 2.0, 20) # scale factors from 0.1 to 2.0
displacements = perform_ida(ground_motion_file, dt, scale_factors)
# Plot the IDA curve
plt.plot(scale_factors, displacements)
plt.xlabel('Scale Factor')
plt.ylabel('Peak Displacement (m)')
plt.title('IDA Curve')
plt.grid(True)
plt.show()
Mobin Saleh
I was wondering: in common DFT (or Hartree-Fock) algorithms/codes, and in particular in solving the Roothan equation, what is the most computationally expensive part: 1- evaluate all the terms of...
01 February 2021 396 2 View
Dear colleagues, I am new to R, I have been using Amos for conducting CFA but came to learn that when dealing with Likert scale, Lavaan in R is a better tool to do such analysis. I started using...
30 December 2020 5,608 3 View
i prepare protein nanoparticles. in one of my synthesis i use trifle amount of crosslinker and the nanoparticles stick in the bottom of plate. how can i understand that nanoparticles become...
03 December 2020 559 8 View
During a severe accident in a nuclear reactor an energetic molten fuel/coolant interaction could happen, where a multiphase flow of a steam-water mixture in a region which contain drops of a...
29 November 2020 8,376 2 View
I started by a model using 3D PLAXIS to study the effect of deep excavations on existing buildings. The building was simulated as a surface plate with a surface load. Now I'm trying to do it as a...
29 November 2020 3,198 4 View
I want to apply different forces for every node. These force values are saved in .txt or .csv file. Can anybody help me to do that using APDL command. I attached Ansys input file for my model and...
15 November 2020 2,883 1 View
I would like to find off target sites for my sgRNA, however the more commonly used off target finders do not include apis meliifera, is there an application or website that would allow me to do...
09 November 2020 3,463 1 View
Powder insoluble
08 November 2020 509 3 View
All input files with bravais lattice that contains an angle doesnt run in my Quantum espresso. i even tried running them in my friends laptop but the crash file displays the same problem. i hope...
03 November 2020 2,722 1 View
Hi everybody I generated mass matrix by Abaqus, but it has nonzero off diagonal values. I need to get lumped mass matrix with nonzero values only at the diagonal. In Ansys I can turn Lump on...
28 October 2020 5,960 4 View
Hello all, In SPSS I am going to code 2 open-ended questions. I have already read all the answers and I made a list of the most important categories to which I can code the answers. This question...
02 March 2021 1,757 4 View
Hi, I am trying to construct a multi-layer fibril structure from a single layer in PyMol by translating the layer along the fibril axis. For now, I am able to use the Translate command in PyMol...
02 March 2021 4,569 4 View
I want to do a parameter study of a aixsymmetric cylinder in Abaqus. I want to create several jobs where I get the stresses for 3 different points in my model. These points are defined. I wrote a...
01 March 2021 10,078 1 View
Which is suitable for use with Python? MySQL or SQL Server? What is your suggestion?
01 March 2021 3,422 3 View
The following code (see 1st 2 images attached) is used to produce PID controller values that are designed to control the system (G). The code finds the PID controller values (noted as k) by using...
28 February 2021 6,560 14 View
Please, if Gaussian Parameter optimization is possible in this code structure
28 February 2021 278 3 View
I wanted to add an extra parameter to the existing Johnson cook equation in the ABAQUS simulation. How to add those extra parameters. Ref: A modified Johnson-Cook material model with strain...
28 February 2021 4,841 3 View
I am working on modeling and simulation of biomecanical material behaviour, I have succeded on simulating skin using anisotropic hyperelastic material, on APDL and in our lab's finite element...
28 February 2021 552 3 View
System Description Cuda 11.2 GeForce GTX 1080ti tensorflow version 2.4.1 keras version 2.2.0 python version 3.8 I was getting the below error when I try to run my code on the...
25 February 2021 6,673 2 View
I'm in the process of doing a meta-analysis and have encountered some problems with the RCT data. One of my outcom is muscle strength. In one study, I have three different measurements of muscle...
25 February 2021 7,603 3 View