utilidades module

opseestools.utilidades.BuildISection(secID, matID, d, tw, bf, tf, nfdw, nftw, nfbf, nftf)

Generates an I-shaped fiber section

Parameters:
  • secID (int) – ID of the section to be created.

  • matID (int) – ID of the material of the section.

  • d (float) – section height.

  • tw (float) – section web width.

  • bf (float) – section flange width.

  • tf (float) – section flange height.

  • nfdw (float) – number of fibers along the web height.

  • nftw (float) – number of fibers along the web width.

  • nfbf (float) – number of fibers along the flange width.

  • nftf (float) – number of fibers along the flange height.

Return type:

.

opseestools.utilidades.BuildRCCircSection(ID, radius, cover, nbars, abar, coreID, coverID, steelID, GJ=1000000.0)
opseestools.utilidades.BuildRCSection(ID, HSec, BSec, coverH, coverB, coreID, coverID, steelID, numBarsTop, barAreaTop, numBarsBot, barAreaBot, numBarsIntTot, barAreaInt, nfCoreY, nfCoreZ, nfCoverY, nfCoverZ, GJ=1000000.0)
Define a procedure which generates a rectangular reinforced concrete section with one layer of steel at the top & bottom, skin reinforcement and a confined core.

Original TCL version by: Silvia Mazzoni, 2006, adapted from Michael H. Scott, 2003

Parameters:
  • ID (int) – unique ID for the section.

  • HSec (float) – depth of section, along local-y axis.

  • BSec (float) – width of section, along local-z axis.

  • coverH (float) – cover along the section height.

  • coverB (float) – cover along the section width.

  • coreID (int) – material tag for the core patch.

  • coverID (int) – material tag for the cover patches.

  • steelID (int) – material tag for the reinforcing steel.

  • numBarsTop (int) – DESCRIPTION.

  • barAreaTop (float) – cross-sectional area of each reinforcing bar in top layer

  • numBarsBot (int) – number of reinforcing bars in the bottom layer

  • barAreaBot (float) – cross-sectional area of each reinforcing bar in bottom layer

  • numBarsIntTot (int) – TOTAL number of reinforcing bars on the intermediate layers, symmetric about z axis and 2 bars per layer– needs to be an even integer

  • barAreaInt (float) – cross-sectional area of each reinforcing bar in intermediate layer

  • nfCoreY (int) – number of fibers in the core patch in the y direction

  • nfCoreZ (int) – number of fibers in the core patch in the z direction

  • nfCoverY (int) – number of fibers in the cover patches with long sides in the y direction

  • nfCoverZ (int) – number of fibers in the cover patches with long sides in the z direction

Return type:

Section defined in your model

opseestools.utilidades.EAF(t, a)

Calculates the fourier spectrum of a signal

Parameters:
  • t (numpy array) – array with the time of the ground motion.

  • a (numpy array) – array with the ground motion acceleration.

Returns:

  • T (numpy array) – array with the periods.

  • A (numpy array) – array with the fourier amplitud.

opseestools.utilidades.MomentCurvature(secTag, axialLoad, maxK, numIncr=300)

The original script is available in the OpenSees Wiki. Cumputes the moment curvature of a section

Parameters:
  • secTag (int) – tag of the section.

  • axialLoad (float) – applied axial load.

  • maxK (float) – max curvature.

  • numIncr (int, optional) – number of steps for the calculation. The default is 300.

Returns:

  • M (list) – moments of the section.

  • curv (list) – curvature.

opseestools.utilidades.Sa_avg(T, Sa, T2=numpy.linspace)

Calculates the average spectral acceleration for a record

Parameters:
  • T (numpy array) – Period range of the spectrum of the record.

  • Sa (numpy array) – pseudo-acceleration of the record.

  • T2 (numpy array, optional) – Period range to calculate the Sa average. The default is np.linspace(0.02,3,299).

