PageRenderTime 69ms CodeModel.GetById 6ms RepoModel.GetById 0ms app.codeStats 0ms

/opensees-websocket/DIST/Ex8.genericFrame3D.analyze.Dynamic.EQ.bidirect.tcl

https://code.google.com/
TCL | 99 lines | 67 code | 11 blank | 21 comment | 11 complexity | bb1c0bc982bfccbefc75d5c6d80cca26 MD5 | raw file
  1. # --------------------------------------------------------------------------------------------------
  2. # Example 8. Bidirectional Uniform Eartquake Excitation
  3. # Silvia Mazzoni & Frank McKenna, 2006
  4. # execute this file after you have built the model, and after you apply gravity
  5. #
  6. # source in procedures
  7. source ReadSMDfile.tcl; # procedure for reading GM file and converting it to proper format
  8. # Bidirectional Uniform Earthquake ground motion (uniform acceleration input at all support nodes)
  9. set iGMfile "H-E01140 H-E12140" ; # ground-motion filenames, should be different files
  10. set iGMdirection "1 3"; # ground-motion direction
  11. set iGMfact "1.5 0.75"; # ground-motion scaling factor
  12. # Define DISPLAY -------------------------------------------------------------
  13. # the deformed shape is defined in the build file
  14. recorder plot $dataDir/DFree.out DisplDOF[lindex $iGMdirection 0] 1200 10 400 400 -columns 1 [expr 1+[lindex $iGMdirection 0]] ; # a window to plot the nodal displacements versus time
  15. recorder plot $dataDir/DFree.out DisplDOF[lindex $iGMdirection 1] 1200 410 400 400 -columns 1 [expr 1+[lindex $iGMdirection 1]] ; # a window to plot the nodal displacements versus time
  16. # set up ground-motion-analysis parameters
  17. set DtAnalysis [expr 0.01*$sec]; # time-step Dt for lateral analysis
  18. set TmaxAnalysis [expr 10. *$sec]; # maximum duration of ground-motion analysis -- should be 50*$sec
  19. # ----------- set up analysis parameters
  20. source LibAnalysisDynamicParameters.tcl; # constraintsHandler,DOFnumberer,system-ofequations,convergenceTest,solutionAlgorithm,integrator
  21. # ------------ define & apply damping
  22. # RAYLEIGH damping parameters, Where to put M/K-prop damping, switches (http://opensees.berkeley.edu/OpenSees/manuals/usermanual/1099.htm)
  23. # D=$alphaM*M + $betaKcurr*Kcurrent + $betaKcomm*KlastCommit + $beatKinit*$Kinitial
  24. set xDamp 0.02; # damping ratio
  25. set MpropSwitch 1.0;
  26. set KcurrSwitch 0.0;
  27. set KcommSwitch 1.0;
  28. set KinitSwitch 0.0;
  29. set nEigenI 1; # mode 1
  30. set nEigenJ 3; # mode 3
  31. set lambdaN [eigen [expr $nEigenJ]]; # eigenvalue analysis for nEigenJ modes
  32. set lambdaI [lindex $lambdaN [expr $nEigenI-1]]; # eigenvalue mode i
  33. set lambdaJ [lindex $lambdaN [expr $nEigenJ-1]]; # eigenvalue mode j
  34. set omegaI [expr pow($lambdaI,0.5)];
  35. set omegaJ [expr pow($lambdaJ,0.5)];
  36. set alphaM [expr $MpropSwitch*$xDamp*(2*$omegaI*$omegaJ)/($omegaI+$omegaJ)]; # M-prop. damping; D = alphaM*M
  37. set betaKcurr [expr $KcurrSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # current-K; +beatKcurr*KCurrent
  38. set betaKcomm [expr $KcommSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # last-committed K; +betaKcomm*KlastCommitt
  39. set betaKinit [expr $KinitSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # initial-K; +beatKinit*Kini
  40. rayleigh $alphaM $betaKcurr $betaKinit $betaKcomm; # RAYLEIGH damping
  41. # --------------------------------- perform Dynamic Ground-Motion Analysis
  42. # the following commands are unique to the Uniform Earthquake excitation
  43. set IDloadTag 400; # for uniformSupport excitation
  44. # Uniform EXCITATION: acceleration input
  45. foreach GMdirection $iGMdirection GMfile $iGMfile GMfact $iGMfact {
  46. incr IDloadTag;
  47. set inFile $GMdir/$GMfile.at2
  48. set outFile $GMdir/$GMfile.g3; # set variable holding new filename (PEER files have .at2/dt2 extension)
  49. ReadSMDFile $inFile $outFile dt; # call procedure to convert the ground-motion file
  50. set GMfatt [expr $g*$GMfact]; # data in input file is in g Unifts -- ACCELERATION TH
  51. set AccelSeries "Series -dt $dt -filePath $outFile -factor $GMfatt"; # time series information
  52. pattern UniformExcitation $IDloadTag $GMdirection -accel $AccelSeries ; # create Unifform excitation
  53. }
  54. set Nsteps [expr int($TmaxAnalysis/$DtAnalysis)];
  55. set ok [analyze $Nsteps $DtAnalysis]; # actually perform analysis; returns ok=0 if analysis was successful
  56. if {$ok != 0} { ; # analysis was not successful.
  57. # --------------------------------------------------------------------------------------------------
  58. # change some analysis parameters to achieve convergence
  59. # performance is slower inside this loop
  60. # Time-controlled analysis
  61. set ok 0;
  62. set controlTime [getTime];
  63. while {$controlTime < $TmaxAnalysis && $ok == 0} {
  64. set controlTime [getTime]
  65. set ok [analyze 1 $DtAnalysis]
  66. if {$ok != 0} {
  67. puts "Trying Newton with Initial Tangent .."
  68. test NormDispIncr $Tol 1000 0
  69. algorithm Newton -initial
  70. set ok [analyze 1 $DtAnalysis]
  71. test $testTypeDynamic $TolDynamic $maxNumIterDynamic 0
  72. algorithm $algorithmTypeDynamic
  73. }
  74. if {$ok != 0} {
  75. puts "Trying Broyden .."
  76. algorithm Broyden 8
  77. set ok [analyze 1 $DtAnalysis]
  78. algorithm $algorithmTypeDynamic
  79. }
  80. if {$ok != 0} {
  81. puts "Trying NewtonWithLineSearch .."
  82. algorithm NewtonLineSearch .8
  83. set ok [analyze 1 $DtAnalysis]
  84. algorithm $algorithmTypeDynamic
  85. }
  86. }
  87. }; # end if ok !0
  88. puts "Ground Motion Done. End Time: [getTime]"