why the record in the lastest version no headings and all
Moderators: silvia, selimgunay, Moderators
why the record in the lastest version no headings and all
the higher version should be compatible with the lower version.version 1.7.2 has recorders with options -headings -all
I found some opensees code,such as the codes with PEER report by PH.D.Mackie and his colleagues, that can work well in 1.7.2 ,can not run on platform version 2 and above.
why?
I read and run the code for PEER 2008/03 - Guidelines for Nonlinear Analysis of Bridge Structures in California
(http://peer.berkeley.edu/publications/p ... _2008.html).
thanks!
I found some opensees code,such as the codes with PEER report by PH.D.Mackie and his colleagues, that can work well in 1.7.2 ,can not run on platform version 2 and above.
why?
I read and run the code for PEER 2008/03 - Guidelines for Nonlinear Analysis of Bridge Structures in California
(http://peer.berkeley.edu/publications/p ... _2008.html).
thanks!
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
first, the recorder in version 2.3.2 is not compatible with that in version 1.7.2 on the options headings and all...
but when I remove them, I still met new warning.
but when I remove them, I still met new warning.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
now I run static analysis only, and found the data lines in the XXXXfy_cols.out from version 2.3.2 is 17 lines less than that from version 1.7.2. I am trying to find out the reason.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
Add "wipe" command at the end of analysis and your problem should be solved.
Re: why the record in the lastest version no headings and al
Thanks for your help again, Vesna.
I would try wipe command more carefully.
In fact, I have added this command in records.tcl or after soucing ModelS.tcl.
Well, it doesn't work.
the problem is that static analysis in 2.3.2 can not provide enough data for dynamic analysis as that in 1.7.2.
The dynamic analysis can't complete and stop with a warning.
the warning indicates something wrong with a Yield-processing file, the code give warning with not enough column data.
then I found there are 17 lines less in 2.3.2.
I am mainly trying to run through the example of R14. and all of the example codes can work in 1.7.2.
thanks again.
I would try wipe command more carefully.
In fact, I have added this command in records.tcl or after soucing ModelS.tcl.
Well, it doesn't work.
the problem is that static analysis in 2.3.2 can not provide enough data for dynamic analysis as that in 1.7.2.
The dynamic analysis can't complete and stop with a warning.
the warning indicates something wrong with a Yield-processing file, the code give warning with not enough column data.
then I found there are 17 lines less in 2.3.2.
I am mainly trying to run through the example of R14. and all of the example codes can work in 1.7.2.
thanks again.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
vesna wrote:
> Add "wipe" command at the end of analysis and your problem should
> be solved.
when I revise region command and delete the options of headings and all, the Static analysis can work.
But the dynamic analysis shows some errors below , I guess it may come from region definition.
errors:NodeRecorder::NodeRecorder - dataTostore12 not recognized (disp,vel,accel,incrDisp,incrDeltaDisp)
[code]# Recorders.tcl: generic static pushover shell for use with all models
# Units: kN, m
# Kevin Mackie, 2005/11/16
# version 1.0.4
# mackie@ce.berkeley.edu
#
# Recorders for bridge common to all analysis types
# Modify this file to include recorders for other element/materials/etc that
# you add to the bridge model
# record column top nodes
recorder Node -file [format "output/%snd_colt.out" $fstub] -headings -region 12 -dof 1 2 3 4 5 6 disp
recorder Node -file [format "output/%snd_colb.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 disp
#recorder Node -file [format "output/%snr_colt.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 reaction
recorder NodeEnvelope -file [format "output/%sne_colt.out" $fstub] -headings -region 12 -dof 1 2 3 4 5 6 disp
recorder NodeEnvelope -file [format "output/%sne_colb.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 disp
recorder Drift -file [format "output/%sdX_cols.out" $fstub] -headings -iNode [expr $shift+100] [expr $shift+110] \
-jNode [expr $shift+35] [expr $shift+40] -dof 1 -perpDirn 2
recorder Drift -file [format "output/%sdY_cols.out" $fstub] -headings -iNode [expr $shift+100] [expr $shift+110] \
-jNode [expr $shift+35] [expr $shift+40] -dof 3 -perpDirn 2
# record deck nodes
recorder Node -file [format "output/%snd_deck.out" $fstub] -headings -region 11 -dof 1 2 3 4 5 6 disp
recorder NodeEnvelope -file [format "output/%sne_deck.out" $fstub] -headings -region 11 -dof 1 2 3 4 5 6 disp
recorder Drift -file [format "output/%sdY_deck.out" $fstub] -headings -iNode [expr $shift+10] [expr $shift+20] [expr $shift+30] \
[expr $shift+40] [expr $shift+50] -jNode [expr $shift+20] [expr $shift+30] [expr $shift+40] [expr $shift+50] [expr $shift+60] -dof 3 -perpDirn 1
# record column elements
recorder Element -file [format "output/%sel_colb.out" $fstub] -headings -region 2 section 1 forceAndDeformation
recorder ElementEnvelope -file [format "output/%see_colb.out" $fstub] -headings -region 2 section 1 forceAndDeformation
recorder Element -file [format "output/%sel_colt.out" $fstub] -headings -region 2 section 5 forceAndDeformation
recorder ElementEnvelope -file [format "output/%see_colt.out" $fstub] -headings -region 2 section 5 forceAndDeformation
recorder Element -file [format "output/%sef_colb.out" $fstub] -headings -region 2 globalForce
recorder ElementEnvelope -file [format "output/%sem_colb.out" $fstub] -headings -region 2 globalForce
# record deck elements
recorder Element -file [format "output/%sel_deck.out" $fstub] -headings -region 1 globalForce
recorder ElementEnvelope -file [format "output/%see_deck.out" $fstub] -headings -region 1 globalForce
# obtain any global variables if needed
upvar abutType abut_local
# Roller Abutment
recorder Node -file [format "output/%snr_deck.out" $fstub] -region 11 -dof 1 2 3 4 5 6 reaction
if { $abut_local > 1 } {
# record left abutment
recorder Node -file [format "output/%snd_labt.out" $fstub] -headings -region 201 -dof 1 2 3 disp
recorder NodeEnvelope -file [format "output/%sne_labt.out" $fstub] -headings -region 201 -dof 1 2 3 disp
recorder Element -file [format "output/%sel_labt.out" $fstub] -headings -region 200 deformationANDforces
recorder ElementEnvelope -file [format "output/%see_labt.out" $fstub] -headings -region 200 deformationANDforces
# record right abutment
recorder Node -file [format "output/%snd_rabt.out" $fstub] -headings -region 301 -dof 1 2 3 disp
recorder NodeEnvelope -file [format "output/%sne_rabt.out" $fstub] -headings -region 301 -dof 1 2 3 disp
recorder Element -file [format "output/%sel_rabt.out" $fstub] -headings -region 300 deformationANDforces
recorder ElementEnvelope -file [format "output/%see_rabt.out" $fstub] -headings -region 300 deformationANDforces
}
# pattern recorder
recorder Node -file [format "output/%snd_time.out" $fstub] -headings -time -node [expr $shift+30] [expr $shift+40] -dof 1 2 3 disp
# Display recorders
if { $disp == 1 } {
recorder display "Bridge Vert" 110 200 500 500 -wipe
prp 50 50 50
vup 0 1 0
vpn 2 -1 1
viewWindow -60 60 -60 60
display 1 2 10
recorder display "Bridge Long" 110 100 400 100 -wipe
prp 50 50 50
vup 0 1 0
vpn 0 0 1
viewWindow -150 150 -15 15
display 1 2 10
recorder display "Bridge Trans" 510 100 100 100 -wipe
prp 50 50 50
vup 0 1 0
vpn -1 0 0
viewWindow -15 15 -15 15
display 1 2 10
# recorder plot output/sl0001nd_time.out "Pushover curve" 600 200 300 300 -columns [expr $shift+1] [expr $shift+2]
}[/code]
> Add "wipe" command at the end of analysis and your problem should
> be solved.
when I revise region command and delete the options of headings and all, the Static analysis can work.
But the dynamic analysis shows some errors below , I guess it may come from region definition.
errors:NodeRecorder::NodeRecorder - dataTostore12 not recognized (disp,vel,accel,incrDisp,incrDeltaDisp)
[code]# Recorders.tcl: generic static pushover shell for use with all models
# Units: kN, m
# Kevin Mackie, 2005/11/16
# version 1.0.4
# mackie@ce.berkeley.edu
#
# Recorders for bridge common to all analysis types
# Modify this file to include recorders for other element/materials/etc that
# you add to the bridge model
# record column top nodes
recorder Node -file [format "output/%snd_colt.out" $fstub] -headings -region 12 -dof 1 2 3 4 5 6 disp
recorder Node -file [format "output/%snd_colb.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 disp
#recorder Node -file [format "output/%snr_colt.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 reaction
recorder NodeEnvelope -file [format "output/%sne_colt.out" $fstub] -headings -region 12 -dof 1 2 3 4 5 6 disp
recorder NodeEnvelope -file [format "output/%sne_colb.out" $fstub] -headings -region 13 -dof 1 2 3 4 5 6 disp
recorder Drift -file [format "output/%sdX_cols.out" $fstub] -headings -iNode [expr $shift+100] [expr $shift+110] \
-jNode [expr $shift+35] [expr $shift+40] -dof 1 -perpDirn 2
recorder Drift -file [format "output/%sdY_cols.out" $fstub] -headings -iNode [expr $shift+100] [expr $shift+110] \
-jNode [expr $shift+35] [expr $shift+40] -dof 3 -perpDirn 2
# record deck nodes
recorder Node -file [format "output/%snd_deck.out" $fstub] -headings -region 11 -dof 1 2 3 4 5 6 disp
recorder NodeEnvelope -file [format "output/%sne_deck.out" $fstub] -headings -region 11 -dof 1 2 3 4 5 6 disp
recorder Drift -file [format "output/%sdY_deck.out" $fstub] -headings -iNode [expr $shift+10] [expr $shift+20] [expr $shift+30] \
[expr $shift+40] [expr $shift+50] -jNode [expr $shift+20] [expr $shift+30] [expr $shift+40] [expr $shift+50] [expr $shift+60] -dof 3 -perpDirn 1
# record column elements
recorder Element -file [format "output/%sel_colb.out" $fstub] -headings -region 2 section 1 forceAndDeformation
recorder ElementEnvelope -file [format "output/%see_colb.out" $fstub] -headings -region 2 section 1 forceAndDeformation
recorder Element -file [format "output/%sel_colt.out" $fstub] -headings -region 2 section 5 forceAndDeformation
recorder ElementEnvelope -file [format "output/%see_colt.out" $fstub] -headings -region 2 section 5 forceAndDeformation
recorder Element -file [format "output/%sef_colb.out" $fstub] -headings -region 2 globalForce
recorder ElementEnvelope -file [format "output/%sem_colb.out" $fstub] -headings -region 2 globalForce
# record deck elements
recorder Element -file [format "output/%sel_deck.out" $fstub] -headings -region 1 globalForce
recorder ElementEnvelope -file [format "output/%see_deck.out" $fstub] -headings -region 1 globalForce
# obtain any global variables if needed
upvar abutType abut_local
# Roller Abutment
recorder Node -file [format "output/%snr_deck.out" $fstub] -region 11 -dof 1 2 3 4 5 6 reaction
if { $abut_local > 1 } {
# record left abutment
recorder Node -file [format "output/%snd_labt.out" $fstub] -headings -region 201 -dof 1 2 3 disp
recorder NodeEnvelope -file [format "output/%sne_labt.out" $fstub] -headings -region 201 -dof 1 2 3 disp
recorder Element -file [format "output/%sel_labt.out" $fstub] -headings -region 200 deformationANDforces
recorder ElementEnvelope -file [format "output/%see_labt.out" $fstub] -headings -region 200 deformationANDforces
# record right abutment
recorder Node -file [format "output/%snd_rabt.out" $fstub] -headings -region 301 -dof 1 2 3 disp
recorder NodeEnvelope -file [format "output/%sne_rabt.out" $fstub] -headings -region 301 -dof 1 2 3 disp
recorder Element -file [format "output/%sel_rabt.out" $fstub] -headings -region 300 deformationANDforces
recorder ElementEnvelope -file [format "output/%see_rabt.out" $fstub] -headings -region 300 deformationANDforces
}
# pattern recorder
recorder Node -file [format "output/%snd_time.out" $fstub] -headings -time -node [expr $shift+30] [expr $shift+40] -dof 1 2 3 disp
# Display recorders
if { $disp == 1 } {
recorder display "Bridge Vert" 110 200 500 500 -wipe
prp 50 50 50
vup 0 1 0
vpn 2 -1 1
viewWindow -60 60 -60 60
display 1 2 10
recorder display "Bridge Long" 110 100 400 100 -wipe
prp 50 50 50
vup 0 1 0
vpn 0 0 1
viewWindow -150 150 -15 15
display 1 2 10
recorder display "Bridge Trans" 510 100 100 100 -wipe
prp 50 50 50
vup 0 1 0
vpn -1 0 0
viewWindow -15 15 -15 15
display 1 2 10
# recorder plot output/sl0001nd_time.out "Pushover curve" 600 200 300 300 -columns [expr $shift+1] [expr $shift+2]
}[/code]
Last edited by kengawk on Tue Apr 24, 2012 8:16 pm, edited 2 times in total.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
vesna wrote:
> Add "wipe" command at the end of analysis and your problem should
> be solved.
1
why? when I use wipe before the procedure FyUy, the 'floc2' variable can not be read.
2
I revised the headings and all, the produre can work well in 1.7.2. but still have that problem. this time the sl0001fy_cols.out from recorder.tcl in 2.3.2 or 2.2.2 has 9 lines less than that in 1.7.2. I am going to check the procedure that generate sl0001fy_cols.out, maybe simply the YieldFiles.tcl.
1
# Transient.tcl: sets up and runs arbitrary transient run
# Units: kN, m
# Kevin Mackie, 2006/05/24
# version 1.0.5
# mackie@ce.berkeley.edu
#
# Takes all parameters from ModelD.tcl and runs transient analysis.
# Allows multiple runs on same record as required for IDA
# Performs Earthquake excitation transient analysis, including modal as necessary
#
# INPUT 1. <params> parameter tag identifying analysis
# 2. <stype> empty
# 3. <components> 1 for uniaxial excitation, 3 for 3D excitation
# 4. <eqk_num> number of earthquake in current bin
# 5. <ida> 1 for IDA, 0 otherwise
# 6. <level> scale factor to use in this analysis
# 7. <ida_cnt> step increment number in IDA analysis
# 8. <fn> filename of fault normal motion, assigned to global X
# 9. <fp> filename of fault parallel motion, assigned to global Z
# 10. <fv> filename of vertical motion, assigned to global Y
# 11. <binfo> additional information passed from GenerateBridge.tcl
# 12. <fyl> yield strength (actually max) from longitudinal pushover of bridge (k)
# 13. <fyt> yield strength (actually max) from transverse pushover of bridge (k)
proc Transient {params stype components eqk_num ida level ida_cnt fn fp fv binfo fyl fyt} {
puts "__sourcing analysis/Transient.tcl now!!!"
scan $binfo "%f %u %u" temp numCols shift
set mnode [expr $shift+30]
set g 9.806
set pi [expr acos(-1.0)]
set damping_ratio 0.03
set disp 0
# load ground motion data parameters
set file [open [format "%s.info" $fn] "r"]
set line [gets $file]
scan $line "%i %lf %u" points dt eqk_filein
close $file
set filen [format "%s.data" $fn]
set filep [format "%s.data" $fp]
set filev [format "%s.data" $fv]
# in case of aftershock, reset recorders
#remove recorders
#loadConst -time 0.0
# determine record scaling relative to a given intensity at Sa(T1)
# level variable is a modifier on this value, just worry about what happens when
# sf=2 for PSDA and what happens in Combine.tcl
# -----------------------------------------------------
# Perform Earthquake excitation transient analysis
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
# Perform gravity load analysis
source "utilities/Gravity.tcl"
set dx [nodeDisp $mnode 1]; set dy [nodeDisp $mnode 2]; set dz [nodeDisp $mnode 3];
puts "node $mnode: [format "dx=%1.5e dy=%1.5e dz=%1.5e" $dx $dy $dz]"
# -----------------------------------------------------
# Perform eigen analysis (initial stiffness)
set numModes 5
for { set k 1 } { $k <= $numModes } { incr k } {
puts "nummodes is $k!"
#####the following line is original
# recorder Node -file [format "modes/mode%i.out" $k] -node all -dof 1 2 3 "eigen $k"
#ok_numModes recoder Node - error -all option has been removed, use -nodeRange instaed -1 -node -region 11 12 13 200 201 301
#
recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k"
recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"
recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k"
}
puts " $components"
if { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt([lindex $eigenvalues 0])]
set omega2 [expr sqrt([lindex $eigenvalues 1])]
set T1 [expr 2.0*$pi/$omega1]
set T2 [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1 1.0
set T2 2.0
}
# ok_in_transient.tcl
remove recorders
# reset time in time domain
loadConst -time 0.0
# setup recorders for the bridge
source "Analysis/Recorders.tcl"
if { $components == 1 } {
set savePath ./data/bins/$params/$eqk_num
file mkdir $savePath
source soil_foundation/923_recordEQ_soil.tcl
source soil_foundation/912_display.tcl
}
# Record fiber stress and strain at max location
#for {set i 20} {$i < $conc_fibers} {incr i} {
# recorder Element 1 -file [format "fibers/%sffc%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# Record fiber stress and strain at max location
#for {set i $conc_fibers} {$i < [expr $conc_fibers+$steel_fibers] } {incr i} {
# recorder Element 1 -file [format "fibers/%sffs%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# define earthquakes filename dt factor
set path1 "Path -filePath $filen -dt $dt -factor [expr $g*$level]"
set path2 "Path -filePath $filep -dt $dt -factor [expr $g*$level]"
set path3 "Path -filePath $filev -dt $dt -factor [expr $g*$level]"
# tag dir
pattern UniformExcitation 4 1 -accel $path1
if { $components == 3 } {
pattern UniformExcitation 5 3 -accel $path2
pattern UniformExcitation 6 2 -accel $path3
set alphaM [expr $damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set beta 0.5
set gamma 0.25
set betaK [expr $damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM 0.0
set betaK 0.01
set beta 0.6
set gamma 0.3025
}
# see if interpolating ground motion helps
#set dt [expr $dt/2.0]
#set points [expr $points*2]
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
integrator Newmark $beta $gamma
# tolerance maxIter displayCode
#test EnergyIncr 1.0e-10 50 0
test NormDispIncr 1.0e-6 50 0
algorithm KrylovNewton
numberer RCM
#constraints Plain
constraints Penalty 1.0e16 1.0e16
#system SparseGeneral -piv
#system BandGeneral
system ProfileSPD
initialize
analysis Transient
# attempt to analyze the complete record
set startT [clock seconds]
#set res [analyze $points $dt [expr $dt/100] $dt 10]
set res [analyze $points $dt]
set tFinal [expr $points * $dt]
# now check for failure and iterate as necessary to complete record
source "Analysis/NonConvergence.tcl"
# allow free vibration for several cycles under slightly higher damping
set freeVibSteps 800
if { $components == 3 } {
set alphaM [expr 2.0*$damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 2.0*$damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $freeVibSteps $dt]
set tFinal [expr ($points+$freeVibSteps)*$dt]
source "Analysis/NonConvergence.tcl"
# ramp up damping to attain residual displacement states
set dampedSteps 400
if { $components == 3 } {
set alphaM [expr 0.2*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 0.2*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $dampedSteps $dt]
set tFinal [expr ($points+$freeVibSteps+$dampedSteps)*$dt]
source "Analysis/NonConvergence.tcl"
if { $components == 3 } {
remove loadPattern 5
remove loadPattern 6
}
remove loadPattern 4
set endT [clock seconds]
puts "Execution time: [expr $endT-$startT] seconds."
#set maxLocs1 [MkDistr 1 $mkarg1 $fstub 1]
#puts $maxLocs1
#set maxLocs2 [MkDistr 1 $mkarg2 $fstub 2]
#puts $maxLocs2
# -----------------------------------------------------
# Perform eigen analysis (post earthquake stiffness)
# note: if res < 0, then we have "collapsed", so don't do the post-eigen
if { $res < 0 } {
set T1dmg 10.0
set T2dmg 10.0
} elseif { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt(abs([lindex $eigenvalues 0]))]
set omega2 [expr sqrt(abs([lindex $eigenvalues 1]))]
set T1dmg [expr 2.0*$pi/$omega1]
set T2dmg [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1dmg 1.0
set T2dmg 2.0
}
# ------------------------------------------------
# append ground motion specific data, ie Sd, Sa, etc
# using program cdm which uses central difference to compute
# spectral response quantities, generates information which is
# added to ground motion .info files
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
set imanal "../motion/imcdm"
# note fp in 3 dir : fn in 1 dir : fv in 2 dir
# exec $imanal $fn 1 $T1 $T2 $level $T1dmg $T2dmg $fyl
# exec $imanal $fp 3 $T1 $T2 $level $T1dmg $T2dmg $fyt
# exec $imanal $fv 2 $T1 $T2 $level $T1dmg $T2dmg [expr sqrt($fyl*$fyl+$fyt*$fyt)]
# end of analysis
# ------------------------------------------------
source "Analysis/AnalysisD.tcl"
# AnalysisD might modify the collapse variable based on maximum drift
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
# ------------------------------------------------
# remove dynamic recorder files to save space
# leave static files currently to check whether algorithm captured yield or not
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
#file delete [format "%snd08.out" $fstub]
#file delete [format "%snr011.out" $fstub]
#file delete [format "%snr015.out" $fstub]
#MkDistr 2 $mkarg1 $fstub 1
#MkDistr 2 $mkarg2 $fstub 2
puts $Treturn
return $Treturn
}
2
# YieldFiles.tcl: generates shear force-displacement column vectors <- AnalysisPushover.tcl
# Units: kip, in
# Kevin Mackie, 2005/11/17
# version 1.0.3
# mackie@ce.berkeley.edu
#
# Takes different recorder files for column shear and column displacement,
# and combines them into a single f-d style file. Note, takes displacements
# and forces from global files, so can also produce moment-rotation data.
#
# Takes into account the effect of having base rotation and translation;
# however, it should be noted that the drift recorders work independently and
# therefore may not give the "real" drift being sought if base rotation occurs.
# INPUT 1. <fstub> portion of filename to prepend (string)
# 2. <type> 1, 2, 3 for L, V, T directions, or -1 for all of them (3D)
# <type> 1, 2 for L, V directions, -1 for all of them (2D)
# 3. <H> column height from model (to bottom of box girder)
# 4. <numCols> number of bridge columns
#
# OUTPUT - file with columns of force-displacement data for each bridge column
# (for -1 type, e.g.)
# FL-uL, ML-tL, Fv-uv, Mv-uv, Ft-ut, Mt-tt
puts "____sourcing Analysis/YieldFiles.tcl now!!!!"
# puts "____proc YieldFiles {$fstub $type $H $numCols}"
proc YieldFiles {fstub type H numCols} {
#puts "YieldFiles {$fstub $type $H $numCols}"
#Opem--------------------------
# new output file with columns of forces and displacements
set mfile [open [format "output/%sfy_cols.out" $fstub] "w"]
puts "write mfile:$mfile"
# global forces at bottom, i, and top, j, of element
set ffile [open [format "output/%sef_colb.out" $fstub] "r"]
# nodal displacements at top of columns
set dfile [open [format "output/%snd_colt.out" $fstub] "r"]
# nodal displacements at bottom of columns
set bfile [open [format "output/%snd_colb.out" $fstub] "r"]
set maxQuantf3 12
set maxQuantf2 6
set maxQuantd3 6
set maxQuantd2 6
if { $type == 1 } {
# longitudinal base shear force and top-bottom displacement, longitudinal top moment and rotation
puts "type=$type"
set floc3 [list 1 12]
set dloc3 [list 1 6]
set floc2 [list 1 6]
set dloc2 [list 1 3]
set out3 [list 1 2]
set out2 [list 1 2]
} elseif { $type == 2 } {
# vertical base force and top-bottom displacement, top torque and twist
puts "type=$type"
set floc3 [list 2 11]
set dloc3 [list 2 5]
set floc2 [list 2]
set dloc2 [list 2]
set out3 [list 3 4]
set out2 [list 3]
} elseif { $type == 3 } {
# transverse base shear force and top-bottom displacement, transverse top moment and rotation
set floc3 [list 3 10]
set dloc3 [list 3 4]
set out3 [list 5 6]
} elseif { $type == -1} {
# include all of them
puts "type=$type"
set floc3 [list 1 12 2 11 3 10]
set dloc3 [list 1 6 2 5 3 4]
set floc2 [list 1 6 2]
set dloc2 [list 1 3 2]
set out3 [list 1 2 3 4 5 6]
set out2 [list 1 2 3]
} else {
puts "YieldFiles: unknown type $type"
####
#ok
exit
}
# location of all response quantities in recorder files
set tfloc3 [list 1 12 2 11 3 10]
set tfloc2 [list 1 6 2]
set tdloc3 [list 1 6 2 5 3 4]
set tdloc2 [list 1 3 2]
# skip header lines
gets $ffile fline
gets $dfile dline
gets $bfile bline
# puts "ffile=$ffile"
##set zk 0
while { -1 != [gets $ffile fline] & -1 != [gets $dfile dline] & -1 != [gets $bfile bline] } {
if { [string length $fline] > 5 } {
set cmdf [split $fline]
set cmdd [split $dline]
set cmdb [split $bline]
# puts "" #"cmdf:$cmdf"
set kla [llength $cmdf]
##incr zk
if { [string length [lindex $cmdf [expr $kla-1]]] < 2 } {
set kla [expr $kla-1]
}
#puts "kla=$kla < $maxQuantf3 * $numCols = [expr $maxQuantf3*$numCols]"
if { $kla < [expr $maxQuantf3*$numCols] } {
if { $kla < [expr $maxQuantf2*$numCols] } {
puts "YieldFiles: not enough data columns in force file"
#puts "kla=$kla < $maxQuantf2 * $numCols = [expr $maxQuantf2*$numCols]"
#puts "zk=$zk"
# ok_in_analysis/YieldFiles.tcl
exit
} else {
set maxQuantf $maxQuantf2
set maxQuantd $maxQuantd2
set floc $floc2 ; #
set dloc $dloc2
set tfloc $tfloc2
set tdloc $tdloc2
set out $out2
set threeD 0
}
} else {
set maxQuantf $maxQuantf3
set maxQuantd $maxQuantd3
set floc $floc3
set dloc $dloc3
set tfloc $tfloc3
set tdloc $tdloc3
set out $out3
set threeD 1
}
for { set tcnt 1 } { $tcnt <= $numCols } { incr tcnt } {
# force all displacement quantities to update regardless of input type
for { set jk 0 } { $jk < [llength $tfloc] } { incr jk } {
set fvar [lindex $tfloc $jk]
set dvar [lindex $tdloc $jk]
set f_quant([expr $jk+1]) [lindex $cmdf [expr ($tcnt-1)*$maxQuantf+$fvar-1]]
set di_quant([expr $jk+1]) [lindex $cmdb [expr ($tcnt-1)*$maxQuantd+$dvar-1]]
set dj_quant([expr $jk+1]) [lindex $cmdd [expr ($tcnt-1)*$maxQuantd+$dvar-1]]
}
# now manipulate the displacements to account for base translation and rotation
# theoretically there is also a vertical component due to rotation we should include
if { $threeD == 1 } {
# uL
set d_quant(1) [expr $dj_quant(1)-$di_quant(1) + $H*sin($di_quant(2))]
# thetaL
set d_quant(2) [expr atan($d_quant(1)/$H)]
# uV
set d_quant(3) [expr $dj_quant(3)-$di_quant(3) - $H*(1.0-cos(sqrt(pow($di_quant(2),2)+pow($di_quant(6),2))))]
# thetaV
set d_quant(4) [expr $dj_quant(4)-$di_quant(4)]
# uT
set d_quant(5) [expr $dj_quant(5)-$di_quant(5) - $H*sin($di_quant(6))]
# thetaT
set d_quant(6) [expr atan($d_quant(5)/$H)]
} else {
# uL
set d_quant(1) [expr $dj_quant(1)-$di_quant(1) + $H*sin($di_quant(2))]
# thetaL
set d_quant(2) [expr atan($d_quant(1)/$H)]
# uV
set d_quant(3) [expr $dj_quant(3)-$di_quant(3) - $H*(1.0-cos($di_quant(2)))]
}
# now rerun the loop and output the desired quantities only to file
for { set jk 0 } { $jk < [llength $out] } { incr jk } {
puts -nonewline $mfile "$f_quant([lindex $out $jk]) $d_quant([lindex $out $jk]) "
}
}
puts $mfile ""
}
}
close $mfile
close $ffile
close $dfile
close $bfile
#close---------------------------
}
# FyUy.tcl - force-displacement pushovers <- AnalysisPushover.tcl
# Kevin Mackie, 2005/05/02
# version 1.0.1
# mackie@ce.berkeley.edu
#
# Takes output from G3 static analyses (called from bridge
# input file) and finds yield force and displacement information
#
# fcol - column number in file with force information
# dcol - column number in file with displacement information
puts "____sourcing utilities/FyUy.tcl now!!!!"
#puts "____proc FyUy $infile $fcol $dcol"
proc FyUy {infile fcol dcol} {
puts "... FyUy $infile $fcol $dcol"
# load yield force/displacement data and parse
# strip off gap related jumps later in pushover
set file [open [format "%s" $infile] "r"]
set max_disp 0.0
set max_load 0.0
#set temp_count 0;
while {-1 != [gets $file line] } {
#set temp_count [expr $temp_count+1];
#puts "$temp_count in FyUy.tcl...now the line is $file in $infile"
if { [string length $line] > 4 } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# puts "k=$k, <kla=$kla?"
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { $kl < $fcol || $kl < $dcol } {
#### problem
puts "FyUy: Insufficient number of columns available"
exit
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { $temp_load > $max_load} {
set max_load [expr abs($temp_load)]
}
if { $temp_disp > $max_disp} {
set max_disp [expr abs($temp_disp)]
}
}
}
}
# go back and fit linear line through 0.66*fy
seek $file 0 start
set loc [expr $max_load*0.66]
set cr_load 1.0e-6
set cr_disp 1.0e-6
set early 0
while {$early == 0} {
if {-1 != [gets $file line] } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { [expr abs($temp_load)] > $loc} {
set cr_load [expr abs($temp_load)]
set cr_disp [expr abs($temp_disp)]
set early 1
}
}
} else {
set early 1
}
}
# go back and find energy absorbed under maximum yield force
seek $file 0 start
set early 0
set Etotal 0.0
set p_load 0.0
set p_disp 0.0
while {$early == 0} {
if {-1 != [gets $file line] } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { [expr abs($temp_disp)] <= $max_disp} {
set dx [expr $temp_disp-$p_disp]
set yhalf [expr ($temp_load+$p_load)/2.0]
set Etotal [expr $Etotal + $dx*$yhalf]
set p_load $temp_load
set p_disp $temp_disp
} else {
set early 1
}
}
} else {
set early 1
}
}
close $file
set int_load [expr $max_load-($max_load-$cr_load)/2.0]
set uy [expr $int_load*$cr_disp/$cr_load]
set ucap [expr $max_disp/$uy]
# output: uy, ductility_capacity, umax, intermediate Pmax, energy under Pmax
set fyinfo "$uy $ucap $max_disp $max_load $int_load $Etotal"
return $fyinfo
}
> Add "wipe" command at the end of analysis and your problem should
> be solved.
1
why? when I use wipe before the procedure FyUy, the 'floc2' variable can not be read.
2
I revised the headings and all, the produre can work well in 1.7.2. but still have that problem. this time the sl0001fy_cols.out from recorder.tcl in 2.3.2 or 2.2.2 has 9 lines less than that in 1.7.2. I am going to check the procedure that generate sl0001fy_cols.out, maybe simply the YieldFiles.tcl.
1
# Transient.tcl: sets up and runs arbitrary transient run
# Units: kN, m
# Kevin Mackie, 2006/05/24
# version 1.0.5
# mackie@ce.berkeley.edu
#
# Takes all parameters from ModelD.tcl and runs transient analysis.
# Allows multiple runs on same record as required for IDA
# Performs Earthquake excitation transient analysis, including modal as necessary
#
# INPUT 1. <params> parameter tag identifying analysis
# 2. <stype> empty
# 3. <components> 1 for uniaxial excitation, 3 for 3D excitation
# 4. <eqk_num> number of earthquake in current bin
# 5. <ida> 1 for IDA, 0 otherwise
# 6. <level> scale factor to use in this analysis
# 7. <ida_cnt> step increment number in IDA analysis
# 8. <fn> filename of fault normal motion, assigned to global X
# 9. <fp> filename of fault parallel motion, assigned to global Z
# 10. <fv> filename of vertical motion, assigned to global Y
# 11. <binfo> additional information passed from GenerateBridge.tcl
# 12. <fyl> yield strength (actually max) from longitudinal pushover of bridge (k)
# 13. <fyt> yield strength (actually max) from transverse pushover of bridge (k)
proc Transient {params stype components eqk_num ida level ida_cnt fn fp fv binfo fyl fyt} {
puts "__sourcing analysis/Transient.tcl now!!!"
scan $binfo "%f %u %u" temp numCols shift
set mnode [expr $shift+30]
set g 9.806
set pi [expr acos(-1.0)]
set damping_ratio 0.03
set disp 0
# load ground motion data parameters
set file [open [format "%s.info" $fn] "r"]
set line [gets $file]
scan $line "%i %lf %u" points dt eqk_filein
close $file
set filen [format "%s.data" $fn]
set filep [format "%s.data" $fp]
set filev [format "%s.data" $fv]
# in case of aftershock, reset recorders
#remove recorders
#loadConst -time 0.0
# determine record scaling relative to a given intensity at Sa(T1)
# level variable is a modifier on this value, just worry about what happens when
# sf=2 for PSDA and what happens in Combine.tcl
# -----------------------------------------------------
# Perform Earthquake excitation transient analysis
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
# Perform gravity load analysis
source "utilities/Gravity.tcl"
set dx [nodeDisp $mnode 1]; set dy [nodeDisp $mnode 2]; set dz [nodeDisp $mnode 3];
puts "node $mnode: [format "dx=%1.5e dy=%1.5e dz=%1.5e" $dx $dy $dz]"
# -----------------------------------------------------
# Perform eigen analysis (initial stiffness)
set numModes 5
for { set k 1 } { $k <= $numModes } { incr k } {
puts "nummodes is $k!"
#####the following line is original
# recorder Node -file [format "modes/mode%i.out" $k] -node all -dof 1 2 3 "eigen $k"
#ok_numModes recoder Node - error -all option has been removed, use -nodeRange instaed -1 -node -region 11 12 13 200 201 301
#
recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k"
recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"
recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k"
}
puts " $components"
if { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt([lindex $eigenvalues 0])]
set omega2 [expr sqrt([lindex $eigenvalues 1])]
set T1 [expr 2.0*$pi/$omega1]
set T2 [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1 1.0
set T2 2.0
}
# ok_in_transient.tcl
remove recorders
# reset time in time domain
loadConst -time 0.0
# setup recorders for the bridge
source "Analysis/Recorders.tcl"
if { $components == 1 } {
set savePath ./data/bins/$params/$eqk_num
file mkdir $savePath
source soil_foundation/923_recordEQ_soil.tcl
source soil_foundation/912_display.tcl
}
# Record fiber stress and strain at max location
#for {set i 20} {$i < $conc_fibers} {incr i} {
# recorder Element 1 -file [format "fibers/%sffc%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# Record fiber stress and strain at max location
#for {set i $conc_fibers} {$i < [expr $conc_fibers+$steel_fibers] } {incr i} {
# recorder Element 1 -file [format "fibers/%sffs%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# define earthquakes filename dt factor
set path1 "Path -filePath $filen -dt $dt -factor [expr $g*$level]"
set path2 "Path -filePath $filep -dt $dt -factor [expr $g*$level]"
set path3 "Path -filePath $filev -dt $dt -factor [expr $g*$level]"
# tag dir
pattern UniformExcitation 4 1 -accel $path1
if { $components == 3 } {
pattern UniformExcitation 5 3 -accel $path2
pattern UniformExcitation 6 2 -accel $path3
set alphaM [expr $damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set beta 0.5
set gamma 0.25
set betaK [expr $damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM 0.0
set betaK 0.01
set beta 0.6
set gamma 0.3025
}
# see if interpolating ground motion helps
#set dt [expr $dt/2.0]
#set points [expr $points*2]
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
integrator Newmark $beta $gamma
# tolerance maxIter displayCode
#test EnergyIncr 1.0e-10 50 0
test NormDispIncr 1.0e-6 50 0
algorithm KrylovNewton
numberer RCM
#constraints Plain
constraints Penalty 1.0e16 1.0e16
#system SparseGeneral -piv
#system BandGeneral
system ProfileSPD
initialize
analysis Transient
# attempt to analyze the complete record
set startT [clock seconds]
#set res [analyze $points $dt [expr $dt/100] $dt 10]
set res [analyze $points $dt]
set tFinal [expr $points * $dt]
# now check for failure and iterate as necessary to complete record
source "Analysis/NonConvergence.tcl"
# allow free vibration for several cycles under slightly higher damping
set freeVibSteps 800
if { $components == 3 } {
set alphaM [expr 2.0*$damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 2.0*$damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $freeVibSteps $dt]
set tFinal [expr ($points+$freeVibSteps)*$dt]
source "Analysis/NonConvergence.tcl"
# ramp up damping to attain residual displacement states
set dampedSteps 400
if { $components == 3 } {
set alphaM [expr 0.2*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 0.2*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $dampedSteps $dt]
set tFinal [expr ($points+$freeVibSteps+$dampedSteps)*$dt]
source "Analysis/NonConvergence.tcl"
if { $components == 3 } {
remove loadPattern 5
remove loadPattern 6
}
remove loadPattern 4
set endT [clock seconds]
puts "Execution time: [expr $endT-$startT] seconds."
#set maxLocs1 [MkDistr 1 $mkarg1 $fstub 1]
#puts $maxLocs1
#set maxLocs2 [MkDistr 1 $mkarg2 $fstub 2]
#puts $maxLocs2
# -----------------------------------------------------
# Perform eigen analysis (post earthquake stiffness)
# note: if res < 0, then we have "collapsed", so don't do the post-eigen
if { $res < 0 } {
set T1dmg 10.0
set T2dmg 10.0
} elseif { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt(abs([lindex $eigenvalues 0]))]
set omega2 [expr sqrt(abs([lindex $eigenvalues 1]))]
set T1dmg [expr 2.0*$pi/$omega1]
set T2dmg [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1dmg 1.0
set T2dmg 2.0
}
# ------------------------------------------------
# append ground motion specific data, ie Sd, Sa, etc
# using program cdm which uses central difference to compute
# spectral response quantities, generates information which is
# added to ground motion .info files
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
set imanal "../motion/imcdm"
# note fp in 3 dir : fn in 1 dir : fv in 2 dir
# exec $imanal $fn 1 $T1 $T2 $level $T1dmg $T2dmg $fyl
# exec $imanal $fp 3 $T1 $T2 $level $T1dmg $T2dmg $fyt
# exec $imanal $fv 2 $T1 $T2 $level $T1dmg $T2dmg [expr sqrt($fyl*$fyl+$fyt*$fyt)]
# end of analysis
# ------------------------------------------------
source "Analysis/AnalysisD.tcl"
# AnalysisD might modify the collapse variable based on maximum drift
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
# ------------------------------------------------
# remove dynamic recorder files to save space
# leave static files currently to check whether algorithm captured yield or not
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
#file delete [format "%snd08.out" $fstub]
#file delete [format "%snr011.out" $fstub]
#file delete [format "%snr015.out" $fstub]
#MkDistr 2 $mkarg1 $fstub 1
#MkDistr 2 $mkarg2 $fstub 2
puts $Treturn
return $Treturn
}
2
# YieldFiles.tcl: generates shear force-displacement column vectors <- AnalysisPushover.tcl
# Units: kip, in
# Kevin Mackie, 2005/11/17
# version 1.0.3
# mackie@ce.berkeley.edu
#
# Takes different recorder files for column shear and column displacement,
# and combines them into a single f-d style file. Note, takes displacements
# and forces from global files, so can also produce moment-rotation data.
#
# Takes into account the effect of having base rotation and translation;
# however, it should be noted that the drift recorders work independently and
# therefore may not give the "real" drift being sought if base rotation occurs.
# INPUT 1. <fstub> portion of filename to prepend (string)
# 2. <type> 1, 2, 3 for L, V, T directions, or -1 for all of them (3D)
# <type> 1, 2 for L, V directions, -1 for all of them (2D)
# 3. <H> column height from model (to bottom of box girder)
# 4. <numCols> number of bridge columns
#
# OUTPUT - file with columns of force-displacement data for each bridge column
# (for -1 type, e.g.)
# FL-uL, ML-tL, Fv-uv, Mv-uv, Ft-ut, Mt-tt
puts "____sourcing Analysis/YieldFiles.tcl now!!!!"
# puts "____proc YieldFiles {$fstub $type $H $numCols}"
proc YieldFiles {fstub type H numCols} {
#puts "YieldFiles {$fstub $type $H $numCols}"
#Opem--------------------------
# new output file with columns of forces and displacements
set mfile [open [format "output/%sfy_cols.out" $fstub] "w"]
puts "write mfile:$mfile"
# global forces at bottom, i, and top, j, of element
set ffile [open [format "output/%sef_colb.out" $fstub] "r"]
# nodal displacements at top of columns
set dfile [open [format "output/%snd_colt.out" $fstub] "r"]
# nodal displacements at bottom of columns
set bfile [open [format "output/%snd_colb.out" $fstub] "r"]
set maxQuantf3 12
set maxQuantf2 6
set maxQuantd3 6
set maxQuantd2 6
if { $type == 1 } {
# longitudinal base shear force and top-bottom displacement, longitudinal top moment and rotation
puts "type=$type"
set floc3 [list 1 12]
set dloc3 [list 1 6]
set floc2 [list 1 6]
set dloc2 [list 1 3]
set out3 [list 1 2]
set out2 [list 1 2]
} elseif { $type == 2 } {
# vertical base force and top-bottom displacement, top torque and twist
puts "type=$type"
set floc3 [list 2 11]
set dloc3 [list 2 5]
set floc2 [list 2]
set dloc2 [list 2]
set out3 [list 3 4]
set out2 [list 3]
} elseif { $type == 3 } {
# transverse base shear force and top-bottom displacement, transverse top moment and rotation
set floc3 [list 3 10]
set dloc3 [list 3 4]
set out3 [list 5 6]
} elseif { $type == -1} {
# include all of them
puts "type=$type"
set floc3 [list 1 12 2 11 3 10]
set dloc3 [list 1 6 2 5 3 4]
set floc2 [list 1 6 2]
set dloc2 [list 1 3 2]
set out3 [list 1 2 3 4 5 6]
set out2 [list 1 2 3]
} else {
puts "YieldFiles: unknown type $type"
####
#ok
exit
}
# location of all response quantities in recorder files
set tfloc3 [list 1 12 2 11 3 10]
set tfloc2 [list 1 6 2]
set tdloc3 [list 1 6 2 5 3 4]
set tdloc2 [list 1 3 2]
# skip header lines
gets $ffile fline
gets $dfile dline
gets $bfile bline
# puts "ffile=$ffile"
##set zk 0
while { -1 != [gets $ffile fline] & -1 != [gets $dfile dline] & -1 != [gets $bfile bline] } {
if { [string length $fline] > 5 } {
set cmdf [split $fline]
set cmdd [split $dline]
set cmdb [split $bline]
# puts "" #"cmdf:$cmdf"
set kla [llength $cmdf]
##incr zk
if { [string length [lindex $cmdf [expr $kla-1]]] < 2 } {
set kla [expr $kla-1]
}
#puts "kla=$kla < $maxQuantf3 * $numCols = [expr $maxQuantf3*$numCols]"
if { $kla < [expr $maxQuantf3*$numCols] } {
if { $kla < [expr $maxQuantf2*$numCols] } {
puts "YieldFiles: not enough data columns in force file"
#puts "kla=$kla < $maxQuantf2 * $numCols = [expr $maxQuantf2*$numCols]"
#puts "zk=$zk"
# ok_in_analysis/YieldFiles.tcl
exit
} else {
set maxQuantf $maxQuantf2
set maxQuantd $maxQuantd2
set floc $floc2 ; #
set dloc $dloc2
set tfloc $tfloc2
set tdloc $tdloc2
set out $out2
set threeD 0
}
} else {
set maxQuantf $maxQuantf3
set maxQuantd $maxQuantd3
set floc $floc3
set dloc $dloc3
set tfloc $tfloc3
set tdloc $tdloc3
set out $out3
set threeD 1
}
for { set tcnt 1 } { $tcnt <= $numCols } { incr tcnt } {
# force all displacement quantities to update regardless of input type
for { set jk 0 } { $jk < [llength $tfloc] } { incr jk } {
set fvar [lindex $tfloc $jk]
set dvar [lindex $tdloc $jk]
set f_quant([expr $jk+1]) [lindex $cmdf [expr ($tcnt-1)*$maxQuantf+$fvar-1]]
set di_quant([expr $jk+1]) [lindex $cmdb [expr ($tcnt-1)*$maxQuantd+$dvar-1]]
set dj_quant([expr $jk+1]) [lindex $cmdd [expr ($tcnt-1)*$maxQuantd+$dvar-1]]
}
# now manipulate the displacements to account for base translation and rotation
# theoretically there is also a vertical component due to rotation we should include
if { $threeD == 1 } {
# uL
set d_quant(1) [expr $dj_quant(1)-$di_quant(1) + $H*sin($di_quant(2))]
# thetaL
set d_quant(2) [expr atan($d_quant(1)/$H)]
# uV
set d_quant(3) [expr $dj_quant(3)-$di_quant(3) - $H*(1.0-cos(sqrt(pow($di_quant(2),2)+pow($di_quant(6),2))))]
# thetaV
set d_quant(4) [expr $dj_quant(4)-$di_quant(4)]
# uT
set d_quant(5) [expr $dj_quant(5)-$di_quant(5) - $H*sin($di_quant(6))]
# thetaT
set d_quant(6) [expr atan($d_quant(5)/$H)]
} else {
# uL
set d_quant(1) [expr $dj_quant(1)-$di_quant(1) + $H*sin($di_quant(2))]
# thetaL
set d_quant(2) [expr atan($d_quant(1)/$H)]
# uV
set d_quant(3) [expr $dj_quant(3)-$di_quant(3) - $H*(1.0-cos($di_quant(2)))]
}
# now rerun the loop and output the desired quantities only to file
for { set jk 0 } { $jk < [llength $out] } { incr jk } {
puts -nonewline $mfile "$f_quant([lindex $out $jk]) $d_quant([lindex $out $jk]) "
}
}
puts $mfile ""
}
}
close $mfile
close $ffile
close $dfile
close $bfile
#close---------------------------
}
# FyUy.tcl - force-displacement pushovers <- AnalysisPushover.tcl
# Kevin Mackie, 2005/05/02
# version 1.0.1
# mackie@ce.berkeley.edu
#
# Takes output from G3 static analyses (called from bridge
# input file) and finds yield force and displacement information
#
# fcol - column number in file with force information
# dcol - column number in file with displacement information
puts "____sourcing utilities/FyUy.tcl now!!!!"
#puts "____proc FyUy $infile $fcol $dcol"
proc FyUy {infile fcol dcol} {
puts "... FyUy $infile $fcol $dcol"
# load yield force/displacement data and parse
# strip off gap related jumps later in pushover
set file [open [format "%s" $infile] "r"]
set max_disp 0.0
set max_load 0.0
#set temp_count 0;
while {-1 != [gets $file line] } {
#set temp_count [expr $temp_count+1];
#puts "$temp_count in FyUy.tcl...now the line is $file in $infile"
if { [string length $line] > 4 } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# puts "k=$k, <kla=$kla?"
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { $kl < $fcol || $kl < $dcol } {
#### problem
puts "FyUy: Insufficient number of columns available"
exit
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { $temp_load > $max_load} {
set max_load [expr abs($temp_load)]
}
if { $temp_disp > $max_disp} {
set max_disp [expr abs($temp_disp)]
}
}
}
}
# go back and fit linear line through 0.66*fy
seek $file 0 start
set loc [expr $max_load*0.66]
set cr_load 1.0e-6
set cr_disp 1.0e-6
set early 0
while {$early == 0} {
if {-1 != [gets $file line] } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { [expr abs($temp_load)] > $loc} {
set cr_load [expr abs($temp_load)]
set cr_disp [expr abs($temp_disp)]
set early 1
}
}
} else {
set early 1
}
}
# go back and find energy absorbed under maximum yield force
seek $file 0 start
set early 0
set Etotal 0.0
set p_load 0.0
set p_disp 0.0
while {$early == 0} {
if {-1 != [gets $file line] } {
set cmd [split $line]
set kla [llength $cmd]
set kl 0
for { set k 0 } { $k < $kla } { incr k } {
# split sometimes splits up whitespace quantities
if { [string length [lindex $cmd $k]] > 0 } {
set cmd [lreplace $cmd $kl $kl [lindex $cmd $k]]
incr kl
}
}
if { [string is double [lindex $cmd [expr $fcol-1]]] } {
set temp_load [expr abs( [lindex $cmd [expr $fcol-1]] )]
set temp_disp [expr abs( [lindex $cmd [expr $dcol-1]] )]
if { [expr abs($temp_disp)] <= $max_disp} {
set dx [expr $temp_disp-$p_disp]
set yhalf [expr ($temp_load+$p_load)/2.0]
set Etotal [expr $Etotal + $dx*$yhalf]
set p_load $temp_load
set p_disp $temp_disp
} else {
set early 1
}
}
} else {
set early 1
}
}
close $file
set int_load [expr $max_load-($max_load-$cr_load)/2.0]
set uy [expr $int_load*$cr_disp/$cr_load]
set ucap [expr $max_disp/$uy]
# output: uy, ductility_capacity, umax, intermediate Pmax, energy under Pmax
set fyinfo "$uy $ucap $max_disp $max_load $int_load $Etotal"
return $fyinfo
}
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
In earlier versions of OpenSees the recorders would write the data during the analysis. However, in the newer versions of OpenSees it is changed such that data are saved in batches.
Wipe command destroys all constructed objects and should be issued only at the end of final analysis. If in the Kevin's codes he is saving some files and using their data for some other runs try using "remove recorders" command.
Did you solve the problem you had with the node recorders?
Wipe command destroys all constructed objects and should be issued only at the end of final analysis. If in the Kevin's codes he is saving some files and using their data for some other runs try using "remove recorders" command.
Did you solve the problem you had with the node recorders?
Re: why the record in the lastest version no headings and al
thanks a lot, Vesna. Your answers are of great help!!!
I set node range to cover all of the nodes.now It works well for static analysis.
now the problem I can make sure that happened in node recorder for mode shape.
It's very instreresting that three version of OpenSees have different results during transient analysis.
for 1.7.2, all the analysis can be done with little revision.
the 2.2.2 failed to produce the modeshape files Modedeck.out, there's no values in it after exit.
the 2.3.2 produced the modeshape files with the same columns of value as the 1.7.2,but maybe failed to take them out for next step analysis.
and I try to find the reason and revised part of the code to make sure those recorders are working sucessfully as below, but I do not know what kind of return value means successful operation.
I hope to get some tips from you,Vesna. Thanks again!
[color=red]###
set kk1 [recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k" ]
set kk2 [recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"]
set kk3 [recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k" ]
puts "if successfull, kk1=$kk1,kk2=$kk2,kk3=$kk3\n"
###[/color]
and the output is
2.3.2 or 2.2.2
nummodes is 1!
if successfull, kk1=62,kk2=63,kk3=64
nummodes is 2!
if successfull, kk1=65,kk2=66,kk3=67
nummodes is 3!
if successfull, kk1=68,kk2=69,kk3=70
nummodes is 4!
if successfull, kk1=71,kk2=72,kk3=73
nummodes is 5!
if successfull, kk1=74,kk2=75,kk3=76
1.7.2
nummodes is 1!
if successfull, kk1= ,kk2= , kk3=
nummodes is 2!
if successfull, kk1= ,kk2= , kk3=
nummodes is 3!
if successfull, kk1= ,kk2= , kk3=
nummodes is 4!
if successfull, kk1= ,kk2= , kk3=
nummodes is 5!
if successfull, kk1= ,kk2= , kk3=
so if recorder work properly, it returns nothing or blank character. is that right?
the follow is the transient.tcl
[code]puts "...Transient.tcl: sets up and runs arbitrary transient run <-ModelD.tcl"
# Units: kN, m
# Kevin Mackie, 2006/05/24
# version 1.0.5
# mackie@ce.berkeley.edu
#
# Takes all parameters from ModelD.tcl and runs transient analysis.
# Allows multiple runs on same record as required for IDA
# Performs Earthquake excitation transient analysis, including modal as necessary
#
# INPUT 1. <params> parameter tag identifying analysis
# 2. <stype> empty
# 3. <components> 1 for uniaxial excitation, 3 for 3D excitation
# 4. <eqk_num> number of earthquake in current bin
# 5. <ida> 1 for IDA, 0 otherwise
# 6. <level> scale factor to use in this analysis
# 7. <ida_cnt> step increment number in IDA analysis
# 8. <fn> filename of fault normal motion, assigned to global X
# 9. <fp> filename of fault parallel motion, assigned to global Z
# 10. <fv> filename of vertical motion, assigned to global Y
# 11. <binfo> additional information passed from GenerateBridge.tcl
# 12. <fyl> yield strength (actually max) from longitudinal pushover of bridge (k)
# 13. <fyt> yield strength (actually max) from transverse pushover of bridge (k)
proc Transient {params stype components eqk_num ida level ida_cnt fn fp fv binfo fyl fyt} {
#puts "__sourcing analysis/Transient.tcl now!!!"
scan $binfo "%f %u %u" temp numCols shift
set mnode [expr $shift+30]
set g 9.806
set pi [expr acos(-1.0)]
set damping_ratio 0.03
set disp 0
# load ground motion data parameters
set file [open [format "%s.info" $fn] "r"]
set line [gets $file]
scan $line "%i %lf %u" points dt eqk_filein
close $file
set filen [format "%s.data" $fn]
set filep [format "%s.data" $fp]
set filev [format "%s.data" $fv]
# in case of aftershock, reset recorders
#remove recorders
#loadConst -time 0.0
# determine record scaling relative to a given intensity at Sa(T1)
# level variable is a modifier on this value, just worry about what happens when
# sf=2 for PSDA and what happens in Combine.tcl
# -----------------------------------------------------
# Perform Earthquake excitation transient analysis
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
# Perform gravity load analysis
puts "61 Transient.tcl:fstub:$fstub"
source "utilities/Gravity.tcl"
set dx [nodeDisp $mnode 1]; set dy [nodeDisp $mnode 2]; set dz [nodeDisp $mnode 3];
puts "node $mnode: [format "dx=%1.5e dy=%1.5e dz=%1.5e" $dx $dy $dz]"
# -----------------------------------------------------
# Perform eigen analysis (initial stiffness)
set numModes 5
for { set k 1 } { $k <= $numModes } { incr k } {
puts "nummodes is $k!"
# recorder Node -file [format "modes/mode%i.out" $k] -node all -dof 1 2 3 "eigen $k"
#ok_numModes recoder Node - error -all option has been removed, use -nodeRange instaed -1 -node -region 11 12 13 200 201 301
# region 11...<-generatebridge.tcl
#recorder Node <-file $fileName> <-xml $fileName> <-binary $fileName> <-tcp $inetAddress $port> <-timeSeries $tsTag> <-time> <-node $node1 $node2 ...> <-nodeRange $startNode $endNode> <-region $regionTag> -dof ($dof1 $dof2 ...) $respType'
#recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k"
#recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"
#recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k"
###
set kk1 [recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k" ]
set kk2 [recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"]
set kk3 [recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k" ]
puts "if successfull, kk1=$kk1,kk2=$kk2,kk3=$kk3\n"
###
}
puts "Transient.tcl: $components"
if { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt([lindex $eigenvalues 0])]
set omega2 [expr sqrt([lindex $eigenvalues 1])]
set T1 [expr 2.0*$pi/$omega1]
set T2 [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "Transient.tcl:pre-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1 1.0
set T2 2.0
}
# ok_in_transient.tcl
remove recorders
# reset time in time domain
loadConst -time 0.0
# setup recorders for the bridge
source "Analysis/Recorders.tcl"
if { $components == 1 } {
set savePath ./data/bins/$params/$eqk_num
file mkdir $savePath
puts "Transient.tcl:__ __source soil_foundation/923_recordEQ_soil.tcl"
source soil_foundation/923_recordEQ_soil.tcl
puts "Transient.tcl:__ __source soil_foundation/912_display.tcl"
source soil_foundation/912_display.tcl
}
# Record fiber stress and strain at max location
#for {set i 20} {$i < $conc_fibers} {incr i} {
# recorder Element 1 -file [format "fibers/%sffc%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# Record fiber stress and strain at max location
#for {set i $conc_fibers} {$i < [expr $conc_fibers+$steel_fibers] } {incr i} {
# recorder Element 1 -file [format "fibers/%sffs%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# define earthquakes filename dt factor
set path1 "Path -filePath $filen -dt $dt -factor [expr $g*$level]"
set path2 "Path -filePath $filep -dt $dt -factor [expr $g*$level]"
set path3 "Path -filePath $filev -dt $dt -factor [expr $g*$level]"
# tag dir
pattern UniformExcitation 4 1 -accel $path1
if { $components == 3 } {
pattern UniformExcitation 5 3 -accel $path2
pattern UniformExcitation 6 2 -accel $path3
set alphaM [expr $damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set beta 0.5
set gamma 0.25
set betaK [expr $damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM 0.0
set betaK 0.01
set beta 0.6
set gamma 0.3025
}
# see if interpolating ground motion helps
#set dt [expr $dt/2.0]
#set points [expr $points*2]
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
integrator Newmark $beta $gamma
# tolerance maxIter displayCode
#test EnergyIncr 1.0e-10 50 0
test NormDispIncr 1.0e-6 50 0
algorithm KrylovNewton
numberer RCM
#constraints Plain
constraints Penalty 1.0e16 1.0e16
#system SparseGeneral -piv
#system BandGeneral
system ProfileSPD
initialize
analysis Transient
# attempt to analyze the complete record
set startT [clock seconds]
#set res [analyze $points $dt [expr $dt/100] $dt 10]
set res [analyze $points $dt]
set tFinal [expr $points * $dt]
# now check for failure and iterate as necessary to complete record
puts "Transient.tcl:__ __source Analysis/NonConvergence.tcl"
source "Analysis/NonConvergence.tcl"
# allow free vibration for several cycles under slightly higher damping
set freeVibSteps 800
if { $components == 3 } {
set alphaM [expr 2.0*$damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 2.0*$damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $freeVibSteps $dt]
set tFinal [expr ($points+$freeVibSteps)*$dt]
puts "Transient.tcl:__ __source Analysis/NonConvergence.tcl"
source "Analysis/NonConvergence.tcl"
# ramp up damping to attain residual displacement states
set dampedSteps 400
if { $components == 3 } {
set alphaM [expr 0.2*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 0.2*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $dampedSteps $dt]
set tFinal [expr ($points+$freeVibSteps+$dampedSteps)*$dt]
source "Analysis/NonConvergence.tcl"
if { $components == 3 } {
remove loadPattern 5
remove loadPattern 6
}
remove loadPattern 4
set endT [clock seconds]
puts "Transient.tcl:Execution time: [expr $endT-$startT] seconds."
#set maxLocs1 [MkDistr 1 $mkarg1 $fstub 1]
#puts $maxLocs1
#set maxLocs2 [MkDistr 1 $mkarg2 $fstub 2]
#puts $maxLocs2
# -----------------------------------------------------
# Perform eigen analysis (post earthquake stiffness)
# note: if res < 0, then we have "collapsed", so don't do the post-eigen
if { $res < 0 } {
set T1dmg 10.0
set T2dmg 10.0
} elseif { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt(abs([lindex $eigenvalues 0]))]
set omega2 [expr sqrt(abs([lindex $eigenvalues 1]))]
set T1dmg [expr 2.0*$pi/$omega1]
set T2dmg [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1dmg 1.0
set T2dmg 2.0
}
# ------------------------------------------------
# append ground motion specific data, ie Sd, Sa, etc
# using program cdm which uses central difference to compute
# spectral response quantities, generates information which is
# added to ground motion .info files
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
set imanal "../motion/imcdm"
# note fp in 3 dir : fn in 1 dir : fv in 2 dir
# exec $imanal $fn 1 $T1 $T2 $level $T1dmg $T2dmg $fyl
# exec $imanal $fp 3 $T1 $T2 $level $T1dmg $T2dmg $fyt
# exec $imanal $fv 2 $T1 $T2 $level $T1dmg $T2dmg [expr sqrt($fyl*$fyl+$fyt*$fyt)]
# end of analysis
# ------------------------------------------------
source "Analysis/AnalysisD.tcl"
# AnalysisD might modify the collapse variable based on maximum drift
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
# ------------------------------------------------
# remove dynamic recorder files to save space
# leave static files currently to check whether algorithm captured yield or not
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
#file delete [format "%snd08.out" $fstub]
#file delete [format "%snr011.out" $fstub]
#file delete [format "%snr015.out" $fstub]
#MkDistr 2 $mkarg1 $fstub 1
#MkDistr 2 $mkarg2 $fstub 2
puts $Treturn
return $Treturn
}[/code]
I set node range to cover all of the nodes.now It works well for static analysis.
now the problem I can make sure that happened in node recorder for mode shape.
It's very instreresting that three version of OpenSees have different results during transient analysis.
for 1.7.2, all the analysis can be done with little revision.
the 2.2.2 failed to produce the modeshape files Modedeck.out, there's no values in it after exit.
the 2.3.2 produced the modeshape files with the same columns of value as the 1.7.2,but maybe failed to take them out for next step analysis.
and I try to find the reason and revised part of the code to make sure those recorders are working sucessfully as below, but I do not know what kind of return value means successful operation.
I hope to get some tips from you,Vesna. Thanks again!
[color=red]###
set kk1 [recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k" ]
set kk2 [recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"]
set kk3 [recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k" ]
puts "if successfull, kk1=$kk1,kk2=$kk2,kk3=$kk3\n"
###[/color]
and the output is
2.3.2 or 2.2.2
nummodes is 1!
if successfull, kk1=62,kk2=63,kk3=64
nummodes is 2!
if successfull, kk1=65,kk2=66,kk3=67
nummodes is 3!
if successfull, kk1=68,kk2=69,kk3=70
nummodes is 4!
if successfull, kk1=71,kk2=72,kk3=73
nummodes is 5!
if successfull, kk1=74,kk2=75,kk3=76
1.7.2
nummodes is 1!
if successfull, kk1= ,kk2= , kk3=
nummodes is 2!
if successfull, kk1= ,kk2= , kk3=
nummodes is 3!
if successfull, kk1= ,kk2= , kk3=
nummodes is 4!
if successfull, kk1= ,kk2= , kk3=
nummodes is 5!
if successfull, kk1= ,kk2= , kk3=
so if recorder work properly, it returns nothing or blank character. is that right?
the follow is the transient.tcl
[code]puts "...Transient.tcl: sets up and runs arbitrary transient run <-ModelD.tcl"
# Units: kN, m
# Kevin Mackie, 2006/05/24
# version 1.0.5
# mackie@ce.berkeley.edu
#
# Takes all parameters from ModelD.tcl and runs transient analysis.
# Allows multiple runs on same record as required for IDA
# Performs Earthquake excitation transient analysis, including modal as necessary
#
# INPUT 1. <params> parameter tag identifying analysis
# 2. <stype> empty
# 3. <components> 1 for uniaxial excitation, 3 for 3D excitation
# 4. <eqk_num> number of earthquake in current bin
# 5. <ida> 1 for IDA, 0 otherwise
# 6. <level> scale factor to use in this analysis
# 7. <ida_cnt> step increment number in IDA analysis
# 8. <fn> filename of fault normal motion, assigned to global X
# 9. <fp> filename of fault parallel motion, assigned to global Z
# 10. <fv> filename of vertical motion, assigned to global Y
# 11. <binfo> additional information passed from GenerateBridge.tcl
# 12. <fyl> yield strength (actually max) from longitudinal pushover of bridge (k)
# 13. <fyt> yield strength (actually max) from transverse pushover of bridge (k)
proc Transient {params stype components eqk_num ida level ida_cnt fn fp fv binfo fyl fyt} {
#puts "__sourcing analysis/Transient.tcl now!!!"
scan $binfo "%f %u %u" temp numCols shift
set mnode [expr $shift+30]
set g 9.806
set pi [expr acos(-1.0)]
set damping_ratio 0.03
set disp 0
# load ground motion data parameters
set file [open [format "%s.info" $fn] "r"]
set line [gets $file]
scan $line "%i %lf %u" points dt eqk_filein
close $file
set filen [format "%s.data" $fn]
set filep [format "%s.data" $fp]
set filev [format "%s.data" $fv]
# in case of aftershock, reset recorders
#remove recorders
#loadConst -time 0.0
# determine record scaling relative to a given intensity at Sa(T1)
# level variable is a modifier on this value, just worry about what happens when
# sf=2 for PSDA and what happens in Combine.tcl
# -----------------------------------------------------
# Perform Earthquake excitation transient analysis
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
# Perform gravity load analysis
puts "61 Transient.tcl:fstub:$fstub"
source "utilities/Gravity.tcl"
set dx [nodeDisp $mnode 1]; set dy [nodeDisp $mnode 2]; set dz [nodeDisp $mnode 3];
puts "node $mnode: [format "dx=%1.5e dy=%1.5e dz=%1.5e" $dx $dy $dz]"
# -----------------------------------------------------
# Perform eigen analysis (initial stiffness)
set numModes 5
for { set k 1 } { $k <= $numModes } { incr k } {
puts "nummodes is $k!"
# recorder Node -file [format "modes/mode%i.out" $k] -node all -dof 1 2 3 "eigen $k"
#ok_numModes recoder Node - error -all option has been removed, use -nodeRange instaed -1 -node -region 11 12 13 200 201 301
# region 11...<-generatebridge.tcl
#recorder Node <-file $fileName> <-xml $fileName> <-binary $fileName> <-tcp $inetAddress $port> <-timeSeries $tsTag> <-time> <-node $node1 $node2 ...> <-nodeRange $startNode $endNode> <-region $regionTag> -dof ($dof1 $dof2 ...) $respType'
#recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k"
#recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"
#recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k"
###
set kk1 [recorder Node -file [format "modes/mode%i.out" $k] -nodeRange 1 30000 -dof 1 2 3 "eigen $k" ]
set kk2 [recorder Node -file [format "modes/modedeck%i.out" $k] -region 11 -dof 1 2 3 "eigen $k"]
set kk3 [recorder Node -file [format "modes/modecolb%i.out" $k] -region 13 -dof 1 2 3 "eigen $k" ]
puts "if successfull, kk1=$kk1,kk2=$kk2,kk3=$kk3\n"
###
}
puts "Transient.tcl: $components"
if { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "pre-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt([lindex $eigenvalues 0])]
set omega2 [expr sqrt([lindex $eigenvalues 1])]
set T1 [expr 2.0*$pi/$omega1]
set T2 [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "Transient.tcl:pre-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1 1.0
set T2 2.0
}
# ok_in_transient.tcl
remove recorders
# reset time in time domain
loadConst -time 0.0
# setup recorders for the bridge
source "Analysis/Recorders.tcl"
if { $components == 1 } {
set savePath ./data/bins/$params/$eqk_num
file mkdir $savePath
puts "Transient.tcl:__ __source soil_foundation/923_recordEQ_soil.tcl"
source soil_foundation/923_recordEQ_soil.tcl
puts "Transient.tcl:__ __source soil_foundation/912_display.tcl"
source soil_foundation/912_display.tcl
}
# Record fiber stress and strain at max location
#for {set i 20} {$i < $conc_fibers} {incr i} {
# recorder Element 1 -file [format "fibers/%sffc%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# Record fiber stress and strain at max location
#for {set i $conc_fibers} {$i < [expr $conc_fibers+$steel_fibers] } {incr i} {
# recorder Element 1 -file [format "fibers/%sffs%03i.out" $fstub $i] section 5 fiber $i stressStrain
#}
# define earthquakes filename dt factor
set path1 "Path -filePath $filen -dt $dt -factor [expr $g*$level]"
set path2 "Path -filePath $filep -dt $dt -factor [expr $g*$level]"
set path3 "Path -filePath $filev -dt $dt -factor [expr $g*$level]"
# tag dir
pattern UniformExcitation 4 1 -accel $path1
if { $components == 3 } {
pattern UniformExcitation 5 3 -accel $path2
pattern UniformExcitation 6 2 -accel $path3
set alphaM [expr $damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set beta 0.5
set gamma 0.25
set betaK [expr $damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM 0.0
set betaK 0.01
set beta 0.6
set gamma 0.3025
}
# see if interpolating ground motion helps
#set dt [expr $dt/2.0]
#set points [expr $points*2]
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
integrator Newmark $beta $gamma
# tolerance maxIter displayCode
#test EnergyIncr 1.0e-10 50 0
test NormDispIncr 1.0e-6 50 0
algorithm KrylovNewton
numberer RCM
#constraints Plain
constraints Penalty 1.0e16 1.0e16
#system SparseGeneral -piv
#system BandGeneral
system ProfileSPD
initialize
analysis Transient
# attempt to analyze the complete record
set startT [clock seconds]
#set res [analyze $points $dt [expr $dt/100] $dt 10]
set res [analyze $points $dt]
set tFinal [expr $points * $dt]
# now check for failure and iterate as necessary to complete record
puts "Transient.tcl:__ __source Analysis/NonConvergence.tcl"
source "Analysis/NonConvergence.tcl"
# allow free vibration for several cycles under slightly higher damping
set freeVibSteps 800
if { $components == 3 } {
set alphaM [expr 2.0*$damping_ratio*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 2.0*$damping_ratio*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $freeVibSteps $dt]
set tFinal [expr ($points+$freeVibSteps)*$dt]
puts "Transient.tcl:__ __source Analysis/NonConvergence.tcl"
source "Analysis/NonConvergence.tcl"
# ramp up damping to attain residual displacement states
set dampedSteps 400
if { $components == 3 } {
set alphaM [expr 0.2*2.0*$omega1*$omega2/($omega1+$omega2)]
set betaK [expr 0.2*2.0/($omega1+$omega2)]
} else {
set alphaM [expr $alphaM*2.0]
set betaK [expr $betaK*2.0]
}
# Rayeigh damping for first 2 modes assuming 2% viscous damping
# C = alphaM * M + betaK * Kcurrent + betaKi * Kinit + betaKc * Kcommit
# gamma beta alphaM betaK
rayleigh $alphaM 0.0 0.0 $betaK
set res [analyze $dampedSteps $dt]
set tFinal [expr ($points+$freeVibSteps+$dampedSteps)*$dt]
source "Analysis/NonConvergence.tcl"
if { $components == 3 } {
remove loadPattern 5
remove loadPattern 6
}
remove loadPattern 4
set endT [clock seconds]
puts "Transient.tcl:Execution time: [expr $endT-$startT] seconds."
#set maxLocs1 [MkDistr 1 $mkarg1 $fstub 1]
#puts $maxLocs1
#set maxLocs2 [MkDistr 1 $mkarg2 $fstub 2]
#puts $maxLocs2
# -----------------------------------------------------
# Perform eigen analysis (post earthquake stiffness)
# note: if res < 0, then we have "collapsed", so don't do the post-eigen
if { $res < 0 } {
set T1dmg 10.0
set T2dmg 10.0
} elseif { $components == 3 } {
set eigenvalues [eigen $numModes]
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
set modeIntegrator "integrator LoadControl 0 1 0 0"
source "Analysis/Modal.tcl"
set omega1 [expr sqrt(abs([lindex $eigenvalues 0]))]
set omega2 [expr sqrt(abs([lindex $eigenvalues 1]))]
set T1dmg [expr 2.0*$pi/$omega1]
set T2dmg [expr 2.0*$pi/$omega2]
} else {
source "utilities/fixSoilNodes.tcl"
set eigenvalues [eigen $numModes]
file delete nodes_with_eigenvectors
print nodes_with_eigenvectors -node
wipeAnalysis
puts "post-eqk eigenvalues: $eigenvalues"
source "Analysis/Modal.tcl"
remove loadPattern 123
set T1dmg 1.0
set T2dmg 2.0
}
# ------------------------------------------------
# append ground motion specific data, ie Sd, Sa, etc
# using program cdm which uses central difference to compute
# spectral response quantities, generates information which is
# added to ground motion .info files
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
set imanal "../motion/imcdm"
# note fp in 3 dir : fn in 1 dir : fv in 2 dir
# exec $imanal $fn 1 $T1 $T2 $level $T1dmg $T2dmg $fyl
# exec $imanal $fp 3 $T1 $T2 $level $T1dmg $T2dmg $fyt
# exec $imanal $fv 2 $T1 $T2 $level $T1dmg $T2dmg [expr sqrt($fyl*$fyl+$fyt*$fyt)]
# end of analysis
# ------------------------------------------------
source "Analysis/AnalysisD.tcl"
# AnalysisD might modify the collapse variable based on maximum drift
set Treturn "$T1 $T2 $T1dmg $T2dmg $res"
# ------------------------------------------------
# remove dynamic recorder files to save space
# leave static files currently to check whether algorithm captured yield or not
if { $ida == 1 } {
set fstub [format "d%04i%04i%02i" $params $eqk_num $ida_cnt]
} else {
set fstub [format "d%04i%04i" $params $eqk_num]
}
#file delete [format "%snd08.out" $fstub]
#file delete [format "%snr011.out" $fstub]
#file delete [format "%snr015.out" $fstub]
#MkDistr 2 $mkarg1 $fstub 1
#MkDistr 2 $mkarg2 $fstub 2
puts $Treturn
return $Treturn
}[/code]
Last edited by kengawk on Mon Apr 23, 2012 9:07 am, edited 1 time in total.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
vesna wrote:
> In earlier versions of OpenSees the recorders would write the data during
> the analysis. However, in the newer versions of OpenSees it is changed such
> that data are saved in batches.
>
> Wipe command destroys all constructed objects and should be issued only at
> the end of final analysis. If in the Kevin's codes he is saving some files
> and using their data for some other runs try using "remove
> recorders" command.
>
> Did you solve the problem you had with the node recorders?
I read your response again. your instruction is of great help for me reallly.
I found it seems that adding wipe at the beginning of a proc has little influence on the analysis.
Yeah, FyUy and YieldFile are both post-processing procedures.Maybe I was lucky to run through the program this time.
I will try "remove recorders" command for those subroutines.
thanks you! Vesna.
> In earlier versions of OpenSees the recorders would write the data during
> the analysis. However, in the newer versions of OpenSees it is changed such
> that data are saved in batches.
>
> Wipe command destroys all constructed objects and should be issued only at
> the end of final analysis. If in the Kevin's codes he is saving some files
> and using their data for some other runs try using "remove
> recorders" command.
>
> Did you solve the problem you had with the node recorders?
I read your response again. your instruction is of great help for me reallly.
I found it seems that adding wipe at the beginning of a proc has little influence on the analysis.
Yeah, FyUy and YieldFile are both post-processing procedures.Maybe I was lucky to run through the program this time.
I will try "remove recorders" command for those subroutines.
thanks you! Vesna.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
Re: why the record in the lastest version no headings and al
kk1, kk2 and kk3 are giving you the tags for the recorders. It was not there in the old versions of OpenSees and that is why you do not get any output when using 1.7.2 version of OpenSees.
You may see the difference in modal properties among different versions of OpenSees if eigen analysis is performed before any other type of analysis. However, if you do eigen analysis after gravity load you should get the same period no matter what version of OpenSees you use. If you still do not get the same values it may be that there was a bug on one of the materials that you are using with older versions of OpenSees.
You may see the difference in modal properties among different versions of OpenSees if eigen analysis is performed before any other type of analysis. However, if you do eigen analysis after gravity load you should get the same period no matter what version of OpenSees you use. If you still do not get the same values it may be that there was a bug on one of the materials that you are using with older versions of OpenSees.
Re: why the record in the lastest version no headings and al
Thanks for your explanation in detail.
Yes, the Eigen values are different among the three version.
why does the eigen analysis have to be performed after static analysis or adding gravity load to get the same value? Which one is correct? In my opinion, eigen analysis should have nothing to do with the load if neglecting the second order effect.
I think I should read the source code while running the small scale analysis.I know I have a long way to go. Maybe I could try to add some code from version 2.3.2 or more earlier version to 1.7.2 for learning developing opensees.
Best regards
vesna wrote:
> kk1, kk2 and kk3 are giving you the tags for the recorders. It was not
> there in the old versions of OpenSees and that is why you do not get any
> output when using 1.7.2 version of OpenSees.
>
> You may see the difference in modal properties among different versions of
> OpenSees if eigen analysis is performed before any other type of analysis.
> However, if you do eigen analysis after gravity load you should get the
> same period no matter what version of OpenSees you use. If you still do not
> get the same values it may be that there was a bug on one of the materials
> that you are using with older versions of OpenSees.
Yes, the Eigen values are different among the three version.
why does the eigen analysis have to be performed after static analysis or adding gravity load to get the same value? Which one is correct? In my opinion, eigen analysis should have nothing to do with the load if neglecting the second order effect.
I think I should read the source code while running the small scale analysis.I know I have a long way to go. Maybe I could try to add some code from version 2.3.2 or more earlier version to 1.7.2 for learning developing opensees.
Best regards
vesna wrote:
> kk1, kk2 and kk3 are giving you the tags for the recorders. It was not
> there in the old versions of OpenSees and that is why you do not get any
> output when using 1.7.2 version of OpenSees.
>
> You may see the difference in modal properties among different versions of
> OpenSees if eigen analysis is performed before any other type of analysis.
> However, if you do eigen analysis after gravity load you should get the
> same period no matter what version of OpenSees you use. If you still do not
> get the same values it may be that there was a bug on one of the materials
> that you are using with older versions of OpenSees.
Kai Zhang
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University
------------------------------
PH.D. candidate
School of Civil Engineering&Architecture
Beijing Jiaotong University