Example IDA

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

Moderators: silvia, selimgunay, Moderators

Post Reply
Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Example IDA

Post by Prafullamalla » Sun Dec 30, 2018 10:14 pm

Recently, I was trying to make Incrimental Dynamic analysis example file. This was downloaded and modified. It creates a max drift ratio for each earthquake file with different scale factor. This example file can be further modified.
Note: Edit the path of file name before running
Check the unit of factor scale of earthquake


# Modified by Prafulla Malla, Nepal
# Sichuan University, China

# Different Earthquake Loop
set iGMfile "GmFiles/Elcentro.dat GmFiles/kobe.dat"
set nGMfile 1
foreach GMfile $iGMfile {
# open output file
set DriftOut [open data/maxDrift[expr $nGMfile].out w]
puts $DriftOut "0 0"
# Different scale factor loop
for {set i 1} {$i<=30} {incr i 1} {
#file mkdir data/[expr $i/10.]sa ; #file for drift of each scale earthquake
wipe
# Create Nodel
model basic -ndm 3 -ndf 6

file mkdir data

node 1 0. 0. 0.
node 2 3. 0. 0.
node 3 0. 3. 0.
node 4 3. 3. 0.
node 5 0. 0. 3.
node 6 3. 0. 3.
node 7 0. 3. 3.
node 8 3. 3. 3.

fixZ 0.0 1 1 1 1 1 1

#Assigning Rigid Diaphragm
node 9 1.5 1.5 3.
fix 9 0 0 1 1 1 0
rigidDiaphragm 3 9 5 6 7 8

#Assigning Floor Mass to Center of the Mass of the story.
mass 9 4000. 4000. 0. 0. 0. [expr (1./12)*4000.*(pow(3,2)+pow(3,2))]

set ColumnTransfTag 1
geomTransf Linear $ColumnTransfTag 0 1 0

set BeamTransfTag 2
geomTransf Linear $BeamTransfTag 0 -1 0

set GirderTransfTag 3
geomTransf Linear $GirderTransfTag 1 0 0

uniaxialMaterial Steel01 1 2.354e8 2.e11 0.02

section fiberSec 1 {
patch quad 1 8 3 0.0915 0.05 0.0915 -0.05 0.1 -0.05 0.1 0.05
patch quad 1 3 8 -0.0915 0.0028 -0.0915 -0.0028 0.0915 -0.0028 0.0915 0.0028
patch quad 1 8 3 -0.1 0.05 -0.1 -0.05 -0.0915 -0.05 -0.0915 0.05
}

set e 2.e11
set nu 0.3
set G [expr $e/(2.*(1+$nu))]
set j 6.920e-8
set Tmattag 2
uniaxialMaterial Elastic $Tmattag [expr $G*$j]
section Aggregator 3 $Tmattag T -section 1



#Columns
element nonlinearBeamColumn 1 1 5 10 3 $ColumnTransfTag
element nonlinearBeamColumn 2 2 6 10 3 $ColumnTransfTag
element nonlinearBeamColumn 3 3 7 10 3 $ColumnTransfTag
element nonlinearBeamColumn 4 4 8 10 3 $ColumnTransfTag

#Beams
element nonlinearBeamColumn 5 5 6 10 3 $BeamTransfTag
element nonlinearBeamColumn 6 7 8 10 3 $BeamTransfTag

#Girders
element nonlinearBeamColumn 7 5 7 10 3 $GirderTransfTag
element nonlinearBeamColumn 8 6 8 10 3 $GirderTransfTag

set DeadLoad 1

pattern Plain $DeadLoad Linear {
eleLoad -ele 5 6 7 8 -type -beamUniform -5000 0.
}

constraints Lagrange
numberer Plain
system BandGeneral
test EnergyIncr 1.e-8 6
algorithm ModifiedNewton
integrator LoadControl 0.01
analysis Static
analyze 100
loadConst -time 0.0

#recorder display frame 1000 0 500 500 -wipe
#vup 0 0 1 # dirn defining up direction of view plane(ghab bordar movazi)
#vpn 0.7 1 0.3 # direction of outward normal to view plane(amud bar safhe ghab)
#prp 1 1 0 # eye location in local coord sys defined by viewing system
#viewWindow -5 5 -5 5
#projection 1
#display 1 5 4
#recorder Drift -file data/[expr $i/10.]sa/sa[expr $i/10.]drift.out -time -iNode 1 -jNode 5 -dof 1 -perpDirn 3
set accel "Series -dt 0.02 -filePath $GMfile -factor [expr $i.*9.81*0.617/10.]"
pattern UniformExcitation 3 1 -accel $accel

# Create analysis
puts "groundmotion $GMfile [expr $i./10.]sa start!.Time: [getTime]"
set t 0.00
set dT 0.02
set nPts 1500; # eaarthquake points
set maxT [expr (1+$nPts)*$dT];
set ok 0.0
set maxDrift 0.0
set nodeNumAtFloor2 5
set nodeNumAtFloor1 1

constraints Transformation
numberer Plain
system BandGeneral
integrator Newmark 0.5 0.25
analysis Transient

while {$ok == 0 && $t < $maxT} {
test RelativeNormDispIncr 1.0e-6 10 1;
algorithm NewtonLineSearch 0.6;
set ok [analyze 1 $dT]
if {$ok != 0} {
set ok [analyze 1 $dT]
}
if {$ok != 0} {
algorithm Newton
set ok [analyze 1 $dT]
}
if {$ok != 0} {
algorithm Newton -initial
set ok [analyze 1 $dT]
}
if {$ok != 0} {
algorithm KrylovNewton
set ok [analyze 1 $dT]
}
# Check drift
# Get floor displacements from OpenSees at this analysis step
set floor2Displ "[nodeDisp $nodeNumAtFloor2 1]";
set floor1Displ "[nodeDisp $nodeNumAtFloor1 1]";

# Compute story drift ratios for all stories
set story2Drift [expr ($floor2Displ - $floor1Displ)/3]

if {$story2Drift > $maxDrift} {
set maxDrift $story2Drift
} elseif {$story2Drift < [expr -$maxDrift]} {
set maxDrift [expr -$story2Drift]
}
set t [expr $t + $dT]
}
puts "Maximum Drift [expr $maxDrift]"
puts "groundmotion done!.End Time: [getTime]"

# write the data
puts $DriftOut "[expr $i/10.] [expr $maxDrift]"
} ; # scale factor loop close
set nGMfile [expr $nGMfile+1]
#close the file
close $DriftOut
} ; # Earthquake loop close

puts "first mode w^2:[eigen 1]
first period:[expr 2*3.14/pow([eigen 1],0.5)]"
Prafulla Malla, Nepal
Praf_malla@hotmail.com

Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Re: Example IDA

Post by Prafullamalla » Thu Jan 03, 2019 3:30 am

instead of using for loop for scaling loop , try loop until it reaches allowable limit, also check if non-convergence, so that you can jump to next earthquake loop... Criteria for non convegence assume impossible value like 5000. Inorder to jump to next GM file, after non covergence, assume maxdrift= allowable limit, so that it satisfies condition to jump to next loop
# after GM file loop
if {$maxDrift<=$allowableDrift} {

set i 0
while {$maxDrift<=$allowableDrift} {
incr i 1
# Model


# scale factor loop close while
}
# scale factor loop close if
} elseif {$maxDrift>=1000.} {
# Singularity so that analysis moves to next earthquake
set maxDrift [expr $allowableDrift]
# elseif loop close
}

after this close GM file loop
Prafulla Malla, Nepal
Praf_malla@hotmail.com

Post Reply