How to remove the former load pattern?

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

Moderators: silvia, selimgunay, Moderators

Post Reply
cvjchuang
Posts: 24
Joined: Fri Feb 27, 2009 12:53 am
Location: South China University of Techonology
Contact:

How to remove the former load pattern?

Post by cvjchuang »

Hellow Everybody
I want to konw how to remove the former loadpattern? such that,I have three load pattern in model,but when all load patterns are performed ,i want to remove the second pattern ,and create a new analysis load pattern.
Please help me!
Thank you!
Dennis
Structural Engineering
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

remove loadPattern tag?
ionwang
Posts: 16
Joined: Wed Mar 25, 2009 7:40 am
Location: HIT

Post by ionwang »

remove loadPattern $tag
cvjchuang
Posts: 24
Joined: Fri Feb 27, 2009 12:53 am
Location: South China University of Techonology
Contact:

Post by cvjchuang »

[quote="ionwang"]remove loadPattern $tag[/quote] :P
Thanks very much
Dennis
Structural Engineering
basir
Posts: 32
Joined: Mon Apr 13, 2009 9:55 pm
Location: IRAN university of science an technology

Post by basir »

hi
i want to change the loadpattern after eache eigen command
so i used a loop with while command . but it doesnt work
how can i remove load pattern and substitute it with a new one
i used
remove loadpattern $tag
but it doesnt work
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

the command is case sensitive
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
basir
Posts: 32
Joined: Mon Apr 13, 2009 9:55 pm
Location: IRAN university of science an technology

Post by basir »

hi dr silvia
what do you mean by that?

and also save command doesnt work
i used for example
save 2
but tcl doesnt recognize the cmmand and print invalid commad
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

per the quote above:
remove loadPattern $tag
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
basir
Posts: 32
Joined: Mon Apr 13, 2009 9:55 pm
Location: IRAN university of science an technology

Post by basir »

ok thank you i changed the font in txt file and it worked

i have another problem
when i use a loop for analysing the structure to change the loadpattern after each analyze step like the below opensees cant converge
but when i do not remove the loadpattern there would be no error warning
what do you think what happend if i do not remove the previous load pattern here is what i did


set mass1 52756
set mass2 48760
set mass3 48760

set outFilename1 Data/Periodmode1.txt
set outFileID1 [open $outFilename1 w]

set outFilename2 Data/Periodmode2.txt
set outFileID2 [open $outFilename2 w]

set outFilename3 Data/Periodmode3.txt
set outFileID3 [open $outFilename3 w]

set outFilename4 Data/modeparticipationfactor1.txt
set outFileID4 [open $outFilename4 w]

set outFilename5 Data/modeparticipationfactor2.txt
set outFileID5 [open $outFilename5 w]

set outFilename6 Data/modeparticipationfactor3.txt
set outFileID6 [open $outFilename6 w]

set outFilename7 Data/h1.txt
set outFileID7 [open $outFilename7 w]

set outFilename8 Data/h2.txt
set outFileID8 [open $outFilename8 w]

set outFilename9 Data/h3.txt
set outFileID9 [open $outFilename9 w]

