NEW SCRIPT -- static analysis: pushover or cyclic

If you have a script you think might be useful to others post it
here. Hopefully we will be able to get the most useful of these incorporated in the manuals.

Moderators: silvia, selimgunay, Moderators

silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

NEW SCRIPT -- static analysis: pushover or cyclic

Post by silvia » Fri Feb 03, 2006 11:14 am

All,
here is a useful script for doing static analysis, with some useful options.
It may seem complicated, but i think it is pretty handy.

This script requires careful review, you may need to modify it to satisfy your model. i used it for a single degree-of-freedom problem (see bottom).
The script should be self explanatory. As you can see, you need to define variables ahead of time.
here is the main script, I call the file analysisStatic.tcl:
# ------------------------------------------------------------------
# AnalysisStatic.tcl
# Silvia Mazzoni, 2006
#

source libStaticAnalysis.tcl

if {$AnalysisTypeTXT=="Push" } {
set iDmaxCycl 0.11
set fact $Lcol
set CycleType Push
set Ncycles 1
} elseif {$AnalysisTypeTXT=="Cycl" } {
set iDmaxCycl "[expr 0.001] [expr 0.005] [expr 0.01] [expr 0.025] [expr 0.05] [expr 0.075] [expr 0.09] [expr 0.11]"
set fact $Lcol
set CycleType Full
set Ncycles 1
} else {
puts "No Analysis Type Specified"
return
}


# create load pattern for lateral loads
pattern Plain $loadIDstatic Linear {
foreach IDpushNode $iIDpushNode PushNodeFact $iPushNodeFact {
set Hload [expr $Weight*$PushNodeFact]
load $IDpushNode $Hload 0.0 0.0 0.0 0.0 0.0
}
}


procStaticAnalysis $iDmaxCycl $IDctrlNode $IDctrlDOF $CycleType $Ncycles $fact
as you can see, this file calls the procedure-defining file: libStaticAnalysis.tcl, please note that there are two procedure in this file:
# ------------------------------------------------------------------
# libStaticAnalysis.tcl: static push or cyclic lateral-load cycles
# Silvia Mazzoni, 2006

proc procGenPeaks {Dmax Nsteps {CycleType "Full"} {Fact 1} } {; # generate peaks for full Cycles
file mkdir data
set outFileID [open data/tmpDsteps.tcl w]

set Disp 0.
puts $outFileID "set iDstep { "
puts $outFileID $Disp
puts $outFileID $Disp

set Dmax [expr $Dmax*$Fact]; # scale value

set dx [expr $Dmax/$Nsteps]
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to one
set Disp [expr $Disp + $dx]
puts $outFileID $Disp
}

if {$CycleType !="Push"} {

for {set i 1} {$i <= $Nsteps} {incr i 1} {; # one to zero
set Disp [expr $Disp - $dx]
puts $outFileID $Disp
}
if {$CycleType !="HalfCycle"} {
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to minus one
set Disp [expr $Disp - $dx]
puts $outFileID $Disp
}
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # minus one to zero
set Disp [expr $Disp + $dx]
puts $outFileID $Disp
}
}
}

puts $outFileID " }"

close $outFileID
source data/tmpDsteps.tcl
return $iDstep
}

# ------------------------------------------------------------------

# run different analyses to find convergence for displacement-driven analysis
proc procConvergeStatic {ok} {
# if analysis fails, we try some other stuff
# performance is slower inside this loop

if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
test NormDispIncr 1.0e-6 200 0
algorithm Newton -initial
set ok [analyze 1]
test NormDispIncr 1.0e-6 20 0
algorithm Newton
}


if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch .8
set ok [analyze 1]
algorithm Newton
}
return $ok
}

#--------------------------------------------------------------------------------------#

