could not invert flexibility for element with tag: 151

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
Ziad
Posts: 12
Joined: Fri Sep 22, 2023 6:38 am

could not invert flexibility for element with tag: 151

Post by Ziad » Fri Oct 13, 2023 7:21 am

I keep getting this issue and I am unable to solve it.
Please note I have 2 files 1 is called Main_Analysis.py which calls the functions from Model_Functions.py
-------------------------------- Start Main_Analysis.py------------------------------------------
import openseespy.opensees as ops
from Model_Function import *

# ---------------
# Input Variables
# ---------------

ESteel = 200000.0 # Young's Modulus (MPa)
Steel_Tag = 1

# ---------------
# Run Analysis
# ---------------

shellSecTag,beamSecTag1 = GetSections(Steel_Tag,ESteel)
mid, side1, side2 = GetModel(shellSecTag,beamSecTag1)
#GetRecorders()
loads(mid, side1, side2)
RunAnalysis()

-------------------------------- End Main_Analysis.py------------------------------------------


-------------------------------- Start Model_Functions.py------------------------------------------
import numpy as np
import openseespy.opensees as ops
import vfo.vfo as vfo
import math

# ---------------
# Opensees Anaylsis
# ---------------

def GetSections(SMat_Tag,E):
# Remove existing model
ops.wipe()

# Set the default units to metric units
ops.defaultUnits("-force", "N", "-length", "m", "-time", "sec", "-temp", "C")

####################
# Section Tags
####################

shellSecTag = 1
beamSecTag1 = 2

####################
### Steel02 Material
####################

matConnAx=2;
matConnRot=3;

Fy = 420; # Yield stress
Es = E; # Modulus of Elasticity of Steel
v=0.2; # Poisson's ratio
Gs=Es/(1+v); # Shear modulus
b=0.10; # Strain hardening ratio
params=[18.0,0.925,0.15] # R0,cR1,cR2
R0=18.0
cR1=0.925
cR2=0.15
a1=0.05
a2=1.00
a3=0.05
a4=1.0
sigInit=0.0
alpha=0.05

# uniaxialMaterial('Steel02', matTag, Fy, E0, b, *params, a1=a2*Fy/E0, a2=1.0, a3=a4*Fy/E0, a4=1.0, sigInit=0.0)
ops.uniaxialMaterial('Steel02', SMat_Tag, Fy, Es, b, R0, cR1, cR2, a1, a2, a3, a4, sigInit)

#######################
### Concrete02 Material
#######################

####################
# Beam Sections
####################

# section('WFSection2d', secTag, matTag, d, tw, bf, tf, Nfw, Nff)
ops.section('WFSection2d', beamSecTag1, SMat_Tag, 8.2, 0.40, 8.01, 0.650, 15, 15)

####################
# Shell Sections
####################
# secTag E nu h rho
ops.section("ElasticMembranePlateSection", shellSecTag, 3.0E3, 0.25, 1.175, 1.27)

# set modelbuilder
ops.model("BasicBuilder", "-ndm",3, "-ndf",6)

return shellSecTag,beamSecTag1

def GetModel(shellSecTag,beamSecTag1):

A = 169.0
# Define geometry
# ---------------
# these should both be even
# For Walls & arc
nx = 10
ny = 4

fnstep = (nx+1)*(ny+1)
snwall2 = (nx+1)*(ny+1) + 1
snarc = 2*(nx+1)*(ny+1) + 1
fnx = 3*(nx+1)*(ny+1)

# loaded nodes
mid = int(((nx+1)*(ny+1) + 1)/2)
side1 = int((nx+2)/2)
side2 = int((nx+1)*(ny+1) - side1 + 1)

# generate the nodes and elements
# numX numY startNode startEle eleType eleArgs? coords?
# Wall 1
ops.block2D(nx, ny, 1, 1,
"ShellMITC4", 1,
1, 0.0, 0.0, 0.0,
2, 0.0, 0.0, 7.0,
3, 40.0, 0.0, 7.0,
4, 40.0, 0.0, 0.0)

# Wall 2
ops.block2D(nx, ny, snwall2, snwall2,
"ShellMITC4", 1,
1, 0.0, 17.1, 0.0,
2, 0.0, 17.1, 7.0,
3, 40.0, 17.1, 7.0,
4, 40.0, 17.1, 0.0)

# Arc
ops.block2D(nx, ny, snarc, snarc,
"ShellMITC4", 1,
1, 0.0, 0.0, 7.0,
2, 0.0, 17.1, 7.0,
3, 40.0, 17.1, 7.0,
4, 40.0, 0.0, 7.0,
5, 0.0, 8.55, 10.275,
7, 40.0, 8.55, 10.275,
9, 20.0, 8.55, 10.275)

# Add Beam Elemet
# Define the beam element

# geomTransf('Linear', transfTag, *vecxz, '-jntOffset', *dI, *dJ)
ops.geomTransf('Linear', 1, 0, 0, 1)
ops.beamIntegration('Lobatto', 1, beamSecTag1, 4)

# element('forceBeamColumn', eleTag, *eleNodes, transfTag, integrationTag,'-mass', mass=0.0)
ops.element('forceBeamColumn', 151, 11, 66, 1, 1, '-iter', 10, 1e-12, '-mass', 0.0, '-L', 17.1)

# Truss
# element('Truss', eleTag, *eleNodes, A, matTag)
#ops.element('Truss', 151, 11, 66, A, 1)