Returns:

  • T2 (numpy array) – Period range to calculate the Sa average.

  • sa_avg (numpy array) – average pseudo-acceleration of the record..

opseestools.utilidades.apply_diaphragms(floor_diaphragms, output=0)
opseestools.utilidades.coefmander(Rmin, Rmax)

Function that returns the effective k for a confined section based on Mander model

Parameters:
  • Rmin (float) – Minimum effective confined ratio.

  • Rmax (float) – Maximum effective confined ratio..

Returns:

k – Mander k to calculate k*fc confined concrete strength.

Return type:

float

opseestools.utilidades.col_materials(fcn=28, fy=420, detailing='DES', tension='tension', steeltag=100, unctag=102, conftag=101, nps=4)

Generates materials for concrete and steel. The concrete has regularization applied and generates both, unconfined and confined concrete. Steel is defined based on the Dhakal and Maekawa model accounting for buckling and low-cycle fatigue

Parameters:
  • zone (String, optional) – Detailing level. By default it is special detailing. User can input ‘DMO’ for an intermediate detailing of Colombian design code.

  • fy (Float, optional) – Steel yielding stress in MPa. The default is 420.

  • fcn (Float, optional) – Concrete compressive stress in MPa. The default is 28.

  • tension (String, optional) – String to define if concrete has tension capacity. The default is ‘tension’. Use no to ignore tension

  • steeltag (Integer, optional) – Tag of the steel material. The default is 100.

  • unctag (Integer, optional) – Tag of the unconfined concrete material. The default is 102.

  • conftag (Integer, optional) – Tag of the confined concrete material. The default is 101.

  • nps (Integer, optional) – Number of points of the Hysteretic material for the steel. The default is 4. Can use 3 too.

Returns:

List with the material tags for the unconfined concrete, confined concrete and reinforcement steel.

Return type:

list

opseestools.utilidades.create_circ_RC_section(ID, radius, cover, nbars, abar, coreID, coverID, steelID, pint=5)
opseestools.utilidades.create_elements(coordx, coordy, coltag, beamtag, dia=1)

Function to create columns and beam elements. By default it uses one column and one beam.

Parameters:
  • coordx (list) – coordinates in X direction. Must have been used before in the creategrid() command.

  • coordy (list) – coordinates in Y direction. Must have been used before in the creategrid() command.

  • coltag (integer) – tag of the columns.

  • beamtag (integer) – tag of the beams.

  • dia (integer, optional) – Use 1 if you want a rigid diaphragm, any number if you don’t. The default is 1.

Returns:

  • TagColumns (list) – list with the tags of the columns.

  • TagVigas (list) – list with the tags of the beams.

opseestools.utilidades.create_elements2(coordx, coordy, coltag, beamtag, output=0)

Function to create columns and beam elements. By default it uses one column and one beam.

Parameters:
  • coordx (list) – coordinates in X direction. Must have been used before in the creategrid() command.

  • coordy (list) – coordinates in Y direction. Must have been used before in the creategrid() command.

  • coltag (integer) – tag of the columns.

  • beamtag (integer) – tag of the beams.

  • dia (integer, optional) – Use 1 if you want a rigid diaphragm, any number if you don’t. The default is 1.

Returns:

  • TagColumns (list) – list with the tags of the columns.

  • TagVigas (list) – list with the tags of the beams.

opseestools.utilidades.create_elements3D(coordx, coordy, coordz, coltag, beamtagX, beamtagY, dia=1)

Function to create columns and beam elements. By default it uses one column and one beam.

Parameters:
  • coordx (list) – coordinates in X direction. Must have been used before in the creategrid() command.

  • coordy (list) – coordinates in Y direction. Must have been used before in the creategrid() command.

  • coordZ (list) – coordinates in Z direction. Must have been used before in the creategrid() command

  • coltag (integer or list) – tag of the columns. IF the user inputs a list, it must be one column section per floor

  • beamtagX (integer) – tag of the beams in X direction.

  • beamtagY (integer) – tag of the beams in X direction.

