Hello,
I would like to know how many steps the ground motion has, when I use the script bellow. I mean, I have a file with the ground motion acceleratons but when I introduce it to OpenSees by "set AccelSeries " Series -dt $dt -filePath $outFile -factor $GMfatt" " I would like to know the vector size. This way, I will be able to indicate the maximum time of the earthquake.
# Bidirectional Uniform Earthquake ground motion (uniform acceleration input at all support nodes)
set Earthquakes Earthquakes
set iGMdirection "1 2"; # ground-motion direction
set iGMfact "1.0 1.0"; # ground-motion scaling factor
set dt 0.005
set IDloadTag 400; # for uniformSupport excitation
foreach GMdirection $iGMdirection GMfile $iGMfile GMfact $iGMfact {
incr IDloadTag;
# set inFile $Earthquakes/$GMfile.at2
set outFile $Earthquakes/$GMfile.txt; # set variable holding new filename (PEER files have .at2/dt2 extension)
# ReadSMDFile $inFile $outFile dt; # call procedure to convert the ground-motion file
set GMfatt [expr $g*$GMfact]; # data in input file is in g Unifts -- ACCELERATION TH
set AccelSeries "Series -dt $dt -filePath $outFile -factor $GMfatt"; # time series information <----------------------------------------- I guess that it is in somewhere from here
pattern UniformExcitation $IDloadTag $GMdirection -accel $AccelSeries ; # create Unifform excitation
}
Thanks a lot!
David
max step number in a simulation
Moderators: silvia, selimgunay, Moderators
Re: max step number in a simulation
Hi, I do this by counting the records in the acceleration data file with the following four lines:
set fp [open $THFileName r]
set THData [split [read $fp] "\n"]
set StepN [llength $THData]
close $fp
$THFileName is the file with the acceleration history records
$StepN is the number of records in the acceleration history file.
set fp [open $THFileName r]
set THData [split [read $fp] "\n"]
set StepN [llength $THData]
close $fp
$THFileName is the file with the acceleration history records
$StepN is the number of records in the acceleration history file.