About 3D Moment Frame model

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

About 3D Moment Frame model

Post by shiro » Mon Jun 29, 2020 12:40 am

Hello.


I tryed 2D model to 3D model by reference under sample files.


(1)Pushover Analysis of 2-Story Moment Frame

https://opensees.berkeley.edu/wiki/inde ... ment_Frame

Supporting procedure files

rotSpring2DModIKModel.tcl – creates a bilinear rotational spring that follows the Modified Ibarra Krawinkler Deterioration Model (used in the concentrated model)
rotLeaningCol.tcl – creates a low-stiffness rotational spring used in a leaning column


(2)OpenSees Example 7. 3D Frame, 3-story 3-bayX 3-bayZ, Reinforced-Concrete Section & Steel W-Section

https://opensees.berkeley.edu/wiki/inde ... _W-Section


I succeeded in 2D.
I do not use fiber setion. I use concentrated plasticity based on Ibarra-Medina-Krawinkler model like 2D model.

The following 3d file is created and executed, but an error occurs.
It did not change even after changing to an elastic model or setting the mass.
Supporting procedure files is same. (rotSpring2DModIKModel.tcl , rotLeaningCol.tcl)


If you notice any mistakes, please let me know.
thank you very much!


*)Error message


WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 121
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 122
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 131
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 132
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 141
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 142
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 151
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 152
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 221
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 222
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 231
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 232
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 241
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 242
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 251
non-varyng assumed
WARNING PlainHandler::handle() - constraint matrix not identity, ignoring constraint for node 252
non-varyng assumed
WARNING BandSPDLinLapackSolver::solve() - the LAPACK routines returned 1
WARNING Linear::solveCurrentStep() -the LinearSOE failed in solve()
StaticAnalysis::analyze() - the Algorithm failed at iteration: 0 with domain at load factor 1
OpenSees > analyze failed, returned: -3 error flag



*)TCL file code

wipe; # clear memory of all past model definitions
model BasicBuilder -ndm 3 -ndf 6; # Define the model builder, ndm=#dimension, ndf=#dofs
set dataDir Data; # set up name of data directory -- remove
file mkdir $dataDir; # create data directory
set GMdir "./GMfiles"; # ground-motion file directory
source LibUnits.tcl; # define units
source DisplayPlane.tcl; # procedure for displaying a plane in model
source DisplayModel3D.tcl; # procedure for displaying 3D perspectives of model
source rotSpring2DModIKModel.tcl; # procedure for defining a rotational spring (zero-length element)
source rotLeaningCol.tcl; # procedure for defining a rotational spring (zero-length element) with very small stiffness

set LCol1 [expr 455.0/2.54]; # column height (parallel to Y axis)
set LCol2 [expr 910.0/2.54]; # column height (parallel to Y axis)
set LBeam [expr 910.0/2.54]; # beam length (parallel to X axis)
set LGird [expr 910.0/2.54]; # girder length (parallel to Z axis)

set NStories 4; # number of stories
set NBays 1; # number of frame bays (excludes bay for P-delta column)
set WBay [expr 910.0/2.54]; # bay width in inches
set WBayZ [expr 910.0/2.54]; # bay width in inches Z direction

set HStory1 [expr 455.0/2.54]; # 1st story height in inches
set HStory2 [expr 910.0/2.54]; # 2st story height in inches
set HStory3 [expr 910.0/2.54]; # 3st story height in inches
set HStoryTyp [expr 455.0/2.54]; # story height of other stories in inches
set HBuilding [expr $HStory1 + $HStory2 +$HStory3 + $HStoryTyp ]; # height of building


set NStory 4; # number of stories above ground level
set NBay 1; # number of bays in X direction
set NBayZ 1; # number of bays in Z direction
puts "Number of Stories in Y: $NStory; Number of bays in X: $NBay; Number of bays in Z: $NBayZ"

set X1 0.;
set X2 [expr $X1 + $LBeam];
set Y1 0.;
set Y2 [expr $Y1 + $LCol1];
set Y3 [expr $Y2 + $LCol2];
set Y4 [expr $Y3 + $LCol2];
set Y5 [expr $Y4 + $LCol1];
set Z1 0.0;
set Z2 [expr $Z1 + $LGird];

node 111 $X1 $Y1 $Z1; # frame 1
node 112 $X2 $Y1 $Z1;
node 121 $X1 $Y2 $Z1;
node 122 $X2 $Y2 $Z1;
node 131 $X1 $Y3 $Z1;
node 132 $X2 $Y3 $Z1;
node 141 $X1 $Y4 $Z1;
node 142 $X2 $Y4 $Z1;
node 151 $X1 $Y5 $Z1;
node 152 $X2 $Y5 $Z1;
node 211 $X1 $Y1 $Z2; # frame 2
node 212 $X2 $Y1 $Z2;
node 221 $X1 $Y2 $Z2;
node 222 $X2 $Y2 $Z2;
node 231 $X1 $Y3 $Z2;
node 232 $X2 $Y3 $Z2;
node 241 $X1 $Y4 $Z2;
node 242 $X2 $Y4 $Z2;
node 251 $X1 $Y5 $Z2;
node 252 $X2 $Y5 $Z2;


node 1516 $X1 $Y5 $Z1; # zero-stiffness spring will be used on Pin column
node 1526 $X2 $Y5 $Z1; # zero-stiffness spring will be used on Pin column
node 2516 $X1 $Y5 $Z2;
node 2526 $X2 $Y5 $Z2;

# beam hinges at Floor
# X-axial

# Frame1

node 1212 $X1 $Y2 $Z1; # Floor2
node 1223 $X2 $Y2 $Z1;
node 1312 $X1 $Y3 $Z1; # Floor3
node 1323 $X2 $Y3 $Z1;
node 1412 $X1 $Y4 $Z1; # Floor4
node 1423 $X2 $Y4 $Z1;

# Frame2

node 2212 $X1 $Y2 $Z2; # Floor2
node 2223 $X2 $Y2 $Z2;
node 2312 $X1 $Y3 $Z2; # Floor3
node 2323 $X2 $Y3 $Z2;
node 2412 $X1 $Y4 $Z2; # Floor4
node 2423 $X2 $Y4 $Z2;

# Z-axial

# Frame1

node 1215 $X1 $Y2 $Z1; # Floor2
node 1225 $X2 $Y2 $Z1;
node 1315 $X1 $Y3 $Z1; # Floor3
node 1325 $X2 $Y3 $Z1;
node 1415 $X1 $Y4 $Z1; # Floor4
node 1425 $X2 $Y4 $Z1;

# Frame2

node 2214 $X1 $Y2 $Z2; # Floor2
node 2224 $X2 $Y2 $Z2;
node 2314 $X1 $Y3 $Z2; # Floor3
node 2324 $X2 $Y3 $Z2;
node 2414 $X1 $Y4 $Z2; # Floor4
node 2424 $X2 $Y4 $Z2;



# define Rigid Floor Diaphragm
set RigidDiaphragm ON ; # options: ON, OFF. specify this before the analysis parameters are set the constraints are handled differently.
set Xa [expr ($X2+$X1)/2]; # mid-span coordinate for rigid diaphragm
set Za [expr ($Z2+$Z1)/2];
# rigid-diaphragm nodes in center of each diaphram
node 1121 $Xa $Y2 $Za; # master nodes for rigid diaphragm -- story 2, bay 1, frame 1-2
node 1131 $Xa $Y3 $Za; # master nodes for rigid diaphragm -- story 3, bay 1, frame 1-2
node 1141 $Xa $Y4 $Za; # master nodes for rigid diaphragm -- story 4, bay 1, frame 1-2
node 1151 $Xa $Y5 $Za; # master nodes for rigid diaphragm -- story 5, bay 1, frame 1-2
# Constraints for rigid diaphragm master nodes
fix 1121 0 1 0 1 0 1
fix 1131 0 1 0 1 0 1
fix 1141 0 1 0 1 0 1
fix 1151 0 1 0 1 0 1
# ------------------------define Rigid Diaphram, dof 2 is normal to floor
set perpDirn 2;
rigidDiaphragm $perpDirn 1121 121 122 221 222; # level 2
rigidDiaphragm $perpDirn 1131 131 132 231 232; # level 3
rigidDiaphragm $perpDirn 1141 141 142 241 242; # level 4
rigidDiaphragm $perpDirn 1151 151 152 251 252; # level 5

