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
Search found 3 matches
- Fri Apr 08, 2016 6:26 pm
- Forum: Useful Scripts.
- Topic: NEW SCRIPT -- static analysis: pushover or cyclic
- Replies: 22
- Views: 47153
- Mon Sep 28, 2015 2:25 pm
- Forum: OpenSees.exe Users
- Topic: Elastic Response Spectra Script
- Replies: 27
- Views: 245860
Re: Elastic Response Spectra Script
fawadnajam wrote:
> How can this script be modified to get inelastic spectrum? I want to model elastoplastic
> and flag-shaped behaviors and want to get peak displacements of SDOFs.
Hi Fawadnajam,
How's your work now? Have you successfully plot the inelastic spectra? I am trying to do similar stuff and kinda confused for a long time.
Thanks
Seraph
> How can this script be modified to get inelastic spectrum? I want to model elastoplastic
> and flag-shaped behaviors and want to get peak displacements of SDOFs.
Hi Fawadnajam,
How's your work now? Have you successfully plot the inelastic spectra? I am trying to do similar stuff and kinda confused for a long time.
Thanks
Seraph
- Sat Sep 21, 2013 11:15 pm
- Forum: OpenSees.exe Users
- Topic: hysteretic material
- Replies: 5
- Views: 4779
Re: hysteretic material
Hi prof, where can i find source code?
Thanks
mhscott wrote:
> See this page for the effects of changing the pinching parameters
>
> http://opensees.berkeley.edu/OpenSees/m ... l/4052.htm
>
> If you need the exact equations, see the source code
Thanks
mhscott wrote:
> See this page for the effects of changing the pinching parameters
>
> http://opensees.berkeley.edu/OpenSees/m ... l/4052.htm
>
> If you need the exact equations, see the source code