Returns:

  • TagColumns (list) – list with the tags of the columns.

  • TagVigasX (list) – list with the tags of the beams in the X direction.

  • TagVigasY (list) – list with the tags of the beams in the Y direction.

opseestools.utilidades.create_elements3D2(coordx, coordy, coordz, coltag, beamtagX, beamtagY, dia=1)

Function to create columns and beam elements. By default it uses one column and one beam.

Parameters:
  • coordx (list) – coordinates in X direction. Must have been used before in the creategrid() command.

  • coordy (list) – coordinates in Y direction. Must have been used before in the creategrid() command.

  • coordZ (list) – coordinates in Z direction. Must have been used before in the creategrid() command

  • coltag (integer or list) – tag of the columns. IF the user inputs a list, it must be one column section per floor

  • beamtagX (integer) – tag of the beams in X direction.

  • beamtagY (integer) – tag of the beams in X direction.

Returns:

  • TagColumns (list) – list with the tags of the columns.

  • TagVigasX (list) – list with the tags of the beams in the X direction.

  • TagVigasY (list) – list with the tags of the beams in the Y direction.

opseestools.utilidades.create_rect_RC_section(ID, HSec, BSec, cover, coreID, coverID, steelID, numBarsTop, barAreaTop, numBarsBot, barAreaBot, numBarsIntTot=2, barAreaInt=1e-10, pint=5)
opseestools.utilidades.create_slabs(coordx, coordy, coordz, hslab, Eslab, pois, seclosa=12345, dens=0.0, starttag=0)

create_slabs create a solid slab in the area of the model specified by the coordinates. It uses an ElasticMembratePlateSection formulation and the Shell DKGQ.

Parameters:
  • coordx (list) – DESCRIPTION.

  • coordy (list) – DESCRIPTION.

  • coordz (list) – DESCRIPTION.

  • hslab (float) – slab height.

  • Eslab (float) – modulus of elasticity of the slab material.

  • pois (float) – poisson ratio.

  • seclosa (integer, optional) – tag for the slab section. The default is 12345 tro avoid conflicts with other tags.

  • dens (float, optional) – Density of the slab. The default is 0.0.

  • starttag (integer, optional) – Integer to use to start in another numbering scheme. Useful when you want to call the function several times. You enter the last integer of the previous call and it works.

Returns:

slabtags – List with the tags of the slabs

Return type:

list

opseestools.utilidades.create_slabs_NL(coordx, coordy, coordz, hslab, Eslab, pois, seclosa=12345, dens=0.0, starttag=0)

create_slabs create a solid slab in the area of the model specified by the coordinates. It uses an LayeredShell formulation for the section and the Shell DKGQ.

Parameters:
  • coordx (list) – DESCRIPTION.

  • coordy (list) – DESCRIPTION.

  • coordz (list) – DESCRIPTION.

  • hslab (float) – slab height.

  • Eslab (float) – modulus of elasticity of the slab material.

  • pois (float) – poisson ratio.

  • seclosa (integer, optional) – tag for the slab section. The default is 12345 to avoid conflicts with other tags.

  • dens (float, optional) – Density of the slab. The default is 0.0.

  • starttag (integer, optional) – Integer to use to start in another numbering scheme. Useful when you want to call the function several times. You enter the last integer of the previous call and it works.

Returns:

slabtags – List with the tags of the slabs

Return type:

list

opseestools.utilidades.creategrid(xloc, yloc)

Function that creates a rectangular 2D grid based on specified x and y coordinates

Parameters:
  • xloc (list) – List with the x coordinates.

  • yloc (list) – List with the y coordinates.

Return type:

None.

opseestools.utilidades.creategrid3D(xloc, yloc, zloc, dia=1, floor_mass=[1.0])