# determine support nodes where ground motions are input, for multiple-support excitation
set iSupportNode "111 112 211 212"

# BOUNDARY CONDITIONS
fixY 0.0 1 1 1 0 1 0; # pin all Y=0.0 nodes

# calculated MODEL PARAMETERS, particular to this model
# Set up parameters that are particular to the model for displacement control
set IDctrlNode 151; # node where displacement is read for displacement control
set IDctrlDOF 1; # degree of freedom of displacement read for displacement control
set LBuilding [expr $Y5]; # total building height

# Define SECTIONS -------------------------------------------------------------
#set SectionType FiberSection; # options: Elastic FiberSection

# define section tags:
set ColSecTag 1
set BeamSecTag 2
set GirdSecTag 3


###################################################################################################
# Define Section Properties and Elements
###################################################################################################
# define material properties

set Es [expr (980 * 0.22481) * 2.54 * 2.54]; # wood Young's modulus Es=980(kN/cm2) ⇒ 1421(kip/in2)


set nu 0.3; # Poisson's ratio
set Gs [expr $Es/2./[expr 1+$nu]]; # Torsional stiffness Modulus
set J 1e10; # set large torsional stiffness

set Acol_12 [expr (12.0 / 2.54) * (12.0 / 2.54)]; # cross-sectional area
set Icol_12 [expr ((12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54)) / 12]; # moment of inertia
set Mycol_12 1e-10; # yield moment [Pin]

set Abeam_23 [expr (3.0 / 2.54) * (9.0 / 2.54)]; # cross-sectional area (full section properties) Nuki---3cm*9cm
set Ibeam_23Z [expr ((3.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54)) / 12]; # moment of inertia (full section properties)
set Mybeam_23 [expr (99.6758 * 0.22481) / 2.54]; # yield moment at plastic hinge location (i.e., My of RBS section, if used) Nuki--- 99.6758(kN.cm) ⇒ 8.8221(kip.in)

set Ibeam_23 [expr ((9.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54)) / 12]; # moment of inertia (full section properties)


set n 10.0; # stiffness multiplier for rotational spring

# calculate modified moment of inertia for elastic elements
set Icol_12mod [expr $Icol_12*($n+1.0)/$n]; # modified moment of inertia for columns in Story 1 & 2
set Ibeam_23mod [expr $Ibeam_23*($n+1.0)/$n]; # modified moment of inertia for beams in Floor 2 & 3
set Ibeam_23modZ [expr $Ibeam_23Z*($n+1.0)/$n]; # modified moment of inertia for beams in Floor 2 & 3
# calculate modified rotational stiffness for plastic hinge springs
set Ks_col_1 [expr $n*6.0*$Es*$Icol_12mod/$HStory1]; # rotational stiffness of Story 1 column springs

set Ks_col_2 [expr $n*6.0*$Es*$Icol_12mod/$HStoryTyp]; # rotational stiffness of Story 5 column springs

set Ks_beam_23 [expr $n*6.0*$Es*$Ibeam_23mod/$WBay]; # rotational stiffness of Floor 2 ~ 4 beam springs

# set up geometric transformations of element
# set PDeltaTransf 1;
# geomTransf PDelta $PDeltaTransf; # PDelta transformatio


#set QdlCol [expr 114*$lbf/$ft]; # W-section weight per length
#set QBeam [expr 94*$lbf/$ft]; # W-section weight per length
#set QGird [expr 94*$lbf/$ft]; # W-section weight per length

# define ELEMENTS -------------------------------------------------------
# set up geometric transformations of element
# separate columns and beams, in case of P-Delta analysis for columns
# in 3D model, assign vector vecxz
set IDColTransf 1; # all columns
set IDBeamTransf 2; # all beams
set IDGirdTransf 3; # all girders
set ColTransfType Linear ; # options, Linear PDelta Corotational
geomTransf $ColTransfType $IDColTransf 0 0 1 ; # only columns can have PDelta effects (gravity effects)
geomTransf Linear $IDBeamTransf 0 0 1
geomTransf Linear $IDGirdTransf 1 0 0

# Define Beam-Column Elements
#set np 5; # number of Gauss integration points for nonlinear curvature distribution

# Frame 1
# columns
element elasticBeamColumn 1111 111 121 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 1-2
element elasticBeamColumn 1112 112 122 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 1121 121 131 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 2-3
element elasticBeamColumn 1122 122 132 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 1131 131 141 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 3-4
element elasticBeamColumn 1132 132 142 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 1141 141 151 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 4-5
element elasticBeamColumn 1142 142 152 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf

# beams
element elasticBeamColumn 1221 121 122 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 2
element elasticBeamColumn 1231 131 132 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 3
element elasticBeamColumn 1241 141 142 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 4
element elasticBeamColumn 1251 151 152 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 5


# Frame 2
# columns
element elasticBeamColumn 2111 211 221 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 1-2
element elasticBeamColumn 2112 212 222 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 2121 221 231 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 2-3
element elasticBeamColumn 2122 222 232 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 2131 231 241 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 3-4
element elasticBeamColumn 2132 232 242 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf
element elasticBeamColumn 2141 241 251 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf; # level 4-5
element elasticBeamColumn 2142 242 252 $Acol_12 $Es $Gs $J $Icol_12mod $Icol_12mod $IDColTransf

# beams
element elasticBeamColumn 2221 221 222 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 2
element elasticBeamColumn 2231 231 232 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 3
element elasticBeamColumn 2241 241 242 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 4
element elasticBeamColumn 2251 251 252 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDBeamTransf; # level 5

# girders connecting frames
# Frame 1-2
element elasticBeamColumn 1321 121 221 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf; # level 2
element elasticBeamColumn 1322 122 222 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf;
element elasticBeamColumn 1331 131 231 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf; # level 3
element elasticBeamColumn 1332 132 232 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf;
element elasticBeamColumn 1341 141 241 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf; # level 4
element elasticBeamColumn 1342 142 242 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf;
element elasticBeamColumn 1351 151 251 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf; # level 5
element elasticBeamColumn 1352 152 252 $Abeam_23 $Es $Gs $J $Ibeam_23modZ $Ibeam_23mod $IDGirdTransf;



###################################################################################################
# Define Rotational Springs for Plastic Hinges
###################################################################################################
# define rotational spring properties and create spring elements using "rotSpring2DModIKModel" procedure
# rotSpring2DModIKModel creates a uniaxial material spring with a bilinear response based on Modified Ibarra Krawinkler Deterioration Model
# references provided in rotSpring2DModIKModel.tcl
# input values for Story 1 column springs
set McMy 1.05; # ratio of capping moment to yield moment, Mc / My
set LS 1000.0; # basic strength deterioration (a very large # = no cyclic deterioration)
set LK 1000.0; # unloading stiffness deterioration (a very large # = no cyclic deterioration)
set LA 1000.0; # accelerated reloading stiffness deterioration (a very large # = no cyclic deterioration)
set LD 1000.0; # post-capping strength deterioration (a very large # = no deterioration)
set cS 1.0; # exponent for basic strength deterioration (c = 1.0 for no deterioration)
set cK 1.0; # exponent for unloading stiffness deterioration (c = 1.0 for no deterioration)
set cA 1.0; # exponent for accelerated reloading stiffness deterioration (c = 1.0 for no deterioration)
set cD 1.0; # exponent for post-capping strength deterioration (c = 1.0 for no deterioration)
set th_pP 0.025; # plastic rot capacity for pos loading
set th_pN 0.025; # plastic rot capacity for neg loading
set th_pcP 0.3; # post-capping rot capacity for pos loading
set th_pcN 0.3; # post-capping rot capacity for neg loading
set ResP 0.4; # residual strength ratio for pos loading
set ResN 0.4; # residual strength ratio for neg loading
set th_uP 0.4; # ultimate rot capacity for pos loading
set th_uN 0.4; # ultimate rot capacity for neg loading
set DP 1.0; # rate of cyclic deterioration for pos loading
set DN 1.0; # rate of cyclic deterioration for neg loading
set a_mem [expr ($n+1.0)*($Mycol_12*($McMy-1.0)) / ($Ks_col_1*$th_pP)]; # strain hardening ratio of spring
set b [expr ($a_mem)/(1.0+$n*(1.0-$a_mem))]; # modified strain hardening ratio of spring (Ibarra & Krawinkler 2005, note: Eqn B.5 is incorrect)