proc procStaticAnalysis {iDmaxCycl IDctrlNode IDdof {CycleType "Full"} {Ncycles 1} {Fact 1} } {
foreach Dmax $iDmaxCycl {
set iDstep [procGenPeaks $Dmax [set Nsteps 50] $CycleType $Fact]; # this proc is defined above
for {set i 1} {$i <= $Ncycles} {incr i 1} {
set zeroD 0
set D0 0.0
foreach Dstep $iDstep {
set D1 $Dstep
set Dincr [expr $D1 - $D0]

# set up analysis parameters
set Tol 1.0e-6
constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral
test NormDispIncr $Tol 6; # tolerance, max no. of iterations, and print code , 1: every iteration
algorithm Newton;# use Newton's solution algorithm: updates tangent stiffness at every iteration
integrator LoadControl 0.1 1 0.1 0.1; # variable load-stepping: Do initial incr., desred no. of iterations to converge, Dmax, Dmin
analysis Static
integrator DisplacementControl $IDctrlNode $IDdof $Dincr

set ok [analyze 1]
if {$ok != 0} {
# set inFileIDa [open Data/Log.txt a]; puts $inFileIDa FailedToConverge;close $inFileIDa
set ok [procConvergeStatic $ok]; # this proc is defined above
if {$ok != 0} {
return -1
}
}; # end if statement
set D0 $D1
}; # end Dstep

}; # end i
}; # end of iDmaxCycl
return $ok
}
here is an example of where i use it for a cantilever column:

# --------------------------------------------------------------------------------------------------
# buildCantilever.tcl: generates frame nodes/materials/sections/elements
# by Silvia Mazzoni, 2005
#
# ^Y
# |
# _ node 2
# | |
# | |
# | |
# | Lcol
# | |
# | |
# | |
# === - node 1 ---------->X
#
#
wipe; # clear memory of all past model definitions
# Define the model builder
model BasicBuilder -ndm 2 -ndf 3

# define element geometry
set Lcol [expr 36*$ft]; # column length

# Define nodes
# tag X Y
node 1 0 0
node 2 0 $Lcol

set IDdispNode 2; # define displacement output node
set IDbaseNode 1; # define base node
set IDctrlNode 2; # define control node for pushover analysis and stuff
set iIDpushNode {2}; # define control node for pushover analysis -- lateral load application
set iPushNodeFact { 1.0 }; # scale factor for lateral load at this story.
set Lpush $Lcol; # define building height for pushover drift
set IDctrlDOF 1; # lateral dof

# Single point constraints -- Boundary Conditions
# node DX DY RZ
fix 1 1 1 1

...... define elements and such....

source AnalysisStatic.tcl
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104

decmaven
Posts: 1
Joined: Tue Jul 03, 2012 5:20 am
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by decmaven » Tue Jul 03, 2012 5:27 am

Thank you so much! This is very helpful.

tonyt42
Posts: 1
Joined: Sun Jul 08, 2012 6:17 pm
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by tonyt42 » Tue Jul 10, 2012 8:16 am

Thanks Mate!

Helped me out.

Tony

ArtsyHome
Posts: 1
Joined: Fri Dec 21, 2012 1:09 pm
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by ArtsyHome » Fri Dec 21, 2012 1:11 pm

Awesome -thanks!

Sartist
Posts: 2
Joined: Thu Oct 16, 2014 2:58 am
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by Sartist » Fri Oct 17, 2014 3:38 am

Thanks.

pkante
Posts: 5
Joined: Mon Jun 14, 2004 10:27 pm
Location: University of Ljubljana, Faculty of Civil and Geodetic Engineering
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by pkante » Fri Dec 11, 2015 2:06 am

Dear Silvia Mazzoni,

I try to use your useful script to run cyclic statical analysis. It was successful for analyse in just ONE horizontal (X or Y) direction.
How could I change the "code" of your script if I want to do the cyclic analyses in BOTH horizontal (X and Y) direction, so that at first step I do analyses of one cycle in X direction, after that I want to do the analyses of second cycle in X direction.... and these procedure I want to do more time for X and Y direction...

I hope you understand what I mean.
I want to simulate the cyclic statical experiment, which was done in both horizontal (X and Y) directions one after another.

Thanks for your help.

BR,
Peter Kante

aahashib
Posts: 13
Joined: Thu Sep 10, 2015 9:21 am
Location: Texas A&M University

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by aahashib » Thu Dec 24, 2015 9:38 am

Hi!

How can I apply pushover load in two nodes? The beam I am modeling is supposed to be loaded in two points as it is shown in the actual test. I would be grateful if anyone would help me giving the answer. Thank you.