Creates a three-dimensional grid of points.

Parameters:
  • xloc (list) – List of X coordinates.

  • yloc (list) – List of Y coordinates.

  • zloc (list) – List of Z coordinates.

  • dia (int, optional) – DESCRIPTION. The default is 1. Change to 0 for no creating a diaphragm.

  • floor_mass (list, optional) – List with the masses per floor starting from the first floor to the roof. It must have one less than zloc.

  • floor_inertia (list, optional) – List with the inertia per floor starting from the first floor to the roof. It must have one less than zloc.

Returns:

df – Dataframe with the information of the created points.

Return type:

Dataframe

opseestools.utilidades.cumAI(tiempo, sismo1, plot=1, cum=[0.05, 0.95])
Parameters:
  • tiempo (time of the seismic record)

  • sismo1 (history of accelerations)

  • plot (optional) – Select 1 if you want the plot. The default is 1.

  • cum (optional) – Range of the . The default is [0.05,0.95].

Returns:

  • a2 (cumulative of the arias intensity.)

  • t1 (start and end time where the record is between the percentages specified in cum.)

opseestools.utilidades.dackal(Fyy, Fuu, eyy, ehh, euu, Lb, Db)
opseestools.utilidades.dhakal(Fyy, Fuu, eyy, ehh, euu, Lb, Db)
opseestools.utilidades.e20Lobatto(Gfc, Lel, npint, fc, E, e0)

Calculates the ultimate strain for a concrete material applying regularization based on the constant fracture energy proposed by Coleman and Spacone

Parameters:
  • Gfc (float) – facture energy in N/mm.

  • Lel (float) – element length.

  • npint (int) – number of integration points.

  • fc (float) – concrete compressive strength in MPa.

  • E (float) – concrete modulus of elasticity strength in MPa..

  • e0 (float) – strain associated to fc.

Returns:

e20 – ultimate strain corresponding to 0.2fc according to Coleman and Spacone.

Return type:

float

opseestools.utilidades.e20Lobatto2(Gfc, Lel, npint, fc, E, e0)

Calculates the ultimate strain for a concrete material applying regularization based on the constant fracture energy proposed by Coleman and Spacone

Parameters:
  • Gfc (float) – facture energy in N/mm.

  • Lel (float) – element length.

  • npint (int) – number of integration points.

  • fc (float) – concrete compressive strength in MPa.

  • E (float) – concrete modulus of elasticity strength in MPa..

  • e0 (float) – strain associated to fc.

Returns:

e20 – ultimate strain corresponding to 0.2fc according to Coleman and Spacone.

Return type:

float

opseestools.utilidades.espectroNSR(Aa, Av, Fa, Fv, I)

Creates the design spectrum per the Colombian NSR-10

Parameters:
  • Aa (Float) – Aa per NSR-10.

  • Av (Float) – Av per NSR-10.

  • Fa (Float) – Fa per NSR-10.

  • Fv (Float) – Fv per NSR-10.

  • I (Float) – I per NSR-10.

Returns:

  • T (Numpy Array) – Array with the periods.

  • Sa (Numpy Array) – Array with pseudo-acceleration.

opseestools.utilidades.find_leftmost_nodes(coordy)
opseestools.utilidades.kge(pred, obs)

Calculates the Kling-Gupta efficienty index

Parameters:
  • pred (numpy array) – time series predicted by the numerical model

  • obs (numpy array) – observed time series (for instance, experimental test).

Returns:

kge – Kling-Gupta index.

Return type:

float

opseestools.utilidades.load_beams(floor_load, roof_load, tagbeams, tag=1)

Loads the beams of the model

Parameters:
  • floor_load (float.) – Load for the beam at floor levels. Negative values are in gravity direction

  • roof_load (float) – Load for the beam at floor levels. Negative values are in gravity direction

  • tagbeams (list) – tags of the beams. If you want it to work properly use the same tags generated by the create_elements function.

  • tag (integer, optional) – Integer to assign to the tag of the load pattern. The default is 1.