# define column springs
# Spring ID: "3xya", where 3 = col spring, x = Pier #, y = Story #, a = location in story
# "a" convention: 1 = bottom of story, 2 = top of story
# command: rotSpring2DModIKModel id ndR ndC K asPos asNeg MyPos MyNeg LS LK LA LD cS cK cA cD th_p+ th_p- th_pc+ th_pc- Res+ Res- th_u+ th_u- D+ D-
# col springs @ bottom of Story 1 (at base)

# recompute strain hardening since Story 2 is not the same height as Story 1
set a_mem [expr ($n+1.0)*($Mycol_12*($McMy-1.0)) / ($Ks_col_2*$th_pP)]; # strain hardening ratio of spring
set b [expr ($a_mem)/(1.0+$n*(1.0-$a_mem))]; # modified strain hardening ratio of spring (Ibarra & Krawinkler 2005, note: there is mistake in Eqn B.5)
# col springs @ bottom of Story 2 (above Floor 2)

rotLeaningCol 31516 151 1516; # top of Story 4
rotLeaningCol 31526 152 1526; # top of Story 4
rotLeaningCol 32516 251 2516; # top of Story 4
rotLeaningCol 32526 252 2526; # top of Story 4


region 1 -ele 31516 31526 32516 32526;


# define beam springs
# Spring ID: "4xya", where 4 = beam spring, x = Bay #, y = Floor #, a = location in bay
# "a" convention: 1 = left end, 2 = right end
# redefine the rotations since they are not the same
set th_pP 0.02;
set th_pN 0.02;
set th_pcP 0.16;
set th_pcN 0.16;
set a_mem [expr ($n+1.0)*($Mybeam_23*($McMy-1.0)) / ($Ks_beam_23*$th_pP)]; # strain hardening ratio of spring
set b [expr ($a_mem)/(1.0+$n*(1.0-$a_mem))]; # modified strain hardening ratio of spring (Ibarra & Krawinkler 2005, note: there is mistake in Eqn B.5)
#beam springs at Floor 2

# X-axial

#beam springs at Floor 2
rotSpring2DModIKModel 41212 121 1212 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41223 122 1223 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42212 221 2212 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42223 222 2223 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;

#beam springs at Floor 3
rotSpring2DModIKModel 41312 131 1312 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41323 132 1323 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42312 231 2312 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42323 232 2323 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;

#beam springs at Floor 4
rotSpring2DModIKModel 41412 141 1412 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41423 142 1423 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42412 241 2412 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42423 242 2423 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;


# Z-axial

#beam springs at Floor 2
rotSpring2DModIKModel 41215 121 1215 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42214 221 2214 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41225 122 1225 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42224 222 2224 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;

#beam springs at Floor 3
rotSpring2DModIKModel 41315 131 1315 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42314 231 2314 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41325 132 1325 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42324 232 2324 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;

#beam springs at Floor 4
rotSpring2DModIKModel 41415 141 1415 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42414 241 2414 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 41425 142 1425 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
rotSpring2DModIKModel 42424 242 2424 $Ks_beam_23 $b $b $Mybeam_23 [expr -$Mybeam_23] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;



# X-axial

region 2 -ele 41212 41223 41312 41323 41412 41423 42212 42223 42312 42323 42412 42423;

# Z-axial

region 3 -ele 41215 41225 41315 41325 41415 41425 42214 42224 42314 42324 42414 42424;



# --------------------------------------------------------------------------------------------------------------------------------
# Define GRAVITY LOADS, weight and masses
# calculate dead load of frame, assume this to be an internal frame (do LL in a similar manner)
# calculate distributed weight along the beam length
#set GammaConcrete [expr 150*$pcf]; # Reinforced-Concrete weight density (weight per volume)
#set Tslab [expr 6*$in]; # 6-inch slab
#set Lslab [expr $LGird/2]; # slab extends a distance of $LGird/2 in/out of plane
#set DLfactor 1.0; # scale dead load up a little
#set Qslab [expr $GammaConcrete*$Tslab*$Lslab*$DLfactor];
#set QdlBeam [expr $Qslab + $QBeam]; # dead load distributed along beam (one-way slab)
#set QdlGird $QGird; # dead load distributed along girder
#set WeightCol [expr $QdlCol*$LCol]; # total Column weight
#set WeightBeam [expr $QdlBeam*$LBeam]; # total Beam weight
#set WeightGird [expr $QdlGird*$LGird]; # total Beam weight

# assign masses to the nodes that the columns are connected to
# each connection takes the mass of 1/2 of each element framing into it (mass=weight/$g)
#set Mmid [expr ($WeightCol/2 + $WeightCol/2 +$WeightBeam/2+$WeightGird/2)/$g];
#set Mtop [expr ($WeightCol/2 + $WeightBeam/2+$WeightGird/2)/$g];

# frame 1
#mass 121 $Mmid 0 $Mmid 0. 0. 0.; # level 2
#mass 122 $Mmid 0 $Mmid 0. 0. 0.;
#mass 131 $Mmid 0 $Mmid 0. 0. 0.; # level 3
#mass 132 $Mmid 0 $Mmid 0. 0. 0.;
#mass 141 $Mtop 0 $Mtop 0. 0. 0.; # level 4
#mass 142 $Mtop 0 $Mtop 0. 0. 0.;

# frame 2
#mass 221 $Mmid 0 $Mmid 0. 0. 0.; # level 2
#mass 222 $Mmid 0 $Mmid 0. 0. 0.;
#mass 231 $Mmid 0 $Mmid 0. 0. 0.; # level 3
#mass 232 $Mmid 0 $Mmid 0. 0. 0.;
#mass 241 $Mtop 0 $Mtop 0. 0. 0.; # level 4
#mass 242 $Mtop 0 $Mtop 0. 0. 0.;

#set FloorWeight2 [expr 4*$WeightCol + 2*$WeightGird + 2*$WeightBeam]
#set FloorWeight3 [expr 4*$WeightCol + 2*$WeightGird + 2*$WeightBeam]
#set FloorWeight4 [expr 2*$WeightCol + 2*$WeightGird + 2*$WeightBeam]
#set WeightTotal [expr $FloorWeight2+$FloorWeight3+$FloorWeight4]; # total building weight
#set MassTotal [expr $WeightTotal/$g]; # total building mass

# --------------------------------------------------------------------------------------------------------------------------------
# LATERAL-LOAD distribution for static pushover analysis
# calculate distribution of lateral load based on mass/weight distributions along building height
# Fj = WjHj/sum(WiHi) * Weight at each floor j
#set sumWiHi [expr $FloorWeight2*$Y2+$FloorWeight3*$Y3+$FloorWeight4*$Y4]; # sum of storey weight times height, for lateral-load distribution
#set WiHi2 [expr $FloorWeight2*$Y2]; # storey weight times height, for lateral-load distribution
#set WiHi3 [expr $FloorWeight3*$Y3]; # storey weight times height, for lateral-load distribution
#set WiHi4 [expr $FloorWeight4*$Y4]; # storey weight times height, for lateral-load distribution
#set F2 [expr $WiHi2/$sumWiHi*$WeightTotal]; # lateral load at level
#set F3 [expr $WiHi3/$sumWiHi*$WeightTotal]; # lateral load at level
#set F4 [expr $WiHi4/$sumWiHi*$WeightTotal]; # lateral load at level