Kind Regards
Abdullah

hoangbo
Posts: 2
Joined: Mon Jan 25, 2016 8:44 pm
Location: Ho Chi Minh City, Vietnam
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by hoangbo » Mon Jan 25, 2016 9:00 pm

Awesome. It's very useful for me

takamatsukatz
Posts: 2
Joined: Fri Feb 26, 2016 11:53 pm
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by takamatsukatz » Sat Feb 27, 2016 12:03 am

Any information about applying pushover load in two nodes like aahashib was asking because I'm also trying to figure out whether I can do that with the script. But even still it's been very helpful.

pennyalgarin
Posts: 1
Joined: Sat Feb 27, 2016 5:49 pm
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by pennyalgarin » Sat Feb 27, 2016 5:56 pm

Hello :)
I attempt to utilize your valuable script to run cyclic statical examination. It was fruitful for dissect in only ONE even (X or Y) course.

How might I be able to change the "code" of your script in the event that I need to do the cyclic examinations in BOTH level (X and Y) heading, so that at initial step I do investigations of one cycle in X course, after that I need to do the examinations of second cycle in X direction.... what's more, these technique I need to accomplish more opportunity for X and Y heading...
Very tnx for your resource

meetrv
Posts: 2
Joined: Wed Mar 30, 2016 10:52 am
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by meetrv » Wed Mar 30, 2016 10:54 am

indeed a great answer.

adirakreditmobil
Posts: 1
Joined: Thu Mar 31, 2016 9:21 am
Location: indonesia
Contact:

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by adirakreditmobil » Thu Mar 31, 2016 9:25 am

this very difficult

seraphpan
Posts: 3
Joined: Wed Sep 11, 2013 8:18 pm
Location: UBC

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by seraphpan » Fri Apr 08, 2016 6:26 pm

Dear Silvia

Thanks for your scripts. I am starting to do a reverse cyclic analysis on a SDOF bridge pier model where a zerolength Pinching4 hinge is built at base. I modified the codes based on my own model but the analysis failed at initial iteration. I attached the scripts and hopefully you could provide some helps or comments.

Thanks in advance!

Here is the scripts:

# --------------------------------------------------------------------------------------------------
# 2D Bridge Pier SDOF-- Static Reversed-Cyclic Analysis
# Seraph, 2016
# --------------------------------------------------------------------------------------------------
# ^Y
# |
# 2_
# |
# |
# |
# |
# |
# |3
# |
# =1=
# |---------------------------- >X
#

# SET UP ----------------------------------------------------------------------------
wipe; # clear memory of all past model definitions
model BasicBuilder -ndm 2 -ndf 3; # Define the model builder, ndm=#dimension, ndf=#dofs
set dataDir OutputData; # set up name of data directory
file mkdir $dataDir; # create data directory

set LunitTXT "m";
###################################################################################################
# Define Building Geometry, Nodes, and Constraints
###################################################################################################

set Lcol 7.32; # Pier Height 7.32m

node 1 0 0 ;
node 2 0 $Lcol; # Heigh of pier column [m]
node 3 0 0 ; # define zero-length element node

fix 1 1 1 1; # fixed boundary condition

set M 238; # 238 metric tons;
set PI [expr 2.0*asin(1.0)];
mass 2 $M 0 0;


###################################################################################################
# Define Section Properties and Elements
###################################################################################################

uniaxialMaterial Elastic 1 +2.9E+9

# ---------------------------------------------------------------------------------
# Backbone Definition #
set My_1P 5000;
set th_1P 0.0125;
set My_2P 6522;
set th_2P 0.05;
set My_3P 7525;
set th_3P 0.075;
set My_4P 500;
set th_4P 0.25;

set My_1N [expr -$My_1P];
set th_1N [expr -$th_1P];
set My_2N [expr -$My_2P];
set th_2N [expr -$th_2P];
set My_3N [expr -$My_3P];
set th_3N [expr -$th_3P];
set My_4N [expr -$My_4P];
set th_4N [expr -$th_4P];

# ---------------------------------------------------------------------------------
# Pinching Parameters Definition #
set rDispP 1;
set fForceP 1;
set uForceP 1;

