The natural period and frequency of the structure can be determined at any point during the analysis using the eigen command. In turn, these quantities can be stored as variables and used in defining analysis parameters, such as rayleigh-damping parameters:
# ------------PeriodFreq&Damping.tcl-----------------------------------------------------------------
# determine Natural Period, Frequency & damping parameters for SDOF
set $xDamp 0.02; # damping ratio (0.02-0.05-typical)
set lambda [eigen 1]
set omega [expr pow($lambda,0.5)]
set Tperiod [expr 2*$PI/$omega]; # period (sec.)
puts $Tperiod
set alphaM 0; # stiffness-prop. RAYLEIGH damping parameter; D = alphaM*M
set betaK 0; # stiffness proportional damping; +beatK*KCurrent
set betaKcomm [expr 2*$xDamp/$omega]; # mass-prop. RAYLEIGH damping parameter; +betaKcomm*KlastCommitt
set betaKinit 0; # initial-stiffness proportional damping +beatKinit*Kini