# Define RECORDERS -------------------------------------------------------------
#recorder Node -file $dataDir/DFree.out -time -node 151 -dof 1 2 3 disp; # displacements of free node


# define GRAVITY -------------------------------------------------------------
# GRAVITY LOADS # define gravity load applied to beams and columns -- eleLoad applies loads in local coordinate axis
#pattern Plain 101 Linear {
# Frame 1
# columns
# eleLoad -ele 1111 -type -beamUniform 0. 0. -$QdlCol; # level 1-2
# eleLoad -ele 1112 -type -beamUniform 0. 0. -$QdlCol
# eleLoad -ele 1121 -type -beamUniform 0. 0. -$QdlCol; # level 2-3
# eleLoad -ele 1122 -type -beamUniform 0. 0. -$QdlCol
# eleLoad -ele 1131 -type -beamUniform 0. 0. -$QdlCol; # level 3-4
# eleLoad -ele 1132 -type -beamUniform 0. 0. -$QdlCol
# beams
# eleLoad -ele 1221 -type -beamUniform -$QdlBeam 0.; # level 2
# eleLoad -ele 1231 -type -beamUniform -$QdlBeam 0.; # level 3
# eleLoad -ele 1241 -type -beamUniform -$QdlBeam 0.; # level 4

# Frame 2
# columns
# eleLoad -ele 2111 -type -beamUniform 0. 0. -$QdlCol; # level 1-2
# eleLoad -ele 2112 -type -beamUniform 0. 0. -$QdlCol
# eleLoad -ele 2121 -type -beamUniform 0. 0. -$QdlCol; # level 2-3
# eleLoad -ele 2122 -type -beamUniform 0. 0. -$QdlCol
# eleLoad -ele 2131 -type -beamUniform 0. 0. -$QdlCol; # level 3-4
# eleLoad -ele 2132 -type -beamUniform 0. 0. -$QdlCol
# beams
# eleLoad -ele 2221 -type -beamUniform -$QdlBeam 0.; # level 2
# eleLoad -ele 2231 -type -beamUniform -$QdlBeam 0.; # level 3
# eleLoad -ele 2241 -type -beamUniform -$QdlBeam 0.; # level 4

# girders connecting frames
# Frame 1-2
# eleLoad -ele 1321 -type -beamUniform -$QdlGird 0.; # level 2
# eleLoad -ele 1322 -type -beamUniform -$QdlGird 0.;
# eleLoad -ele 1331 -type -beamUniform -$QdlGird 0.; # level 3
# eleLoad -ele 1332 -type -beamUniform -$QdlGird 0.;
# eleLoad -ele 1341 -type -beamUniform -$QdlGird 0.; # level 4
# eleLoad -ele 1342 -type -beamUniform -$QdlGird 0.;
#}
# Gravity-analysis parameters -- load-controlled static analysis
#set Tol 1.0e-8; # convergence tolerance for test
#variable constraintsTypeGravity Plain; # default;
#if { [info exists RigidDiaphragm] == 1} {
# if {$RigidDiaphragm=="ON"} {
# variable constraintsTypeGravity Lagrange; # large model: try Transformation
# }; # if rigid diaphragm is on
#}; # if rigid diaphragm exists
#constraints $constraintsTypeGravity ; # how it handles boundary conditions
#numberer RCM; # renumber dof's to minimize band-width (optimization), if you want to
#system BandGeneral ; # how to store and solve the system of equations in the analysis (large model: try UmfPack)
#test EnergyIncr $Tol 6 ; # determine if convergence has been achieved at the end of an iteration step
#algorithm Newton; # use Newton's solution algorithm: updates tangent stiffness at every iteration
#set NstepGravity 10; # apply gravity in 10 steps
#set DGravity [expr 1./$NstepGravity]; # first load increment;
#integrator LoadControl $DGravity; # determine the next time step for an analysis
#analysis Static; # define type of analysis static or transient
#analyze $NstepGravity; # apply gravity

# ------------------------------------------------- maintain constant gravity loads and reset time to zero
loadConst -time 0.0
set Tol 1.0e-6; # reduce tolerance after gravity loads
puts "Model Built"




# Define loads
# ------------

#create a Linear TimeSeries (load factor varies linearly with time): command timeSeries Linear $tag
timeSeries Linear 1

# Create a Plain load pattern with a linear TimeSeries: command pattern Plain $tag $timeSeriesTag { $loads }
pattern Plain 200 1 {

# Create the nodal load - command: load nodeID xForce yForce

set lat5 [expr (1.0 * 0.22481)]; # force on each frame node in Floor 5 P=1kN
# set lat5 1.0; # force on each frame node in Floor 5 P=1kip

load 1151 $lat5 0.0 0.0 0. 0. 0.;

}



# Define DISPLAY -------------------------------------------------------------
set xPixels 1200; # height of graphical window in pixels
set yPixels 800; # height of graphical window in pixels
set xLoc1 10; # horizontal location of graphical window (0=upper left-most corner)
set yLoc1 10; # vertical location of graphical window (0=upper left-most corner)
set ViewScale 1; # scaling factor for viewing deformed shape, it depends on the dimensions of the model
DisplayModel3D DeformedShape $ViewScale $xLoc1 $yLoc1 $xPixels $yPixels
recorder plot $dataDir/DFree.out Displ-X [expr $xPixels+10] 10 300 300 -columns 2 1; # a window to plot the nodal displacements versus time

#recorder plot DFree.out Displ-X [expr $xPixels+10] 10 300 300 -columns 2 1; # a window to plot the nodal displacements versus time

# recorder plot Node51.out Node9_14_19_Xdisp 1210 10 300 300 -columns 1 2 -columns 1 4 -columns 1 6 -dT 1.0



# ------------------------------
# Start of analysis generation
# ------------------------------

# Create the system of equation, a SPD using a band storage scheme
system BandSPD

# Create the DOF numberer, the reverse Cuthill-McKee algorithm
numberer RCM

# Create the constraint handler, a Plain handler is used as homo constraints
constraints Plain

# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1.0

# Create the solution algorithm, a Linear algorithm is created
algorithm Linear

# create the analysis object
analysis Static

# ------------------------------
# Finally perform the analysis
# ------------------------------

# Perform the analysis
analyze 1


puts "Done complete"; # display this message in the command window

selimgunay
Posts: 913
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: About 3D Moment Frame model

Post by selimgunay » Wed Jul 01, 2020 10:05 am

Because you have a rigid diaphragm constraint, you should change the constraints type from Plain to Transformation

# Create the constraint handler, a Plain handler is used as homo constraints
constraints Plain

shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

Re: About 3D Moment Frame model

Post by shiro » Wed Jul 01, 2020 3:09 pm

Dear selimgunay

Thanks a lots!

I changed script like below and run.

/////////////////////////////
system SparseGeneral;
numberer RCM

# Create the constraint handler, a Plain handler is used as homo constraints
constraints Transformation

integrator LoadControl 1.0
algorithm Linear
analysis Static

/////////////////////////////

The error is gone and the calculation is finieshed.

I tried to output the displacement of the top vertex to a file, but the output result was 0.
I would be grateful if you could point out what is wrong.

*)script:

recorder Node -file $dataDir/DFree.out -time -node 151 -dof 1 2 3 disp;

shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

Re: About 3D Moment Frame model

Post by shiro » Wed Jul 01, 2020 7:11 pm

Hello.

I succeeded in elastic analysis except the spring.