# Connect Arc with Walls
# Connect Wall 1 with Arc
cwall1 = snarc
for i in range(nx + 1, snwall2, nx + 1):
ops.equalDOF(i, cwall1, 1, 2, 3, 4, 5, 6)
cwall1 += nx + 1

# Connect Wall 2 with Arc
cwall2 = snarc + nx
for i in range(snwall2 + nx, snarc, nx + 1):
ops.equalDOF(i, cwall2, 1, 2, 3, 4, 5, 6)
cwall2 += nx + 1

# define the boundary conditions
ops.fixZ( 0.0, 1, 1, 1, 1, 1, 1)

# mass??
ops.mass(20, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0)


return mid, side1, side2

def GetRecorders():
# Record Results
# op.recorder('Node', '-file', filename, '-xml', filename, '-binary', filename, '-tcp', inetAddress, port, '-precision', nSD=6, '-timeSeries', tsTag, '-time', '-dT', deltaT=0.0, '-closeOnWrite', '-node', *nodeTags=[], '-nodeRange', startNode, endNode, '-region', regionTag, '-dof', *dofs=[], respType)
ops.recorder('Node', '-file', "NodeDisp.out",'-time','-node', 94, '-dof', 1, 2, 3, 'disp')
# ops.recorder('Node', '-file', "Reaction.out",'-time','-node', 1, '-dof', 1, 2, 3, 'reaction')
# ops.recorder('Element', '-file', "Elements.out",'-time','-ele', 1, 'forces')



def loads(mid, side1, side2):

# ------------------------
# Loads
# ------------------------
# create a Linear time series
ops.timeSeries("Linear", 1)

# add some loads
ops.pattern("Plain", 1, 1, "-fact", 1.0)
ops.load(mid , 0.0, -5.0, 0.0, 0.0, 0.0, 0.0)
ops.load(side1, 0.0, -0.25, 0.0, 0.0, 0.0, 0.0)
ops.load(side2, 0.0, -0.25, 0.0, 0.0, 0.0, 0.0)
# ops.load(45, 0.0, 0.0, -0.25, 0.0, 0.0, 0.0)


def RunAnalysis():

# Create Visual data for model
ModelName = '3D_Shell'
LoadCaseName = 'Static'
vfo.createODB(ModelName, LoadCaseName, Nmodes = 3)

LoadCaseName2 = 'Static'
vfo.createODB(ModelName, LoadCaseName2, deltaT = 1/24, Nmodes = 3)

# ------------------------
# Start of static analysis
# ------------------------

# Load control with variable load steps
# create integrator
# init Jd min max
ops.integrator("LoadControl", 1.0)

ops.test('NormDispIncr',1.0e-4,200)

# create algorithm
ops.algorithm("Newton")

# create DOF number
ops.numberer("RCM")

# create constraint handler
ops.constraints("Plain")

# create SOE
ops.system("BandGeneral")

# create analysis object
ops.analysis("Static")

# perform the analysis
ops.analyze(1)


vfo.plot_model(ModelName,show_nodetags="yes",show_eletags="yes")
#vfo.plot_modeshape(modenumber=2, scale=200)

vfo.plot_deformedshape(ModelName, LoadCaseName, scale = 50, tstep= .5, overlap='yes')

ops.wipe()

-------------------------------- End Model_Functions.py------------------------------------------

mhscott
Posts: 875
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: could not invert flexibility for element with tag: 151

Post by mhscott » Sat Oct 14, 2023 4:00 am

The WFSection2d section only discretizes fibers in one direction. You need a section with fiber discretization in two directions in order to resist moments and provide flexural stiffness in two directions for 3D elements.

izzettin
Posts: 8
Joined: Sat Oct 01, 2022 2:36 pm

Re: could not invert flexibility for element with tag: 151

Post by izzettin » Sun Oct 15, 2023 12:54 pm

Ziad wrote:
Fri Oct 13, 2023 7:21 am

import vfo.vfo as vfo
Dear Ziad
I am trying importing Vfo in jupyter, but it gives ne error:
Do you have advice on how to import it succesfully?

the error is:
ValueError: Invalid Jupyter notebook plotting backend "panel".
Use one of the following:
"static", "client", "server", "trame", "none"

Ziad
Posts: 12
Joined: Fri Sep 22, 2023 6:38 am

Re: could not invert flexibility for element with tag: 151

Post by Ziad » Mon Oct 16, 2023 1:40 am

Regarding VFO, It just worked flawlessly, I just did pip install and it worked.

Ziad
Posts: 12
Joined: Fri Sep 22, 2023 6:38 am

Re: could not invert flexibility for element with tag: 151

Post by Ziad » Mon Oct 16, 2023 2:12 am

mhscott wrote:
Sat Oct 14, 2023 4:00 am
The WFSection2d section only discretizes fibers in one direction. You need a section with fiber discretization in two directions in order to resist moments and provide flexural stiffness in two directions for 3D elements.
I changed it with this but i am getting error from the section:
Es = 200000.0
v=0.2
Gs = Es/(1+v)
WA = 0.0361
J = 2.0*10**-6
Iy = 0.00000041998
Iz = 0.00000041998

ops.section('Elastic', beamSecTag1, Es, WA, Iz, Iy,Gs, J)

Is there something I am missing?

mhscott
Posts: 875
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: could not invert flexibility for element with tag: 151

Post by mhscott » Mon Oct 16, 2023 4:00 am

Sorry, I can't tell what's wrong with your use of elastic section.

But 1) Check your equation for G and 2) Read this for how you defined J: https://portwooddigital.com/2023/02/12/ ... anslation/

Post Reply