set rDispN $rDispP;
set fForceN $fForceP;
set uForceN $uForceP;

# ---------------------------------------------------------------------------------
# Damage Parameters Definition # 2
set gK1 0;
set gK2 0;
set gK3 0;
set gK4 0;
set gKLim 0;

set gD1 0;
set gD2 0;
set gD3 0;
set gD4 0;
set gDLim 0;

set gF1 0;
set gF2 0;
set gF3 0;
set gF4 0;
set gFLim 0;

set gE 10;
set damage "energy";

uniaxialMaterial Pinching4 2 $My_1P $th_1P $My_2P $th_2P $My_3P $th_3P $My_4P $th_4P $My_1N $th_1N $My_2N $th_2N $My_3N $th_3N $My_4N $th_4N $rDispP $fForceP $uForceP $rDispN $fForceN $uForceN $gK1 $gK2 $gK3 $gK4 $gKLim $gD1 $gD2 $gD3 $gD4 $gDLim $gF1 $gF2 $gF3 $gF4 $gFLim $gE $damage


geomTransf PDelta 1
set Dir 1.22; #column diameter
set Area [expr $PI*$Dir*$Dir/4]; # area of the column

# Element "Rigid": eleTag NodeI NodeJ A E Iz geoTranTag
element elasticBeamColumn 1 3 2 $Area +2.900000E+9 +4.860000E+003 1
# Element "Hinge": eleTag NodeI NodeJ -mat -dir <-doRayleigh>
element zeroLength 2 1 3 -mat 1 1 2 -dir 1 2 6 -doRayleigh


# define GRAVITY -------------------------------------------------------------
timeSeries Linear 1 -factor 1
initialize

pattern Plain 1 1 {
load 2 0 0 0
}
set Tol 1.0e-8;
constraints Plain; # how it handles boundary conditions
numberer RCM; # renumber dof's to minimize band-width (optimization)
system BandGeneral; # how to store and solve the system of equations in the analysis (large model: try UmfPack)
test NormDispIncr 1.0e-6 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
integrator LoadControl 0.1; # determine the next time step for an analysis
analysis Static; # define type of analysis static or transient
analyze 10; # apply gravity

# maintain constant gravity loads and reset time to zero
loadConst -time 0.0

puts "Model Built";


# Node Recorder "DefoShape": fileName <nodeTag> dof respType
recorder Node -file $dataDir/Dsp.out -time -node 2 -dof 1 2 3 disp; # displacements of free nodes

# ZeroLength Recorder "hinge": fileName <eleTag> arguments
recorder Element -file $dataDir/BasForc.out -time -ele 2 basicForce; # element forces -- ZeroLength
recorder Element -file $dataDir/BasDefo.out -time -ele 2 deformation; # element deformations -- zeroLength

source AnalysisStatic.tcl

# ------------------------------------------------------------------
# AnalysisStatic.tcl
# Silvia Mazzoni, 2006
#

# we need to set up parameters that are particular to the model.
set IDctrlNode 2; # node where displacement is read for displacement control
set IDctrlDOF 1; # degree of freedom of displacement read for displacement control
set IDdispNode 2; # define displacement output node
set IDbaseNode 1; # define base node

# --------------------------------- perform Static Cyclic Displacements Analysis

set AnalysisTypeTXT Cycl;

source libStaticAnalysis.tcl

if {$AnalysisTypeTXT=="Push" } {
set iDmaxCycl 0.11
set fact $Lcol
set CycleType Push
set Ncycles 1
} elseif {$AnalysisTypeTXT=="Cycl" } {
set iDmaxCycl "[expr 0.001] [expr 0.005] [expr 0.01] [expr 0.025] [expr 0.05] [expr 0.075] [expr 0.09] [expr 0.11]"
set fact $Lcol
set CycleType Full
set Ncycles 1
} else {
puts "No Analysis Type Specified"
return
}

procStaticAnalysis $iDmaxCycl $IDctrlNode $IDctrlDOF $CycleType $Ncycles $fact