However, when the spring is set, the calculation ends, but the displacement and stress values are not calculated.
spring is there;


rotSpring2DModIKModel.tcl

rotLeaningCol.tcl


bilinear rotational spring that follows the Modified Ibarra Krawinkler Deterioration Model (used in the concentrated model)

Is the setting method wrong?
Or can it not be used the Modified Ibarra Krawinkler Deterioration Model for 3D analysis?

selimgunay
Posts: 913
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: About 3D Moment Frame model

Post by selimgunay » Mon Jul 06, 2020 9:14 pm

It may work if you change K from 1e-9 to 1e-8 or 1e-7 in rotLeaningCol.tcl

shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

Re: About 3D Moment Frame model

Post by shiro » Tue Jul 07, 2020 2:43 am

Dear selimgunay

Thanks a lot!
I tryed,but failed.

I tryed element [beamWithHinges] with section using [rotSect2DModIKModel.tcl].
I got result spring and node + element result.

But,When I put load Z-direstion,section i result Y-axial.
section 2(i+1) appear Z-Moment and deformation.

How can I get section i Z-Moment and deformation.

Thank you.


*DefoEleCol1121sec1.out # node-i

1 7.08603e-06 -8.33847e-18

*DefoEleCol1121sec2.out # node-i+1

1 0.224806 -1.98941e-12 -9.85379 -6.19159e-15

*DefoEleCol1121sec5.out # node-j

1 0.224806 4.49667e-12 9.85221 -6.19159e-15


This is my code;

# ////////////////////////////////

wipe; # clear memory of all past model definitions
model BasicBuilder -ndm 3 -ndf 6; # Define the model builder, ndm=#dimension, ndf=#dofs
set dataDir Data; # set up name of data directory -- remove
file mkdir $dataDir; # create data directory
set GMdir "./GMfiles"; # ground-motion file directory
source LibUnits.tcl; # define units
source DisplayPlane.tcl; # procedure for displaying a plane in model
source DisplayModel3D.tcl; # procedure for displaying 3D perspectives of model

source rotSect2DModIKModel.tcl; # procedure for defining bilinear plastic hinge section


set Ubig 1.e10; # a really large number
set Usmall [expr 1/$Ubig]; # a really small number

set LCol1 [expr 455.0/2.54]; # column height (parallel to Y axis)
set LCol2 [expr 910.0/2.54]; # column height (parallel to Y axis)
set LBeam [expr 910.0/2.54]; # beam length (parallel to X axis)
set LGird [expr 910.0/2.54]; # girder length (parallel to Z axis)

set NStories 4; # number of stories
set NBays 1; # number of frame bays (excludes bay for P-delta column)
set WBay [expr 910.0/2.54]; # bay width in inches
set WBayZ [expr 910.0/2.54]; # bay width in inches Z direction

set HStory1 [expr 455.0/2.54]; # 1st story height in inches
set HStory2 [expr 910.0/2.54]; # 2st story height in inches
set HStory3 [expr 910.0/2.54]; # 3st story height in inches
set HStoryTyp [expr 455.0/2.54]; # story height of other stories in inches
set HBuilding [expr $HStory1 + $HStory2 +$HStory3 + $HStoryTyp ]; # height of building


set NStory 4; # number of stories above ground level
set NBay 1; # number of bays in X direction
set NBayZ 1; # number of bays in Z direction
puts "Number of Stories in Y: $NStory; Number of bays in X: $NBay; Number of bays in Z: $NBayZ"

set X1 0.;
set X2 [expr $X1 + $LBeam];
set Y1 0.;
set Y2 [expr $Y1 + $LCol1];
set Y3 [expr $Y2 + $LCol2];
set Y4 [expr $Y3 + $LCol2];
set Y5 [expr $Y4 + $LCol1];
set Z1 0.0;
set Z2 [expr $Z1 + $LGird];

node 111 $X1 $Y1 $Z1; # frame 1
node 112 $X2 $Y1 $Z1;
node 121 $X1 $Y2 $Z1;
node 122 $X2 $Y2 $Z1;
node 131 $X1 $Y3 $Z1;
node 132 $X2 $Y3 $Z1;
node 141 $X1 $Y4 $Z1;
node 142 $X2 $Y4 $Z1;
node 151 $X1 $Y5 $Z1;
node 152 $X2 $Y5 $Z1;
node 211 $X1 $Y1 $Z2; # frame 2
node 212 $X2 $Y1 $Z2;
node 221 $X1 $Y2 $Z2;
node 222 $X2 $Y2 $Z2;
node 231 $X1 $Y3 $Z2;
node 232 $X2 $Y3 $Z2;
node 241 $X1 $Y4 $Z2;
node 242 $X2 $Y4 $Z2;
node 251 $X1 $Y5 $Z2;
node 252 $X2 $Y5 $Z2;

# define Rigid Floor Diaphragm
set RigidDiaphragm ON ; # options: ON, OFF. specify this before the analysis parameters are set the constraints are handled differently.
set Xa [expr ($X2+$X1)/2]; # mid-span coordinate for rigid diaphragm
set Za [expr ($Z2+$Z1)/2];
# rigid-diaphragm nodes in center of each diaphram
node 11121 $Xa $Y2 $Za; # master nodes for rigid diaphragm -- story 2, bay 1, frame 1-2
node 11131 $Xa $Y3 $Za; # master nodes for rigid diaphragm -- story 3, bay 1, frame 1-2
node 11141 $Xa $Y4 $Za; # master nodes for rigid diaphragm -- story 4, bay 1, frame 1-2
node 11151 $Xa $Y5 $Za; # master nodes for rigid diaphragm -- story 5, bay 1, frame 1-2
# Constraints for rigid diaphragm master nodes
fix 11121 0 1 0 1 0 1
fix 11131 0 1 0 1 0 1
fix 11141 0 1 0 1 0 1
fix 11151 0 1 0 1 0 1


# ------------------------define Rigid Diaphram, dof 2 is normal to floor
set perpDirn 2;
rigidDiaphragm $perpDirn 11121 121 122 221 222; # level 2
rigidDiaphragm $perpDirn 11131 131 132 231 232; # level 3
rigidDiaphragm $perpDirn 11141 141 142 241 242; # level 4
rigidDiaphragm $perpDirn 11151 151 152 251 252; # level 5

# determine support nodes where ground motions are input, for multiple-support excitation
set iSupportNode "111 112 211 212"

# BOUNDARY CONDITIONS
fixY 0.0 1 1 1 0 1 0; # pin all Y=0.0 nodes



# calculated MODEL PARAMETERS, particular to this model
# Set up parameters that are particular to the model for displacement control
set IDctrlNode 151; # node where displacement is read for displacement control
#set IDctrlDOF 1; # degree of freedom of displacement read for displacement control
set IDctrlDOF 3; # degree of freedom of displacement read for displacement control
set LBuilding [expr $Y5]; # total building height

# Define SECTIONS -------------------------------------------------------------
#set SectionType FiberSection; # options: Elastic FiberSection

# define section tags:
set ColSecTag 1
set BeamSecTag 2
set GirdSecTag 3


############################################################################################## Define Section Properties and Elements
#############################################################################################
# define material properties

set Es [expr (980 * 0.22481) * 2.54 * 2.54]; # wood Young's modulus Es=980(kN/cm2) ⇒ 1421(kip/in2)


set nu 0.3; # Poisson's ratio
set Gs [expr $Es/2./[expr 1+$nu]]; # Torsional stiffness Modulus
set J 1e10; # set large torsional stiffness

set Abeam_23 [expr (3.0 / 2.54) * (9.0 / 2.54)]; # cross-sectional area (full section properties) Nuki---3cm*9cm
set Ibeam_23Z [expr ((3.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54)) / 12]; # moment of inertia (full section properties)
set Mybeam_23 [expr (99.6758 * 0.22481) / 2.54]; # yield moment at plastic hinge location (i.e., My of RBS section, if used) Nuki--- 99.6758(kN.cm) ⇒ 8.8221(kip.in)