set ns 0
while {$ns < 300} {

set ns [expr $ns+1]

pattern Plain $ns Linear {

load 12 $h1 0.0 0.0
load 11 $h2 0.0 0.0
load 10 $h3 0.0 0.0

}



analyze 1

eigen 3

remove loadPattern $ns #when i use this command line to remove the #previous loadpattern analysis failed in the first steps because of #convegence problem but when i don not use remove command it doesnt #face any mistake during the analysis

set m1 [open "data/nodeseigenvectormode1.txt" r]
set m2 [open "data/nodeseigenvectormode2.txt" r]
set m3 [open "data/nodeseigenvectormode3.txt" r]


set modeshape1 [read $m1]
set modeshape2 [read $m2]
set modeshape3 [read $m3]


set m11 [lindex $modeshape1 [expr 1+($ns-1)*4]]
set m12 [lindex $modeshape1 [expr 2+($ns-1)*4]]
set m13 [lindex $modeshape1 [expr 3+($ns-1)*4]]


set m21 [lindex $modeshape2 [expr 1+($ns-1)*4]]
set m22 [lindex $modeshape2 [expr 2+($ns-1)*4]]
set m23 [lindex $modeshape2 [expr 3+($ns-1)*4]]

set m31 [lindex $modeshape3 [expr 1+($ns-1)*4]]
set m32 [lindex $modeshape3 [expr 2+($ns-1)*4]]
set m33 [lindex $modeshape3 [expr 3+($ns-1)*4]]


set mpf1 [expr ($m11*$mass1+$m12*$mass2+$m13*$mass3)/($m11*$m11*$mass1+$m12*$m12*$mass2+$m13*$m13*$mass3)]
set mpf2 [expr ($m21*$mass1+$m22*$mass2+$m23*$mass3)/($m21*$m21*$mass1+$m22*$m22*$mass2+$m23*$m23*$mass3)]
set mpf3 [expr ($m31*$mass1+$m32*$mass2+$m33*$mass3)/($m31*$m31*$mass1+$m32*$m32*$mass2+$m33*$m33*$mass3)]

puts $outFileID4 $mpf1

puts $outFileID5 $mpf2

puts $outFileID6 $mpf3

set f11 [expr ($mpf1*($m11*$mass1))]
set f12 [expr ($mpf1*($m12*$mass2))]
set f13 [expr ($mpf1*($m13*$mass3))]


set f21 [expr ($mpf2*($m21*$mass1))]
set f22 [expr ($mpf2*($m22*$mass2))]
set f23 [expr ($mpf2*($m23*$mass3))]


set f31 [expr ($mpf3*($m31*$mass1))]
set f32 [expr ($mpf3*($m32*$mass2))]
set f33 [expr ($mpf3*($m33*$mass3))]


set f1sum [expr ($f11+$f12+$f13)]
set f2sum [expr ($f21+$f22+$f23)]
set f3sum [expr ($f31+$f32+$f33)]

set h1 [expr ($f11/$f1sum)]
set h2 [expr ($f12/$f1sum)]
set h3 [expr ($f13/$f1sum)]


puts $outFileID7 $h1
puts $outFileID8 $h2
puts $outFileID9 $h3





set lambda [eigen 3]; # eigenvalue mode 1
set lambda1 [lindex $lambda 0];
set omega1 [expr pow($lambda1,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod1 [expr 2*$PI/$omega1]; # period (sec.)
puts $Tperiod1
puts $outFileID1 $Tperiod1

set lambda2 [lindex $lambda 1];
set omega2 [expr pow($lambda2,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod2 [expr 2*$PI/$omega2]; # period (sec.)
puts $Tperiod2
puts $outFileID2 $Tperiod2

set lambda3 [lindex $lambda 2];
set omega3 [expr pow($lambda3,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod3 [expr 2*$PI/$omega3]; # period (sec.)
puts $Tperiod3
puts $outFileID3 $Tperiod3







}


close $outFileID1
close $outFileID2
close $outFileID3


close $outFileID4
close $outFileID5
close $outFileID6


close $outFileID7
close $outFileID8
close $outFileID9
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

i can't tell as i don't know enough about your model.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
basir
Posts: 32
Joined: Mon Apr 13, 2009 9:55 pm
Location: IRAN university of science an technology

Post by basir »

HI
THIS THE WHOLE SCRIPT . DO YOU THINK THAT THE LOAD PATTERN CHANGE AFTER EACH ANALYZE STEP USING THE LOOP AT THE END OF THE SCRIPT


wipe

set dataDir Data

file mkdir $dataDir



model basic -ndm 2 -ndf 3


node 1 0.0 0.0
node 2 0.0 3.96
node 3 0.0 7.92
node 4 0.0 11.88

node 5 9.15 0.0
node 6 9.15 3.96
node 7 9.15 7.92
node 8 9.15 11.88

node 9 18.3 0.0
node 10 18.3 3.96
node 11 18.3 7.92
node 12 18.3 11.88

node 13 27.45 0.0
node 14 27.45 3.96
node 15 27.45 7.92
node 16 27.45 11.88

node 140 27.45 3.96
node 150 27.45 7.92
node 160 27.45 11.88

node 17 36.6 0.0
node 18 36.6 3.96
node 19 36.6 7.92
node 20 36.6 11.88

node 180 36.6 3.96
node 190 36.6 7.92
node 200 36.6 11.88


# ###############################################################################

equalDOF 14 140 1 2
equalDOF 15 150 1 2
equalDOF 16 160 1 2
equalDOF 18 180 1 2
equalDOF 19 190 1 2
equalDOF 20 200 1 2

# ###############################################################################
#supports constrained
#fix nodetag dx dy rz

fix 1 1 1 1
fix 5 1 1 1
fix 9 1 1 1
fix 13 1 1 1
fix 17 1 1 1

# ###############################################################################
# master node wich assign mass in level 1 is node 10 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 10

equalDOF 10 2 1
equalDOF 10 6 1
equalDOF 10 14 1
equalDOF 10 18 1
# ###############################################################################
# master node wich assign mass in level 1 is node 11 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 11

equalDOF 11 3 1
equalDOF 11 7 1
equalDOF 11 15 1
equalDOF 11 19 1
# ###############################################################################
# master node wich assign mass in level 1 is node 12 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 11

equalDOF 12 4 1
equalDOF 12 8 1
equalDOF 12 16 1
equalDOF 12 20 1
# ###############################################################################





uniaxialMaterial ElasticPP 1 20390000000 0.001724 -0.001724 0
uniaxialMaterial ElasticPP 2 20390000000 0.001241 -0.001241 0



set m1 48760.5
set m2 52756.30

mass 10 $m1 0.1 0.0
mass 11 $m1 0.1 0.0
mass 12 $m2 0.1 0.0
# mass node 8 applyed just for creating enough bandwidth to do eigen value analysis for the first three modes because of the software limitations.
mass 8 0.1 0.1 0.0

# end of mass definition






proc Wsection { secID matID d bf tf tw nfdw nftw nfbf nftf} {
# ###################################################################
# Wsection $secID $matID $d $bf $tf $tw $nfdw $nftw $nfbf $nftf
# ###################################################################
# create a standard W section given the nominal section properties
# written: Remo M. de Souza
# date: 06/99
# modified: 08/99 (according to the new general modelbuilder)
# input parameters
# secID - section ID number
# matID - material ID number
# d = nominal depth
# tw = web thickness
# bf = flange width
# tf = flange thickness
# nfdw = number of fibers along web depth
# nftw = number of fibers along web thickness
# nfbf = number of fibers along flange width
# nftf = number of fibers along flange thickness

set dw [expr $d - 2 * $tf]
set y1 [expr -$d/2]
set y2 [expr -$dw/2]
set y3 [expr $dw/2]
set y4 [expr $d/2]

set z1 [expr -$bf/2]
set z2 [expr -$tw/2]
set z3 [expr $tw/2]
set z4 [expr $bf/2]

section fiberSec $secID {
# nfIJ nfJK yI zI yJ zJ yK zK yL zL
patch quadr $matID $nfbf $nftf $y1 $z4 $y1 $z1 $y2 $z1 $y2 $z4
patch quadr $matID $nftw $nfdw $y2 $z3 $y2 $z2 $y3 $z2 $y3 $z3
patch quadr $matID $nfbf $nftf $y3 $z4 $y3 $z1 $y4 $z1 $y4 $z4
}
}








# create a standard W section given the nominal section properties
# ###################################################################
# Wsection $secID $matID $d $bf $tf $tw $nfdw $nftw $nfbf $nftf
# ###################################################################
#--------------------------------------------------------------------
# W24X335
Wsection 1 1 0.6985 0.3429 0.063 0.0351 12 4 12 4

# ###################################################################
#--------------------------------------------------------------------
# W24X229
Wsection 2 1 0.6604 0.3327 0.0439 0.0244 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X192
Wsection 3 1 0.6477 0.3302 0.0371 0.0206 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X131
Wsection 4 1 0.6223 0.3277 0.0244 0.0154 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X117
Wsection 5 1 0.6172 0.3251 0.0216 0.014 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X84
Wsection 6 1 0.6121 0.2291 0.0196 0.0119 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X22
Wsection 7 2 0.348 0.127 0.008509 0.005842 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X99
Wsection 8 2 0.7544 0.2667 0.017 0.0132 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X108
Wsection 9 2 0.7569 0.2667 0.0193 0.0138 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W27X84
Wsection 10 2 0.6782 0.254 0.0163 0.0117 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X62
Wsection 11 2 0.602 0.1788 0.0150 0.0109 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W21X50
Wsection 12 2 0.5283 0.1659 0.0136 0.009652 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X257
Wsection 13 1 0.4166 0.4064 0.048 0.03 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X311
Wsection 14 1 0.4343 0.4115 0.0574 0.0358 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W33X118
Wsection 15 2 0.8357 0.2921 0.0188 0.014 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X116
Wsection 16 2 0.762 0.2667 0.0216 0.0144 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X68
Wsection 17 2 0.602 0.2278 0.0149 0.0105 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X370
Wsection 18 1 0.4547 0.4191 0.0676 0.0422 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X283
Wsection 19 1 0.4242 0.4089 0.0526 0.0328 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X233
Wsection 20 1 0.4064 0.4039 0.0437 0.0272 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X500
Wsection 21 1 0.4978 0.4318 0.0889 0.0556 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X455
Wsection 22 1 0.4826 0.4267 0.0815 0.0513 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W36X160
Wsection 23 2 0.9144 0.3048 0.0259 0.0165 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W36X135
Wsection 24 2 0.9042 0.3048 0.0201 0.0152 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X99
Wsection 25 2 0.7544 0.2667 0.017 0.0132 12 4 12 4







geomTransf PDelta 1
geomTransf Linear 2


# define nolinear columns
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# column
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# define nolinear column first row
# #########################################################
# element dispBeamColumn $eleTag $iNode $jNode $numIntgrPts $secTag $transfTag <-mass $massDens>

element dispBeamColumn 1 1 2 5 13 1
element dispBeamColumn 2 2 3 5 13 1
element dispBeamColumn 3 3 4 5 13 1

# #########################################################
# define nolinear column second row
# #########################################################

element dispBeamColumn 4 5 6 5 14 1
element dispBeamColumn 5 6 7 5 14 1
element dispBeamColumn 6 7 8 5 14 1

# #########################################################
# define nolinear column 3rd row
# #########################################################

element dispBeamColumn 7 9 10 5 14 1
element dispBeamColumn 8 10 11 5 14 1
element dispBeamColumn 9 11 12 5 14 1

# #########################################################
# define nolinear column 4th row
# #########################################################

element dispBeamColumn 10 13 14 5 14 1
element dispBeamColumn 11 14 15 5 14 1
element dispBeamColumn 12 15 16 5 14 1

# #########################################################
# define nolinear column 5th row
# #########################################################

element dispBeamColumn 13 17 18 5 13 1
element dispBeamColumn 14 18 19 5 13 1
element dispBeamColumn 15 19 20 5 13 1

# #########################################################
# #########################################################
# #########################################################
# #########################################################
# beam
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# define nolinear beams 1st floor
# #########################################################

element dispBeamColumn 16 2 6 5 15 2
element dispBeamColumn 17 6 10 5 15 2
element dispBeamColumn 18 10 14 5 15 2
element dispBeamColumn 19 140 180 5 15 2

# #########################################################
# define nolinear beams 2nd floor
# #########################################################

element dispBeamColumn 20 3 7 5 16 2
element dispBeamColumn 21 7 11 5 16 2
element dispBeamColumn 22 11 15 5 16 2
element dispBeamColumn 23 150 190 5 16 2

# #########################################################
# define nolinear beams 3rd floor
# #########################################################

element dispBeamColumn 24 4 8 5 17 2
element dispBeamColumn 25 8 12 5 17 2
element dispBeamColumn 26 12 16 5 17 2
element dispBeamColumn 27 160 200 5 17 2

# end of element difinition
# #########################################################








set pfile1 "Data/nodesdisplacement node 12 11 10.txt"

set pfile3 "Data/nodeseigenvectormode1.txt"

set pfile4 "Data/nodeseigenvectormode2.txt"

set pfile5 "Data/nodeseigenvectormode3.txt"

set pfile11 "Data/base reaction nodes 1 5 9 13 17.txt"


set pfile13 "Data/envelope dispacement.txt"

set pfile15 "Data/envelope nodal reaction.txt"

set pfile16 "Data/node 12 11 10 reaction.txt"

recorder Node -file $pfile11 -time -node 1 5 9 13 17 -dof 1 reaction

recorder Node -file $pfile16 -time -node 12 11 10 -dof 1 reaction

recorder EnvelopeNode -file $pfile13 -node 12 11 10 -dof 1 disp

recorder Node -file $pfile1 -time -node 12 11 10 -dof 1 disp

recorder Node -file $pfile3 -time -node 12 11 10 -dof 1 "eigen 1"

recorder Node -file $pfile4 -time -node 12 11 10 -dof 1 "eigen 2"

recorder Node -file $pfile5 -time -node 12 11 10 -dof 1 "eigen 3"

# ######################################################################################################################################
# ######################################################################################################################################
# ######################################################################################################################################
# Drift Recorder


set pfile80 "Data/allnodedrift.txt"

# ######################################################################################################################################


recorder Drift -file $pfile80 -time -iNode 11 10 9 -jNode 12 11 10 -dof 1 -perpDirn 2

# ######################################################################################################################################
# ######################################################################################################################################
# end of recorder definition
















eigen 3

constraints Transformation


# ########################################################################################


numberer RCM


# ########################################################################################


system SparseGeneral


# ########################################################################################


test EnergyIncr 1.0e-5 100 1


# ########################################################################################

algorithm Newton


# ########################################################################################


integrator DisplacementControl 12 1 0.001


# ########################################################################################

analysis Static




set h1 0.5459
set h2 0.3244
set h3 0.1296

# ################################################



set mass1 52756

set mass2 48760

set mass3 48760














set outFilename1 Data/Periodmode1.txt
set outFileID1 [open $outFilename1 w]

set outFilename2 Data/Periodmode2.txt
set outFileID2 [open $outFilename2 w]

set outFilename3 Data/Periodmode3.txt
set outFileID3 [open $outFilename3 w]

set outFilename4 Data/modeparticipationfactor1.txt
set outFileID4 [open $outFilename4 w]

set outFilename5 Data/modeparticipationfactor2.txt
set outFileID5 [open $outFilename5 w]

set outFilename6 Data/modeparticipationfactor3.txt
set outFileID6 [open $outFilename6 w]



set outFilename7 Data/h1.txt
set outFileID7 [open $outFilename7 w]

set outFilename8 Data/h2.txt
set outFileID8 [open $outFilename8 w]

set outFilename9 Data/h3.txt
set outFileID9 [open $outFilename9 w]


set ns 0
while {$ns < 300} {

set ns [expr $ns+1]

pattern Plain $ns Linear {

load 12 $h1 0.0 0.0
load 11 $h2 0.0 0.0
load 10 $h3 0.0 0.0

}



analyze 1

eigen 3





set m1 [open "data/nodeseigenvectormode1.txt" r]
set m2 [open "data/nodeseigenvectormode2.txt" r]
set m3 [open "data/nodeseigenvectormode3.txt" r]


set modeshape1 [read $m1]
set modeshape2 [read $m2]
set modeshape3 [read $m3]


set m11 [lindex $modeshape1 [expr 1+($ns-1)*4]]
set m12 [lindex $modeshape1 [expr 2+($ns-1)*4]]
set m13 [lindex $modeshape1 [expr 3+($ns-1)*4]]


set m21 [lindex $modeshape2 [expr 1+($ns-1)*4]]
set m22 [lindex $modeshape2 [expr 2+($ns-1)*4]]
set m23 [lindex $modeshape2 [expr 3+($ns-1)*4]]

set m31 [lindex $modeshape3 [expr 1+($ns-1)*4]]
set m32 [lindex $modeshape3 [expr 2+($ns-1)*4]]
set m33 [lindex $modeshape3 [expr 3+($ns-1)*4]]


set mpf1 [expr ($m11*$mass1+$m12*$mass2+$m13*$mass3)/($m11*$m11*$mass1+$m12*$m12*$mass2+$m13*$m13*$mass3)]
set mpf2 [expr ($m21*$mass1+$m22*$mass2+$m23*$mass3)/($m21*$m21*$mass1+$m22*$m22*$mass2+$m23*$m23*$mass3)]
set mpf3 [expr ($m31*$mass1+$m32*$mass2+$m33*$mass3)/($m31*$m31*$mass1+$m32*$m32*$mass2+$m33*$m33*$mass3)]

puts $outFileID4 $mpf1

puts $outFileID5 $mpf2

puts $outFileID6 $mpf3

set f11 [expr ($mpf1*($m11*$mass1))]
set f12 [expr ($mpf1*($m12*$mass2))]
set f13 [expr ($mpf1*($m13*$mass3))]


set f21 [expr ($mpf2*($m21*$mass1))]
set f22 [expr ($mpf2*($m22*$mass2))]
set f23 [expr ($mpf2*($m23*$mass3))]


set f31 [expr ($mpf3*($m31*$mass1))]
set f32 [expr ($mpf3*($m32*$mass2))]
set f33 [expr ($mpf3*($m33*$mass3))]


set f1sum [expr ($f11+$f12+$f13)]
set f2sum [expr ($f21+$f22+$f23)]
set f3sum [expr ($f31+$f32+$f33)]

set h1 [expr ($f11/$f1sum)]
set h2 [expr ($f12/$f1sum)]
set h3 [expr ($f13/$f1sum)]


puts $outFileID7 $h1
puts $outFileID8 $h2
puts $outFileID9 $h3





set lambda [eigen 3]; # eigenvalue mode 1
set lambda1 [lindex $lambda 0];
set omega1 [expr pow($lambda1,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod1 [expr 2*$PI/$omega1]; # period (sec.)
puts $Tperiod1
puts $outFileID1 $Tperiod1

set lambda2 [lindex $lambda 1];
set omega2 [expr pow($lambda2,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod2 [expr 2*$PI/$omega2]; # period (sec.)
puts $Tperiod2
puts $outFileID2 $Tperiod2

set lambda3 [lindex $lambda 2];
set omega3 [expr pow($lambda3,0.5)];
set PI 3.14159265; # Define Pi
set Tperiod3 [expr 2*$PI/$omega3]; # period (sec.)
puts $Tperiod3
puts $outFileID3 $Tperiod3







}


close $outFileID1
close $outFileID2
close $outFileID3


close $outFileID4
close $outFileID5
close $outFileID6


close $outFileID7
close $outFileID8
close $outFileID9
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

you are not removing the load pattern and you are adding more on....
in the previous script, try ending the command with a ";" before you put in the comment.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
mkk_ce
Posts: 14
Joined: Wed Feb 18, 2009 5:28 am
Location: Shirazu

Post by mkk_ce »

Hi basir
This is your code
i tried to compress your code :wink:


[code]wipe

set dataDir Data

file mkdir $dataDir

model basic -ndm 2 -ndf 3

node 1 0.0 0.0
node 2 0.0 3.96
node 3 0.0 7.92
node 4 0.0 11.88

node 5 9.15 0.0
node 6 9.15 3.96
node 7 9.15 7.92
node 8 9.15 11.88

node 9 18.3 0.0
node 10 18.3 3.96
node 11 18.3 7.92
node 12 18.3 11.88

node 13 27.45 0.0
node 14 27.45 3.96
node 15 27.45 7.92
node 16 27.45 11.88

node 140 27.45 3.96
node 150 27.45 7.92
node 160 27.45 11.88

node 17 36.6 0.0
node 18 36.6 3.96
node 19 36.6 7.92
node 20 36.6 11.88

node 180 36.6 3.96
node 190 36.6 7.92
node 200 36.6 11.88


# ###############################################################################

equalDOF 14 140 1 2
equalDOF 15 150 1 2
equalDOF 16 160 1 2
equalDOF 18 180 1 2
equalDOF 19 190 1 2
equalDOF 20 200 1 2

# ###############################################################################
#supports constrained
#fix nodetag dx dy rz

fix 1 1 1 1
fix 5 1 1 1
fix 9 1 1 1
fix 13 1 1 1
fix 17 1 1 1

# ###############################################################################
# master node wich assign mass in level 1 is node 10 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 10

equalDOF 10 2 1
equalDOF 10 6 1
equalDOF 10 14 1
equalDOF 10 18 1
# ###############################################################################
# master node wich assign mass in level 1 is node 11 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 11

equalDOF 11 3 1
equalDOF 11 7 1
equalDOF 11 15 1
equalDOF 11 19 1
# ###############################################################################
# master node wich assign mass in level 1 is node 12 that other nodes horizental
# degree of freedoms in this level will be constraint to be the same as node 11

equalDOF 12 4 1
equalDOF 12 8 1
equalDOF 12 16 1
equalDOF 12 20 1
# ###############################################################################


uniaxialMaterial ElasticPP 1 20390000000 0.001724 -0.001724 0
uniaxialMaterial ElasticPP 2 20390000000 0.001241 -0.001241 0

set m1 48760.5
set m2 52756.30

mass 10 $m1 0.1 0.0
mass 11 $m1 0.1 0.0
mass 12 $m2 0.1 0.0
# mass node 8 applyed just for creating enough bandwidth to do eigen value analysis for the first three modes because of the software limitations.
mass 8 0.1 0.1 0.0

# end of mass definition


proc Wsection { secID matID d bf tf tw nfdw nftw nfbf nftf} {
# ###################################################################
# Wsection $secID $matID $d $bf $tf $tw $nfdw $nftw $nfbf $nftf
# ###################################################################
# create a standard W section given the nominal section properties
# written: Remo M. de Souza
# date: 06/99
# modified: 08/99 (according to the new general modelbuilder)
# input parameters
# secID - section ID number
# matID - material ID number
# d = nominal depth
# tw = web thickness
# bf = flange width
# tf = flange thickness
# nfdw = number of fibers along web depth
# nftw = number of fibers along web thickness
# nfbf = number of fibers along flange width
# nftf = number of fibers along flange thickness

set dw [expr $d - 2 * $tf]
set y1 [expr -$d/2]
set y2 [expr -$dw/2]
set y3 [expr $dw/2]
set y4 [expr $d/2]

set z1 [expr -$bf/2]
set z2 [expr -$tw/2]
set z3 [expr $tw/2]
set z4 [expr $bf/2]

section fiberSec $secID {
# nfIJ nfJK yI zI yJ zJ yK zK yL zL
patch quadr $matID $nfbf $nftf $y1 $z4 $y1 $z1 $y2 $z1 $y2 $z4
patch quadr $matID $nftw $nfdw $y2 $z3 $y2 $z2 $y3 $z2 $y3 $z3
patch quadr $matID $nfbf $nftf $y3 $z4 $y3 $z1 $y4 $z1 $y4 $z4
}
}




# create a standard W section given the nominal section properties
# ###################################################################
# Wsection $secID $matID $d $bf $tf $tw $nfdw $nftw $nfbf $nftf
# ###################################################################
#--------------------------------------------------------------------
# W24X335
Wsection 1 1 0.6985 0.3429 0.063 0.0351 12 4 12 4

# ###################################################################
#--------------------------------------------------------------------
# W24X229
Wsection 2 1 0.6604 0.3327 0.0439 0.0244 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X192
Wsection 3 1 0.6477 0.3302 0.0371 0.0206 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X131
Wsection 4 1 0.6223 0.3277 0.0244 0.0154 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X117
Wsection 5 1 0.6172 0.3251 0.0216 0.014 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X84
Wsection 6 1 0.6121 0.2291 0.0196 0.0119 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X22
Wsection 7 2 0.348 0.127 0.008509 0.005842 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X99
Wsection 8 2 0.7544 0.2667 0.017 0.0132 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X108
Wsection 9 2 0.7569 0.2667 0.0193 0.0138 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W27X84
Wsection 10 2 0.6782 0.254 0.0163 0.0117 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X62
Wsection 11 2 0.602 0.1788 0.0150 0.0109 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W21X50
Wsection 12 2 0.5283 0.1659 0.0136 0.009652 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X257
Wsection 13 1 0.4166 0.4064 0.048 0.03 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X311
Wsection 14 1 0.4343 0.4115 0.0574 0.0358 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W33X118
Wsection 15 2 0.8357 0.2921 0.0188 0.014 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X116
Wsection 16 2 0.762 0.2667 0.0216 0.0144 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W24X68
Wsection 17 2 0.602 0.2278 0.0149 0.0105 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X370
Wsection 18 1 0.4547 0.4191 0.0676 0.0422 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X283
Wsection 19 1 0.4242 0.4089 0.0526 0.0328 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X233
Wsection 20 1 0.4064 0.4039 0.0437 0.0272 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X500
Wsection 21 1 0.4978 0.4318 0.0889 0.0556 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W14X455
Wsection 22 1 0.4826 0.4267 0.0815 0.0513 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W36X160
Wsection 23 2 0.9144 0.3048 0.0259 0.0165 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W36X135
Wsection 24 2 0.9042 0.3048 0.0201 0.0152 12 4 12 4
# ###################################################################
#--------------------------------------------------------------------
# W30X99
Wsection 25 2 0.7544 0.2667 0.017 0.0132 12 4 12 4







geomTransf PDelta 1
geomTransf Linear 2


# define nolinear columns
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# column
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# define nolinear column first row
# #########################################################
# element dispBeamColumn $eleTag $iNode $jNode $numIntgrPts $secTag $transfTag <-mass $massDens>

element dispBeamColumn 1 1 2 5 13 1
element dispBeamColumn 2 2 3 5 13 1
element dispBeamColumn 3 3 4 5 13 1

# #########################################################
# define nolinear column second row
# #########################################################

element dispBeamColumn 4 5 6 5 14 1
element dispBeamColumn 5 6 7 5 14 1
element dispBeamColumn 6 7 8 5 14 1

# #########################################################
# define nolinear column 3rd row
# #########################################################

element dispBeamColumn 7 9 10 5 14 1
element dispBeamColumn 8 10 11 5 14 1
element dispBeamColumn 9 11 12 5 14 1

# #########################################################
# define nolinear column 4th row
# #########################################################

element dispBeamColumn 10 13 14 5 14 1
element dispBeamColumn 11 14 15 5 14 1
element dispBeamColumn 12 15 16 5 14 1

# #########################################################
# define nolinear column 5th row
# #########################################################

element dispBeamColumn 13 17 18 5 13 1
element dispBeamColumn 14 18 19 5 13 1
element dispBeamColumn 15 19 20 5 13 1

# #########################################################
# #########################################################
# #########################################################
# #########################################################
# beam
# #########################################################
# #########################################################
# #########################################################
# #########################################################
# define nolinear beams 1st floor
# #########################################################

element dispBeamColumn 16 2 6 5 15 2
element dispBeamColumn 17 6 10 5 15 2
element dispBeamColumn 18 10 14 5 15 2
element dispBeamColumn 19 140 180 5 15 2

# #########################################################
# define nolinear beams 2nd floor
# #########################################################

element dispBeamColumn 20 3 7 5 16 2
element dispBeamColumn 21 7 11 5 16 2
element dispBeamColumn 22 11 15 5 16 2
element dispBeamColumn 23 150 190 5 16 2

# #########################################################
# define nolinear beams 3rd floor
# #########################################################

element dispBeamColumn 24 4 8 5 17 2
element dispBeamColumn 25 8 12 5 17 2
element dispBeamColumn 26 12 16 5 17 2
element dispBeamColumn 27 160 200 5 17 2

# end of element difinition
# #########################################################








set pfile1 "Data/nodesdisplacement node 12 11 10.txt"

set pfile3 "Data/nodeseigenvectormode1.txt"

set pfile4 "Data/nodeseigenvectormode2.txt"

set pfile5 "Data/nodeseigenvectormode3.txt"

set pfile11 "Data/base reaction nodes 1 5 9 13 17.txt"


set pfile13 "Data/envelope dispacement.txt"

set pfile15 "Data/envelope nodal reaction.txt"

set pfile16 "Data/node 12 11 10 reaction.txt"

recorder Node -file $pfile11 -time -node 1 5 9 13 17 -dof 1 reaction

recorder Node -file $pfile16 -time -node 12 11 10 -dof 1 reaction

recorder EnvelopeNode -file $pfile13 -node 12 11 10 -dof 1 disp

recorder Node -file $pfile1 -time -node 12 11 10 -dof 1 disp

recorder Node -file $pfile3 -time -node 12 11 10 -dof 1 "eigen 1"

recorder Node -file $pfile4 -time -node 12 11 10 -dof 1 "eigen 2"

recorder Node -file $pfile5 -time -node 12 11 10 -dof 1 "eigen 3"

# ######################################################################################################################################
# ######################################################################################################################################
# ######################################################################################################################################
# Drift Recorder


set pfile80 "Data/allnodedrift.txt"

# ######################################################################################################################################


recorder Drift -file $pfile80 -time -iNode 11 10 9 -jNode 12 11 10 -dof 1 -perpDirn 2

# ######################################################################################################################################
# ######################################################################################################################################
# end of recorder definition

set nMode 3
eigen $nMode

constraints Transformation
numberer RCM
system SparseGeneral
test EnergyIncr 1.0e-5 100 0
algorithm Newton
integrator DisplacementControl 12 1 0.001
analysis Static


set h(1) 0.5459
set h(2) 0.3244
set h(3) 0.1296


set mass(1) 52756
set mass(2) 48760
set mass(3) 48760

set outFilename1 Data/Periodmode1.txt
set outFileID(1) [open $outFilename1 w]

set outFilename2 Data/Periodmode2.txt
set outFileID(2) [open $outFilename2 w]

set outFilename3 Data/Periodmode3.txt
set outFileID(3) [open $outFilename3 w]


set outFilename4 Data/modeparticipationfactor1.txt
set outFileID(4) [open $outFilename4 w]

set outFilename5 Data/modeparticipationfactor2.txt
set outFileID(5) [open $outFilename5 w]

set outFilename6 Data/modeparticipationfactor3.txt
set outFileID(6) [open $outFilename6 w]



set outFilename7 Data/h1.txt
set outFileID(7) [open $outFilename7 w]

set outFilename8 Data/h2.txt
set outFileID(8) [open $outFilename8 w]

set outFilename9 Data/h3.txt
set outFileID(9) [open $outFilename9 w]


set ns 0
while {$ns < 300} {

set ns [expr $ns+1]

pattern Plain $ns Linear {
load 12 $h(1) 0.0 0.0
load 11 $h(2) 0.0 0.0
load 10 $h(3) 0.0 0.0
}

analyze 1
eigen $nMode

for {set j 1} {$j <= $nMode} {incr j +1} {
set mm($j) [open "data/nodeseigenvectormode$j.txt" r]
set modeshape($j) [read $mm($j)]
#puts $modeshape($j)
}

set tmp modeshape
for {set i 1} {$i <= $nMode} {incr i +1} {
for {set j 1} {$j <= $nMode} {incr j +1} {
set m($i,$j) [lindex $modeshape($i) [expr $j+($ns-1)*4]]
}
# puts " "
}


set tmp1 0
set tmp2 0
for {set i 1} {$i <= $nMode} {incr i +1} {
for {set j 1} {$j <= $nMode} {incr j +1} {
# puts $m($i,$j)
set tmp1 [expr $tmp1+$m($i,$j)*$mass($j)]
#puts tmp1
set tmp2 [expr $tmp2+pow($m($i,$j),2)*$mass($j)]
}
set mpf($i) [expr $tmp1/$tmp2]
}

for {set j 1} {$j <= $nMode} {incr j +1} {
puts $outFileID([expr $j+3]) $mpf($j)
}

for {set i 1} {$i <= $nMode} {incr i +1} {
set fsum($i) 0
for {set j 1} {$j <= $nMode} {incr j +1} {
set f($i,$j) [expr ($mpf($i)*($m($i,$j)*$mass($j)))]
set fsum($i) [expr $fsum($i)+$f($i,$j)]
}
# puts $fsum($i)
set h($i) [expr ($f(1,$i)/$fsum(1))]
}


puts $outFileID(7) $h(1)
puts $outFileID(8) $h(2)
puts $outFileID(9) $h(3)

set PI [expr asin(1.0)]
set Lambda [eigen $nMode]; # eigenvalue mode 1
for {set j 1} {$j <= $nMode} {incr j +1} {
set lambda [lindex $Lambda [expr $j-1]];
set omega [expr pow($lambda,0.5)];
set Tperiod($j) [expr 2*$PI/$omega]
# puts $Tperiod($j)
puts $outFileID($j) $Tperiod($j)
}

}

for {set j 1} {$j <= [expr $nMode*$nMode]} {incr j +1} {
close $outFileID($j)
}[/code]
Post Reply