Return type:

None.

opseestools.utilidades.load_beams2(beam_loads, tagbeams, tag=1, output=0)

Loads the beams of the model

Parameters:
  • beam_loads (list.) – values of the loads

  • tagbeams (list) – tags of the beams. If you want it to work properly use the same tags generated by the create_elements function.

  • tag (integer, optional) – Integer to assign to the tag of the load pattern. The default is 1.

Return type:

None.

opseestools.utilidades.load_beams3D(floor_load_x, roof_load_x, floor_load_y, roof_load_y, tagbeamsX, tagbeamsY, coordx, coordy, tag=1)

Function to add loads to the beams. Inputs for tags must be the ones from the create_elements3D command

Parameters:
  • floor_load_x (float) – Value of the load for floor beams in the X direction. USE NEGATIVE for gravity direction.

  • roof_load_x (float) – Value of the load for roof beams in the X direction. USE NEGATIVE for gravity direction.

  • floor_load_y (float) – Value of the load for floor beams in the Y direction. USE NEGATIVE for gravity direction.

  • roof_load_y (float) – Value of the load for roof beams in the Y direction. USE NEGATIVE for gravity direction.

  • tagbeamsX (list) – tag of beams in the X direction as returned by the create_elements3D command

  • tagbeamsY (TYPE) – DESCRIPTION.

  • coordx (TYPE) – DESCRIPTION.

  • coordy (TYPE) – DESCRIPTION.

  • tag (TYPE, optional) – DESCRIPTION. The default is 1.

Return type:

None.

opseestools.utilidades.mander(b, d, s, rec, dbl, Nb, Nd, de, fc, ec, fyy, Neb, Ned)

Function that calculates the two points (max compression and ultimate) for the confined concrete based on Mander model

Parameters:
  • b (float) – section width.

  • d (float) – section height.

  • s (float) – stirrup spacing.

  • rec (float) – clear distance to stirrups.

  • dbl (float) – diameter of longitudinal bars.

  • Nb (int) – number of longitudinal bars in the width direction at the extremes.

  • Nd (int) – number of longitudinal bars in the height direction at the extremes.

  • de (float) – stirrup diameter.

  • fc (float) – concrete compressive strength.

  • ec (float) – concrete strain at compressive strength.

  • fyy (float) – steel yield stress.

  • Neb (int) – number of stirrups along the width.

  • Ned (int) – number of stirrups along the height.

Returns:

  • ecc (float) – strain at maximum compression for the confined concrete.

  • fcc (float) – stress at maximum compression for the confined concrete.

  • ecu (float) – ultimate strain for the confined concrete.

  • fccu (float) – ultimate stress for the confined concrete.

opseestools.utilidades.newmarkL(T, xi, GM, delta_t, betha=0.25, gamma=0.5, u0=0, v0=0, P0=0)
opseestools.utilidades.newmarkLA(T, xi, GM, delta_t, flag='all', betha=0.25, gamma=0.5, u0=0, v0=0, P0=0)

Calculates the response of a SDOF based on the Newmark method

Parameters:
  • T (Float) – period of SDOF.

  • xi (Float) – percent of critical damping.

  • GM (array) – ground motion acceleration. use consistent units.

  • delta_t (float) – dt of the record.

  • flag (int, optional) – use ‘max’ to obtain maximum values of displacement, velocity and absolute acceleration. The default is ‘all’.

  • betha (float, optional) – Parameter of the Newmark method. The default is 1/4.

  • gamma (float, optional) – Parameter of the Newmark method. The default is 1/2.

  • u0 (float, optional) – Initial displacement. The default is 0.

  • v0 (float, optional) – Initial velocity. The default is 0.

  • P0 (float, optional) – Initial force (m times acceleration). The default is 0.