set Ibeam_23 [expr ((9.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54)) / 12]; # moment of inertia (full section properties)


set n 10; # stiffness multiplier for rotational spring

# calculate modified moment of inertia for elastic elements
# set Icol_12mod [expr $Icol_12*($n+1.0)/$n]; # modified moment of inertia for columns in Story 1 & 2
set Ibeam_23mod [expr $Ibeam_23*($n+1.0)/$n]; # modified moment of inertia for beams in Floor 2 & 3
set Ibeam_23modZ [expr $Ibeam_23Z*($n+1.0)/$n]; # modified moment of inertia for beams in Floor 2 & 3
# calculate modified rotational stiffness for plastic hinge springs
# set Ks_col_1 [expr $n*6.0*$Es*$Icol_12mod/$HStory1]; # rotational stiffness of Story 1 column springs

# set Ks_col_2 [expr $n*6.0*$Es*$Icol_12mod/$HStoryTyp]; # rotational stiffness of Story 5 column springs

set Ks_beam_23 [expr $n*6.0*$Es*$Ibeam_23mod/$WBay]; # rotational stiffness of Floor 2 ~ 4 beam springs



##############################################
# Distributed Plastic Hinges
################################################
## Distributed Plastic Hinges for beams and first floor columns##
# First floor columns and all the beams HSS127x127x4.8 & W100x19:


# columns --- rigid

set Mycol 1e10; # yield moment (KN.m)
set Acol [expr (12.0 / 2.54) * (12.0 / 2.54)]; # cross-sectional area
set Icol [expr ((12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54)) / 12]; # moment of inertia
set Icoly [expr ((12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54)) / 12] ;

#set Jh 7.81e-6;
set Jh 1e10;

# columns --- pin

set Mycol2 1e-10; # yield moment [Pin]
set Acol [expr (12.0 / 2.54) * (12.0 / 2.54)]; # cross-sectional area
set Icol [expr ((12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54)) / 12]; # moment of inertia
set Icoly [expr ((12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54) * (12.0 / 2.54)) / 12] ;

#set Jh 7.81e-6;
set Jh 1e10;


# beams --- Nuki

set Mybeam [expr (99.6758 * 0.22481) / 2.54]; # yield moment at plastic hinge location (i.e., My of RBS section, if used) Nuki--- 99.6758(kN.cm) ⇒ 8.8221(kip.in)
set Abeam [expr (3.0 / 2.54) * (9.0 / 2.54)]; # cross-sectional area (full section properties) Nuki---3cm*9cm
set Ibeam [expr ((3.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54) * (9.0 / 2.54)) / 12]; # moment of inertia (full section properties)
set Ibeamy [expr ((9.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54) * (3.0 / 2.54)) / 12];

#set Jh 6.36e-8 ;
set Jh 1e10;


# beams --- Pin

#set Mybeam7 1e-10; # yield moment [Pin]


# define plastic hinge lengths

set Lp_c1 [expr 0.004*$LCol1]; # length of plastic hinge for floor columns 45.5cm
set Lp_c2 [expr 0.004*$LCol2]; # length of plastic hinge for space columns 91.0cm
set Lp_b2 [expr 0.004*$LBeam]; # length of plastic hinge for beams (corridor beam length is used) 91.0cm

# determine stiffness modifications so that the strain hardening of the plastic hinge region captures the actual frame member's strain hardening
# Reference: Ibarra, L. F., and Krawinkler, H. (2005). "Global collapse of frame structures under seismic excitations," Technical Report 152,
# The John A. Blume Earthquake Engineering Research Center, Department of Civil Engineering, Stanford University, Stanford, CA.

set n_c1 [expr $LCol1/$Lp_c1]; # rotational stiffness ratio: (floor column plastic hinge region) / (actual floor column)
set n_c2 [expr $LCol2/$Lp_c2]; # rotational stiffness ratio: (space column plastic hinge region) / (actual space column)
set n_b2 [expr $LBeam/$Lp_b2]; # rotational stiffness ratio: (beam plastic hinge region) / (actual beam)

# calculate rotational stiffness for plastic hinges

set Ks_col_1 [expr 6.0*$Es*$Icol/$Lp_c1]; # rotational stiffness of floor column hinges 45.5cm # rotational stiffness of Story 1 column springs
set Ks_col_2 [expr 6.0*$Es*$Icol/$Lp_c2]; # rotational stiffness of floor column hinges 91.0cm # rotational stiffness of Story 5 column springs

set Ks_beam_2 [expr 6.0*$Es*$Ibeam/$Lp_b2]; # rotational stiffness of beam hinges 91.0cm # rotational stiffness of Floor 2 ~ 4 beam springs

#set Ks_beam_2 [expr $n*6.0*$Es*$Ibeam/$Lp_b2]; # rotational stiffness of beam hinges 91.0cm # rotational stiffness of Floor 2 ~ 4 beam springs

set Kmem_col_1 [expr 6.0*$Es*$Icol/$LCol1]; # rotational stiffness of floor columns 45.5cm
set Kmem_col_2 [expr 6.0*$Es*$Icol/$LCol2]; # rotational stiffness of space columns 91.0cm

set Kmem_beam_2 [expr 6.0*$Es*$Ibeam/$LBeam]; # rotational stiffness of beams 91.0cm

#set Kmem_beam_2 [expr $n*6.0*$Es*$Ibeam/$LBeam]; # rotational stiffness of beams 91.0cm


#######################################################
# Define Rotational Springs for Plastic Hinges
#######################################################
# define rotational spring properties and create spring elements using "rotSect2DModIKModel" procedure
# rotSect2DModIKModel creates a section with an elastic axial and bilinear flexural response based on Modified Ibarra Krawinkler Deterioration Model
# references provided in rotSect2DModIKModel.tcl
# input values for Story 1 column springs

set McMy 1.05; # ratio of capping moment to yield moment, Mc / My
set LS 1000.0; # basic strength deterioration (a very large # = no cyclic deterioration)
set LK 1000.0; # unloading stiffness deterioration (a very large # = no cyclic deterioration)
set LA 1000.0; # accelerated reloading stiffness deterioration (a very large # = no cyclic deterioration)
set LD 1000.0; # post-capping strength deterioration (a very large # = no deterioration)
set cS 1.0; # exponent for basic strength deterioration (c = 1.0 for no deterioration)
set cK 1.0; # exponent for unloading stiffness deterioration (c = 1.0 for no deterioration)
set cA 1.0; # exponent for accelerated reloading stiffness deterioration (c = 1.0 for no deterioration)
set cD 1.0; # exponent for post-capping strength deterioration (c = 1.0 for no deterioration)
set th_pP 0.025; # plastic rot capacity for pos loading
set th_pN 0.025; # plastic rot capacity for neg loading
set th_pcP 0.3; # post-capping rot capacity for pos loading
set th_pcN 0.3; # post-capping rot capacity for neg loading
set ResP 0.4; # residual strength ratio for pos loading
set ResN 0.4; # residual strength ratio for neg loading
set th_uP 0.4; # ultimate rot capacity for pos loading
set th_uN 0.4; # ultimate rot capacity for neg loading
set DP 1.0; # rate of cyclic deterioration for pos loading
set DN 1.0; # rate of cyclic deterioration for neg loading
set a_mem [expr ($Mycol*($McMy-1.0)) / ($Kmem_col_1*$th_pP)]; # strain hardening ratio of member
set bddm [expr ($a_mem)/(1.0+$n_c1*(1.0-$a_mem))]; # modified strain hardening ratio (Ibarra & Krawinkler 2005, note: Eqn B.5 is incorrect)

# define column plastic hinge sections
# command: rotSect2DModIKModel id ndR ndC K asPos asNeg MyPos MyNeg LS LK LA LD cS cK cA cD th_p+ th_p- th_pc+ th_pc- Res+ Res- th_u+ th_u- D+ D-

