Modal Time History Analysis Individual Responses

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

Moderators: silvia, selimgunay, Moderators

Post Reply
rsoni2
Posts: 3
Joined: Wed Feb 15, 2012 1:46 pm
Location: North Carolina State University

Modal Time History Analysis Individual Responses

Post by rsoni2 »

Hello all,

Does anyone know if it is possible to obtain Individual Modal responses for an earthquake loading (time dependent PEER database record) by performing a modal time history analysis on a structure.
I mean I need responses in each mode before any modal combination .
More like a response from response Spectrum method in each mode.

If yes can they please let me know the command to be followed. I searched everywhere in the manual and I am not sure if it is even Possible to do so ?

All help would be appreciated

Thanks
Rohit
rsoni2
Posts: 3
Joined: Wed Feb 15, 2012 1:46 pm
Location: North Carolina State University

Re: Modal Time History Analysis Individual Responses

Post by rsoni2 »

Can Anyone Please Help!! I need this Information urgently :(
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: Modal Time History Analysis Individual Responses

Post by vesna »

I'm sorry, but OpenSees does not provide option of doing Modal or Response Spectrum analysis.
MDSmith526
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: Modal Time History Analysis Individual Responses

Post by MDSmith526 »

That's not entirely true. It's just complicated.

Steps:
1. build full model including mass, make sure you know the masses for each node or this won't work, also use numberer plain.
2. load with gravity if you need to include p-delta (use corotational transformation probably) then use loadConst to update the stiffness matrix
if you don't need p-delta skip step 2
3. run eigenvalue analysis for the number of modes you want to include, save the frequencies to a list variable
4. save all eigenvectors for all dofs for all the modes you want..you'll have to figure out the best way to do this...probably loops with nodeEigenvector and lots of tcl functions...anyway get them into variables or an external file so you can reuse them.
5. create a pattern Plain for each mode, use sp to assign every free dof its eigenvector value
6. record element forces, reactions, displacements, whatever else you want for analysis
7. analyze each eigenvector displacement, make sure to use the correct constraints setting, and you probably want a linear algorithm to be consistent with theory
8. use a dynamics book, along with the eigenvectors and mass matrix to compute the modal scaling factors (participation factors?) for each mode
9. wipe!
10. for each mode, create a single DOF model, truss element works well, use linear material/element/section/whatever, set E=1, L=1, A= square the circular frequency for that mode, mass=1, set rayleigh damping with the mass constant = 2*z*circular frequency, where z is the damping ratio, finally you may need to scale your seismic loads by those participation factors, depending on how you proceed (see Chopra dynamics text)
11. perform linear dynamic analyses for each model representing each mode's equivalent SDOF and record the displacements
12. wipe between each new SDOF
13. You will now need to recompose any response quantities using modal superposition...you may have to do this outside of tcl but you may be able to do this inside the same tcl file. The only problem is that recorders wait until you exit opensees to actually write to files. I'm sure there are ways around this.

This isn't easy but it will work. I'm doing it.

Comments are welcome.
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
naba077
Posts: 34
Joined: Mon May 28, 2012 9:38 pm
Location: Saitama University

Re: Modal Time History Analysis Individual Responses

Post by naba077 »

Dear Smith,
Can you provide us a very simple model that you explained here?
MDSmith526
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: Modal Time History Analysis Individual Responses

Post by MDSmith526 »

I will post a 3 DOF shear building tcl script in a few days. But, be advised, there is nothing simple about the script.
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
Mohammadf
Posts: 144
Joined: Wed Dec 15, 2010 10:58 am

Re: Modal Time History Analysis Individual Responses

Post by Mohammadf »

I'm waiting for your valuable example...
MDSmith526
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: Modal Time History Analysis Individual Responses

Post by MDSmith526 »

dbl post
Last edited by MDSmith526 on Sat Feb 09, 2013 1:49 pm, edited 1 time in total.
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
MDSmith526
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: Modal Time History Analysis Individual Responses

Post by MDSmith526 »

# This is an example script to show how linear modal time history can be peformed by opensees
# Author: Matthew D. Smith, PE
# US Army Corps of Engineers
# ERDC-ITL
# Vicksburg, MS
#
# This is an example shear building from Anil K. Chopra's "Dynamics of Structures" text 3rd ed.
# The specific example is in chapter 13, page 525, ss 13.2.6 Example: Five-Story Shear Frame
#
# The frame is a multistory shear building with a single node per story for a total of
# 6 nodes; 1 at the base and 5 elevated nodes
# each story has an interial weight of 100 kips
# each story column also has a stiffness of 31.54 kips/in
# damping for all modes is 5% of critical
#
# This script will demonstrate the process of performing modal decomposition, static analyses,
# for the modal responses, dynamic analyses for the single mode responses, and recombination
#
# results may be checked with plots in the Chopra text


# PART 1: Static Analysis Model Setup=========================================================

wipe; # clear memory of all past model definitions
model BasicBuilder -ndm 1 -ndf 1; # Define the model builder, ndm=#dimension, ndf=#dofs
set nNodes 6;
set g 386.1; # acceleration due to gravity in/s^2

# change this next line to suit your needs
set outputDir "C:/YourDirectory/"
file mkdir $outputDir

# nodal coordinates:
# note this is a 1D model, so coordinates are unimportant
node 1 0; # node#, X
node 2 0
node 3 0
node 4 0
node 5 0
node 6 0

# Single point constraints -- Boundary Conditions
fix 1 1; # 1 represents the ground of the shear buildling

# lumped mass matrix
# mass vector with each entry the mass for each node
set mMatrix [lrepeat $nNodes [expr 100/$g] ]; # set 100kip/g per node
set mMatrix [lreplace $mMatrix 0 0 0]; # set 0 mass at node 1

# nodal masses:
for {set i 1} {$i < [expr $nNodes+1]} {incr i} {
mass $i [lindex $mMatrix [expr $i-1]]; # set mass from mMatrix to correponsing node object
}

# materials
set matTag 1
set k 31.54; # each story has a stiffness of 31.54 kip/in
uniaxialMaterial Elastic $matTag $k;

# element connectivity:
for {set i 1} {$i < [expr $nNodes]} {incr i} {
element zeroLength $i $i [expr $i+1] -mat $matTag -dir 1; # a 1D element with directly assigned stiffness
}

# PART 2: Modal Properties=============================================================================
# perform an eigenvalue analysis to get omega^2 values
set eigs [eigen -generalized -fullGenLapack [expr $nNodes-1]];
for {set i 0} {$i < [llength $eigs]} {incr i} {
}

# calculate Tn
set T [lrepeat [expr $nNodes-1] 0]; # initialize list of periods
set Ln [lrepeat [expr $nNodes-1] 0]; # initialize list of Ln factors
set Mn [lrepeat [expr $nNodes-1] 0]; # initialize modal mass list
set Gamma [lrepeat [expr $nNodes-1] 0]; # initialize modal participation factor list
# loop over each mode
for {set i 1} {$i < [expr $nNodes]} {incr i} {
set eig [lindex $eigs [expr $i-1]]; # extract the eigenvalue
set wn [expr sqrt($eig)]; # calculate the circular frequency
set Tn [expr 2*3.14159/$wn]; # calculate the natural period
lset T [expr $i-1] $Tn; # store the period
# calculate eigenvec, Ln and Mn and Gamma_n for each mode
# loop over each node
for {set j 1} {$j < [expr $nNodes+1]} {incr j} {
set tmpVec [nodeEigenvector $j $i]; # store the eigenvector value for node j and mode i
set eigVec($j,$i) $tmpVec; # this is a really ugly way to do this but I'm unfamiliar with 2d arrays in tcl
set tmpLn [lindex $Ln [expr $i-1]]; # grab the current Ln value
set tmpLn [expr $tmpLn + $tmpVec*[lindex $mMatrix [expr $j-1] ] ]; # sum this phi*m term
lset Ln [expr $i-1] $tmpLn; # store back into list
set tmpMn [lindex $Mn [expr $i-1]]; # grab the current Mn value
set tmpMn [expr $tmpMn + $tmpVec*$tmpVec*[lindex $mMatrix [expr $j-1]]]; # sum this phi^2*m term
lset Mn [expr $i-1] $tmpMn; # store back into list
}
lset Gamma [expr $i-1] [expr [lindex $Ln [expr $i-1]] / [lindex $Mn [expr $i-1]] ]; # calculate modal participation factor Gamma_n
}


# PART 3: Static Responses due to Statically Equivalent Modal Force Vectors, sn========================

# Start looping here over each mode
# Here we will assume all 5 modes will be included, but fewer than the full modal set can be utilized
# to save computational time. This also may reduce the requirements for small time steps if very
# short periods are avoided. It is recommended that dt for analysis be T/10 where T is the shortest
# period to be included!

for {set i 1} {$i < [expr $nNodes]} {incr i} {
wipeAnalysis
reset
remove loadPattern 1
# I will do this WITHOUT RECORDERS!
# Why? Because recorders don't write until Opensees exits and that is inconvenient.
# if you have a structure with many outputs of interest you will want to explore
# multidimensional arrays if they exist in tcl. There are only 5 displacements
# and 5 element forces for this system so I will manually assign lists

# calculate modal static forces, sn
for {set j 1} {$j < [expr $nNodes+1]} {incr j} {
set sn($j,$i) [expr [lindex $Gamma [expr $i-1]]*[lindex $mMatrix [expr $j-1]]*$eigVec($j,$i) ]
}

# create load pattern
pattern Plain 1 Linear {
for {set j 1} {$j < [expr $nNodes+1]} {incr j} {
load $j $sn($j,$i);
}
}

# analysis settings
constraints Plain
numberer Plain
system BandGeneral
test NormUnbalance 1e-7 10
algorithm Linear
integrator LoadControl 1
analysis Static
analyze 1

# record stresses for each element
for {set j 1} {$j < $nNodes} {incr j} {
set StressSn($i,$j) [lindex [eleResponse $j force] 0]; # Grab the "i" node force for all elements for consistency
}

}

# PART 4: SDOF Dynamic Response for each Mode===============================================================
# set up a loop for every required ground motion
# this file is available here: http://nisee.berkeley.edu/data/strong_m ... entro_data
# note I modified it a bit but not sure if it was required
set inputfile "el_centro_data.txt"


# loop over each mode
for {set i 1} {$i < $nNodes} {incr i} {
wipe
source ReadRecord.tcl; # this can be found on the opensees website somewhere, if I can find it you can too
model BasicBuilder -ndm 1 -ndf 1; # Define the model builder, ndm=#dimension, ndf=#dofs

# nodal coordinates:
node 1 0;
node 2 0;

# single point contraints
fix 1 1;

# we will solve Dn'' + 2*zeta*omegan* Dn' + omegan^2*Dn = -ug''

# mass, unit mass
mass 2 1;

# material
set k [lindex $eigs [expr $i-1] ]; # stiffness is omega_n squared
uniaxialMaterial Elastic 1 $k;

# element connectivity:
element zeroLength 1 1 2 -mat 1 -dir 1

# rayleigh damping
set z 0.05;
rayleigh [expr 2*$z*sqrt([lindex $eigs [expr $i-1] ])] 0 0 0; # c is 2 * zeta * omega_n


reset
wipeAnalysis
remove loadPattern 1

# create load pattern
# load accel file
set filePath "TS.acc"
ReadRecord $outputDir$inputfile $filePath dt nPts


# time series
set accelTag 1;
timeSeries Path $accelTag -dt $dt -filePath $filePath -factor 386.1

# load pattern
pattern UniformExcitation 1 1 -accel $accelTag

# create analysis
constraints Plain;
numberer Plain;
system BandGeneral;
test NormDispIncr 1e-8 10;
algorithm Linear;
integrator Newmark 0.5 0.25;
analysis Transient;
for {set k 1} {$k < [expr $nPts+1] } {incr k} {
analyze 1 $dt;
set Dn($i,$k) [nodeDisp 2 1]; # record node displacement at each time step
}
}

# PART 5: Modal recombination==========================================================================
# reassemble nodal displacements
for {set i 1} {$i < $nNodes} {incr i} {
for {set k 1} {$k < [expr $nPts+1]} {incr k} {
for {set j 1} {$j < [expr $nNodes+1]} {incr j} {
# use Gamma and eigenvector along with Dn to find the node displacemenst for each mode
set un($j,$k,$i) [expr [lindex $Gamma [expr $i-1]] * $Dn($i,$k) * $eigVec($j,$i)]
if {$i==1} {set utotal($j,$k) 0}
set utotal($j,$k) [expr $utotal($j,$k)+$un($j,$k,$i)]; # sum the modal displacements to get total
}
}
}

# reassemble element stresses
for {set i 1} {$i < $nNodes} {incr i} {
for {set k 1} {$k < [expr $nPts+1]} {incr k} {
for {set j 1} {$j < $nNodes} {incr j} {
# use omega^2 along with Dn and the forces to find the node displacemenst for each mode
set Fn($j,$k,$i) [expr [lindex $eigs [expr $i-1]] * $Dn($i,$k) * $StressSn($i,$j)]
if {$i==1} {set Ftotal($j,$k) 0}
set Ftotal($j,$k) [expr $Ftotal($j,$k)+$Fn($j,$k,$i)]; # sum the modal forces to get total
}
}
}

# PART 6: Output modal quanitites to external files===================================================
# output periods
set tmpfile "Periods.out"
file delete $outputDir$tmpfile
set fp [open $outputDir$tmpfile "w"]
for {set i 0} {$i < [expr $nNodes-1]} {incr i} {
puts $fp "[lindex $T $i]"
}
close $fp

# output nodal displacements
set tmpfile "NodalDisp.out"
file delete $outputDir$tmpfile
set fp [open $outputDir$tmpfile "w"]

# and element forces (story shear)
set tmpfile "StoryShear.out"
file delete $outputDir$tmpfile
set fp2 [open $outputDir$tmpfile "w"]

for {set k 1} {$k < [expr $nPts+1]} {incr k} {
for {set j 1} {$j < [expr $nNodes+1]} {incr j} {
puts -nonewline $fp "$utotal($j,$k)"
if {$j==$nNodes} {
puts -nonewline $fp "\n"
} else {
puts -nonewline $fp "\t"
}

if {$j!=$nNodes} {
puts -nonewline $fp2 "$Ftotal($j,$k)"
if {$j==[expr $nNodes-1]} {
puts -nonewline $fp2 "\n"
} else {
puts -nonewline $fp2 "\t"
}
}
}
}
close $fp2
close $fp
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
MDSmith526
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: Modal Time History Analysis Individual Responses

Post by MDSmith526 »

Anyone is welcome to provide ideas on better ways to do this and to point out any errors.

I think recorders with post processing for the recombination may work much faster. But, at least that is A way to do it without exiting opensees.

Thanks
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
Post Reply