# ------------------------------------------------------------------
# libStaticAnalysis.tcl: static push or cyclic lateral-load cycles
# Silvia Mazzoni, 2006
# ------------------------------------------------------------------
# libStaticAnalysis.tcl: static push or cyclic lateral-load cycles
# Silvia Mazzoni, 2006


proc procGenPeaks {Dmax Nsteps {CycleType "Full"} {Fact 1} } {; # generate peaks for full Cycles
file mkdir data
set outFileID [open data/tmpDsteps.tcl w]

set Disp 0.
puts $outFileID "set iDstep { "
puts $outFileID $Disp
puts $outFileID $Disp

set Dmax [expr $Dmax*$Fact]; # scale value

set dx [expr $Dmax/$Nsteps]
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to one
set Disp [expr $Disp + $dx]
puts $outFileID $Disp
}

if {$CycleType !="Push"} {

for {set i 1} {$i <= $Nsteps} {incr i 1} {; # one to zero
set Disp [expr $Disp - $dx]
puts $outFileID $Disp
}
if {$CycleType !="HalfCycle"} {
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to minus one
set Disp [expr $Disp - $dx]
puts $outFileID $Disp
}
for {set i 1} {$i <= $Nsteps} {incr i 1} {; # minus one to zero
set Disp [expr $Disp + $dx]
puts $outFileID $Disp
}
}
}

puts $outFileID " }"

close $outFileID
source data/tmpDsteps.tcl
return $iDstep
}

# ------------------------------------------------------------------

# run different analyses to find convergence for displacement-driven analysis
proc procConvergeStatic {ok} {
# if analysis fails, we try some other stuff
# performance is slower inside this loop

if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
test NormDispIncr 1.0e-6 200 0
algorithm Newton -initial
set ok [analyze 1]
test NormDispIncr 1.0e-6 20 0
algorithm Newton
}


if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch .8
set ok [analyze 1]
algorithm Newton
}
return $ok
}

#--------------------------------------------------------------------------------------#

proc procStaticAnalysis {iDmaxCycl IDctrlNode IDdof {CycleType "Full"} {Ncycles 1} {Fact 1} } {
foreach Dmax $iDmaxCycl {
set iDstep [procGenPeaks $Dmax [set Nsteps 50] $CycleType $Fact]; # this proc is defined above
for {set i 1} {$i <= $Ncycles} {incr i 1} {
set zeroD 0
set D0 0.0
foreach Dstep $iDstep {
set D1 $Dstep
set Dincr [expr $D1 - $D0]

# set up analysis parameters
set Tol 1.0e-6
constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral
test NormDispIncr $Tol 6; # tolerance, max no. of iterations, and print code , 1: every iteration
algorithm Newton;# use Newton's solution algorithm: updates tangent stiffness at every iteration
integrator LoadControl 0.1 1 0.1 0.1; # variable load-stepping: Do initial incr., desred no. of iterations to converge, Dmax, Dmin
analysis Static
integrator DisplacementControl $IDctrlNode $IDdof $Dincr

set ok [analyze 1]
if {$ok != 0} {
# set inFileIDa [open Data/Log.txt a]; puts $inFileIDa FailedToConverge;close $inFileIDa
set ok [procConvergeStatic $ok]; # this proc is defined above
if {$ok != 0} {
return -1
}
}; # end if statement
set D0 $D1
}; # end Dstep

}; # end i
}; # end of iDmaxCycl
return $ok
}



Best regards,
Seraph

FrankZhao
Posts: 2
Joined: Fri Nov 27, 2015 12:59 am
Location: Curtin University

Re: NEW SCRIPT -- static analysis: pushover or cyclic

Post by FrankZhao » Sun May 08, 2016 4:17 pm

Dear seraphpan,

As I can see, if you want to use the zerolength with pinching4, you must define the EqualDOF.

Kainaat
Posts: 5
Joined: Mon Mar 07, 2016 2:24 am
Location: NED University of Engineering and Technology

Cyclic Analysis shows zero displacement

Post by Kainaat » Tue Jul 19, 2016 8:47 am

Hello,

I am doing static cyclic analyses on a portal frame by using opensees examples. I have modified the model as per my requirements but after the model runs it shows zero displacement. What am I doing wrong?

Post Reply