# Columns - Rigid

# 45cm

set sec_c1 101; # section ID for floor column section
rotSect2DModIKModel $sec_c1 $Es $Acol $Ks_col_1 $bddm $bddm $Mycol [expr -$Mycol] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;


# 91cm

set a_mem3 [expr ($Mycol*($McMy-1.0)) / ($Kmem_col_2*$th_pP)]; # strain hardening ratio of member
set bddm3 [expr ($a_mem3)/(1.0+$n_c2*(1.0-$a_mem3))]; # modified strain hardening ratio (Ibarra & Krawinkler 2005, note: Eqn B.5 is incorrect)


set sec_c3 103; # section ID for floor column section
rotSect2DModIKModel $sec_c3 $Es $Acol $Ks_col_2 $bddm3 $bddm3 $Mycol [expr -$Mycol] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;


# Columns - Pin


# recompute strain hardening since space column is not the same height as floor column
set a_mem2 [expr ($Mycol2*($McMy-1.0)) / ($Kmem_col_1*$th_pP)]; # strain hardening ratio of member
set bddm2 [expr ($a_mem2)/(1.0+$n_c1*(1.0-$a_mem2))]; # modified strain hardening ratio (Ibarra & Krawinkler 2005, note: there is mistake in Eqn B.5)


set sec_c2 102; # section ID for space column section
rotSect2DModIKModel $sec_c2 $Es $Acol $Ks_col_1 $bddm2 $bddm2 $Mycol2 [expr -$Mycol2] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;


# define beam plastic hinge sections
# redefine the rotations since they are not the same

set th_pP 0.02;
set th_pN 0.02;
set th_pcP 0.16;
set th_pcN 0.16;
set a_mem4 [expr ($Mybeam*($McMy-1.0)) / ($Kmem_beam_2*$th_pP)]; # strain hardening ratio of member
set bddm4 [expr ($a_mem4)/(1.0+$n_b2*(1.0-$a_mem4))]; # modified strain hardening ratio (Ibarra & Krawinkler 2005, note: there is mistake in Eqn B.5)


#beam sections

set sec_b2 202; # section ID for beams
rotSect2DModIKModel $sec_b2 $Es $Abeam $Ks_beam_2 $bddm4 $bddm4 $Mybeam [expr -$Mybeam] $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;



# define ELEMENTS -------------------------------------------------------
# set up geometric transformations of element
# separate columns and beams, in case of P-Delta analysis for columns
# in 3D model, assign vector vecxz
set IDColTransf 1; # all columns
set IDBeamTransf 2; # all beams
set IDGirdTransf 3; # all girders
set ColTransfType Linear ; # options, Linear PDelta Corotational
#geomTransf $ColTransfType $IDColTransf 0 0 1 ; # only columns can have PDelta effects (gravity effects)
#geomTransf Linear $IDBeamTransf 0 0 1
#geomTransf Linear $IDGirdTransf 1 0 0


geomTransf PDelta $IDColTransf 0 0 1;
geomTransf PDelta $IDBeamTransf 0 0 1;
geomTransf PDelta $IDGirdTransf 1 0 0;


# define p-delta columns and rigid links
set TrussMatID 600; # define a material ID
set Arigid 1000.0; # define area of truss section (make much larger than A of frame elements)
set Irigid 100000.0; # moment of inertia for p-delta columns (make much larger than I of frame elements)

uniaxialMaterial Elastic $TrussMatID $Es; # define truss material


# Frame 1
# columns

element beamWithHinges 1111 111 121 $sec_c1 $Lp_c1 $sec_c1 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 1-2
element beamWithHinges 1112 112 122 $sec_c1 $Lp_c1 $sec_c1 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 1121 121 131 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 2-3
element beamWithHinges 1122 122 132 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 1131 131 141 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 3-4
element beamWithHinges 1132 132 142 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 1141 141 151 $sec_c1 $Lp_c1 $sec_c2 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 4-5
element beamWithHinges 1142 142 152 $sec_c1 $Lp_c1 $sec_c2 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;


# beams

element beamWithHinges 1221 121 122 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 2
element beamWithHinges 1231 131 132 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 3
element beamWithHinges 1241 141 142 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 4

element truss 1251 151 152 $Arigid $TrussMatID; # Floor Roof

# Frame 2
# columns

element beamWithHinges 2111 211 221 $sec_c1 $Lp_c1 $sec_c1 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 1-2
element beamWithHinges 2112 212 222 $sec_c1 $Lp_c1 $sec_c1 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 2121 221 231 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 2-3
element beamWithHinges 2122 222 232 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 2131 231 241 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 3-4
element beamWithHinges 2132 232 242 $sec_c3 $Lp_c2 $sec_c3 $Lp_c2 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;
element beamWithHinges 2141 241 251 $sec_c1 $Lp_c1 $sec_c2 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf; # level 4-5
element beamWithHinges 2142 242 252 $sec_c1 $Lp_c1 $sec_c2 $Lp_c1 $Es $Acol $Icol $Icoly $Gs $Jh $IDColTransf;


# beams

element beamWithHinges 2221 221 222 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 2
element beamWithHinges 2231 231 232 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 3
element beamWithHinges 2241 241 242 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDBeamTransf; # level 4

element truss 2251 251 252 $Arigid $TrussMatID; # Floor Roof


# girders connecting frames
# Frame 1-2

element beamWithHinges 1321 121 221 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 2
element beamWithHinges 1322 122 222 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 3
element beamWithHinges 1331 131 231 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 4
element beamWithHinges 1332 132 232 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 2
element beamWithHinges 1341 141 241 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 3
element beamWithHinges 1342 142 242 $sec_b2 $Lp_b2 $sec_b2 $Lp_b2 $Es $Abeam $Ibeam $Ibeamy $Gs $Jh $IDGirdTransf; # level 4

element truss 1351 151 251 $Arigid $TrussMatID; # Floor Roof
element truss 1352 152 252 $Arigid $TrussMatID; # Floor Roof


region 1 -ele 1141 1142 2141 2142;

region 2 -ele 1221 1231 1241 1251 2221 2231 2241 2251;

region 3 -ele 1321 1331 1341 1351 1322 1332 1342 1352;


# Define RECORDERS -------------------------------------------------------------
recorder Node -file $dataDir/DFree.out -time -node 151 -dof 1 2 3 disp; # displacements of free node


# ------------------------------------------------- maintain constant gravity loads and reset time to zero
loadConst -time 0.0
set Tol 1.0e-6; # reduce tolerance after gravity loads
puts "Model Built"



# Define loads
# ------------

#create a Linear TimeSeries (load factor varies linearly with time): command timeSeries Linear $tag
timeSeries Linear 1

# Create a Plain load pattern with a linear TimeSeries: command pattern Plain $tag $timeSeriesTag { $loads }
pattern Plain 200 1 {

# Create the nodal load - command: load nodeID xForce yForce

set lat5 [expr (1.0 * 0.22481)]; # force on each frame node in Floor 5 P=1kN
# set lat5 1.0; # force on each frame node in Floor 5 P=1kip

load 11151 0.0 0.0 $lat5 0. 0. 0.;

}


set np 5;

# Define RECORDERS -------------------------------------------------------------
#recorder Node -file $dataDir/DFree.out -time -node 141 -dof 1 2 3 disp; # displacements of free node

#recorder Node -file $dataDir/DFree.out -time -node 1151 -dof 1 2 3 disp; # displacements of free node
recorder Node -file $dataDir/DFree.out -time -node 11151 -dof 1 2 3 disp; # displacements of free node