Returns:

  • TT (array) – time of the record.

  • DD (array) – displacement history.

  • VV (array) – velocity history.

  • AA (array) – acceleration history.

opseestools.utilidades.nse(pred, obs)

Calculates the normalized nash sutcliffe efficiency index

Parameters:
  • pred (numpy array) – time series predicted by the numerical model

  • obs (numpy array) – observed time series (for instance, experimental test).

Returns:

ns – normalized nash-sutcliffe index.

Return type:

float

opseestools.utilidades.plot_Wall_T_BE(matConf, matInco, bW, bF, BEU, BED, BEL, BER, Lww, LwF, nMax, nMin)
opseestools.utilidades.pushover_loads(coordy, tag_pattern=1001, nodes=0)

Generates a pushover pattern proportional to the each floor height. Works in combination with the creategrid command.

Parameters:
  • coordy (List) – List with the y coordinates of the model including the base coordinate

  • tag_pattern (int, optional) – Integer with the pattern tag for the pushover. The default is 1001.

  • nodes (list, optional) – List with the node tags where to create the pushover. The default is 0. If you create the nodes using the creategrid command, you shouldn’t change it.

Return type:

None. It creates the pattern.

opseestools.utilidades.pushover_loads3D(coordz, pushdir='x', tag_pattern=1001, nodes=0)

Generates a pushover pattern proportional to the each floor height. Works in combination with the creategrid3D command.

Parameters:
  • coordz (List) – List with the z coordinates of the model including the base coordinate

  • pushdir (string, optional) – Enter ‘x’ for the X direction (default), ‘y’ for the Y direction

  • tag_pattern (int, optional) – Integer with the pattern tag for the pushover. The default is 1001.

  • nodes (list, optional) – List with the node tags where to create the pushover. The default is 0. If you create the nodes using the creategrid command, you shouldn’t change it.

Return type:

None. It creates the pattern.

opseestools.utilidades.remove_hanging_nodes(tagcols, tagbeams)
opseestools.utilidades.residual_disp(drifts, npts)

Calcula el drift residual de una estructura sometida a un terremoto Recibe dos entradas:

drifts contiene los drifts a lo largo del sismo npts es el número de puntos hasta donde llega el registro

Este algoritmo requiere que se haya corrido un periodo de vibración libre luego del final del registro

opseestools.utilidades.spectrum2(GM, delta_t, xi)

Calculates the spectrum of a function using the Newmark method for solving the SDOF system

Parameters:
  • GM (string) – Name of the .txt file with the record. One point per line.

  • delta_t (float) – time increment of the record.

  • xi (float) – percent of critical damping as float (i.e. use 0.05 for 5%).

Returns:

  • T (TYPE) – DESCRIPTION.

  • Sa (TYPE) – DESCRIPTION.

opseestools.utilidades.spectrum4(GM, dt, xi=0.05, rango=[0.02, 3.0], N=300)

Calculates the Sa spectrum for a record using OpenSees sdfResponse

Parameters:
  • GM (string) – Name of the .txt file with the record (e.g. GM01.txt). One point per line.

  • dt (float) – time increment of the record.

  • xi (float, optional) – percent of critical damping as float (i.e. use 0.05 for 5%). The default is 0.05.

  • rango (list, optional) – range of periods to calculate the spectrum. The default is [0.02,3.0].

  • N (integer, optional) – number of periods to compute in the period range. The default is 300.

Returns:

  • T (array) – periods.

  • Sa (array) – spectral pseudo-acceleration for each period in T.

  • U (array) – spectral displacement for each period in T.

  • A (array) – acceleration for each period in T.

opseestools.utilidades.testMaterial(matTag, displ)
Parameters:
  • matTag (int) – tag of the material.

  • displ (list) – list with the peaks of the displacement cycles.

Returns:

  • Disp (array) – DESCRIPTION.

  • F (TYPE) – DESCRIPTION.