recorder Node -file $dataDir/DBase.out -time -node 111 112 211 212 -dof 1 2 3 disp; # displacements of support nodes
recorder Node -file $dataDir/RBase.out -time -node 111 112 211 212 -dof 1 2 3 reaction; # support reaction
recorder Drift -file $dataDir/DrNode.out -time -iNode 111 -jNode 151 -dof 3 -perpDirn 2; # lateral drift
recorder Element -file $dataDir/Fel1111.out -time -ele 1111 localForce; # element forces in local coordinates
##recorder Element -xml $dataDir/PlasticRotation1.out -time -ele 1111 plasticRotation; # element forces in local coordinates
recorder Element -file $dataDir/PlasticRotationCol1111.out -time -ele 1111 plasticRotation; # element forces in local coordinates

recorder Element -file $dataDir/ForceEleCol1111sec1.out -time -ele 1111 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleCol1111sec1.out -time -ele 1111 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleCol1111sec$np.out -time -ele 1111 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleCol1111sec$np.out -time -ele 1111 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleCol1111sec2.out -time -ele 1111 section 2 force; # section forces, axial and moment, node i+1
recorder Element -file $dataDir/DefoEleCol1111sec2.out -time -ele 1111 section 2 deformation; # section deformations, axial and curvature, node i+1

#set yFiber [expr 0.]; # fiber location for stress-strain recorder, local coords
#set zFiber [expr 0.]; # fiber location for stress-strain recorder, local coords
#recorder Element -file $dataDir/SSreinfEle1sec1.out -time -ele 1111 section $np fiber $yFiber $zFiber stressStrain; # steel fiber stress-strain, node i


recorder Element -file $dataDir/PlasticRotationBeam1221.out -time -ele 1221 plasticRotation; # element forces in local coordinates
recorder Element -file $dataDir/PlasticRotationBeam1231.out -time -ele 1231 plasticRotation; # element forces in local coordinates
recorder Element -file $dataDir/PlasticRotationBeam1241.out -time -ele 1241 plasticRotation; # element forces in local coordinates


recorder Element -file $dataDir/PlasticRotationGird1321.out -time -ele 1321 plasticRotation; # element forces in local coordinates
recorder Element -file $dataDir/PlasticRotationGird1331.out -time -ele 1331 plasticRotation; # element forces in local coordinates
recorder Element -file $dataDir/PlasticRotationGird1341.out -time -ele 1341 plasticRotation; # element forces in local coordinates


# Section

# ///// Columns /////

recorder Element -file $dataDir/ForceEleCol1121sec1.out -time -ele 1121 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleCol1121sec1.out -time -ele 1121 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleCol1121sec$np.out -time -ele 1121 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleCol1121sec$np.out -time -ele 1121 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleCol1121sec2.out -time -ele 1121 section 2 force; # section forces, axial and moment, node i+1
recorder Element -file $dataDir/DefoEleCol1121sec2.out -time -ele 1121 section 2 deformation; # section deformations, axial and curvature, node i+1

recorder Element -file $dataDir/ForceEleCol1131sec1.out -time -ele 1131 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleCol1131sec1.out -time -ele 1131 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleCol1131sec$np.out -time -ele 1131 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleCol1131sec$np.out -time -ele 1131 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleCol1131sec2.out -time -ele 1131 section 2 force; # section forces, axial and moment, node i+1
recorder Element -file $dataDir/DefoEleCol1131sec2.out -time -ele 1131 section 2 deformation; # section deformations, axial and curvature, node i+1

recorder Element -file $dataDir/ForceEleCol1141sec1.out -time -ele 1141 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleCol1141sec1.out -time -ele 1141 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleCol1141sec$np.out -time -ele 1141 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleCol1141sec$np.out -time -ele 1141 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleCol1141sec2.out -time -ele 1141 section 2 force; # section forces, axial and moment, node i+1
recorder Element -file $dataDir/DefoEleCol1141sec2.out -time -ele 1141 section 2 deformation; # section deformations, axial and curvature, node i+1


# ///// Beam /////

recorder Element -file $dataDir/ForceEleBeam1221sec1.out -time -ele 1221 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1221sec1.out -time -ele 1221 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1221sec$np.out -time -ele 1221 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1221sec$np.out -time -ele 1221 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleBeam1231sec1.out -time -ele 1231 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1231sec1.out -time -ele 1231 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1231sec$np.out -time -ele 1231 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1231sec$np.out -time -ele 1231 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleBeam1241sec1.out -time -ele 1241 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1241sec1.out -time -ele 1241 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1241sec$np.out -time -ele 1241 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1241sec$np.out -time -ele 1241 section $np deformation; # section deformations, axial and curvature, node j


recorder Element -file $dataDir/ForceEleBeam1321sec1.out -time -ele 1321 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1321sec1.out -time -ele 1321 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1321sec$np.out -time -ele 1321 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1321sec$np.out -time -ele 1321 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleBeam1331sec1.out -time -ele 1331 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1331sec1.out -time -ele 1331 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1331sec$np.out -time -ele 1331 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1331sec$np.out -time -ele 1331 section $np deformation; # section deformations, axial and curvature, node j

recorder Element -file $dataDir/ForceEleBeam1341sec1.out -time -ele 1341 section 1 force; # section forces, axial and moment, node i
recorder Element -file $dataDir/DefoEleBeam1341sec1.out -time -ele 1341 section 1 deformation; # section deformations, axial and curvature, node i
recorder Element -file $dataDir/ForceEleBeam1341sec$np.out -time -ele 1341 section $np force; # section forces, axial and moment, node j
recorder Element -file $dataDir/DefoEleBeam1341sec$np.out -time -ele 1341 section $np deformation; # section deformations, axial and curvature, node j

# Define DISPLAY -------------------------------------------------------------
set xPixels 1200; # height of graphical window in pixels
set yPixels 800; # height of graphical window in pixels
set xLoc1 10; # horizontal location of graphical window (0=upper left-most corner)
set yLoc1 10; # vertical location of graphical window (0=upper left-most corner)
set ViewScale 1; # scaling factor for viewing deformed shape, it depends on the dimensions of the model
DisplayModel3D DeformedShape $ViewScale $xLoc1 $yLoc1 $xPixels $yPixels
#recorder plot $dataDir/DFree.out Displ-X [expr $xPixels+10] 10 300 300 -columns 2 1; # a window to plot the nodal displacements versus time

#recorder plot DFree.out Displ-X [expr $xPixels+10] 10 300 300 -columns 2 1; # a window to plot the nodal displacements versus time

# recorder plot Node51.out Node9_14_19_Xdisp 1210 10 300 300 -columns 1 2 -columns 1 4 -columns 1 6 -dT 1.0

# Create the system of equation, a SPD using a band storage scheme
system SparseGeneral;

# Create the DOF numberer, the reverse Cuthill-McKee algorithm
numberer RCM

# Create the constraint handler, a Plain handler is used as homo constraints
constraints Transformation

# Create the integration scheme, the LoadControl scheme using steps of 1.0
integrator LoadControl 1.0

# Create the solution algorithm, a Linear algorithm is created
algorithm Linear
#algorithm Newton

# create the analysis object
analysis Static

# ------------------------------
# Finally perform the analysis
# ------------------------------

# Perform the analysis
analyze 1

puts "End of Static Analysis"


# //////////////////////////////////
# rotSect2DModIKModel.tcl

proc rotSect2DModIKModel {eleID E A K asPos asNeg MyPos MyNeg LS LK LA LD cS cK cA cD th_pP th_pN th_pcP th_pcN ResP ResN th_uP th_uN DP DN} {

# Create the material and section
uniaxialMaterial Bilin $eleID $K $asPos $asNeg $MyPos $MyNeg $LS $LK $LA $LD $cS $cK $cA $cD $th_pP $th_pN $th_pcP $th_pcN $ResP $ResN $th_uP $th_uN $DP $DN;
uniaxialMaterial Elastic [expr 10*$eleID + 1] [expr $E*$A]; # this is not used as a material, this is an axial-force-strain response
section Aggregator $eleID [expr 10*$eleID + 1] P $eleID Mz; # combine axial and flexural behavior into one section (no P-M interaction here)

}

Post Reply