Problem related to Eigen Analysis

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

Moderators: silvia, selimgunay, Moderators

Post Reply
RafidSHuq
Posts: 1
Joined: Wed Nov 18, 2020 8:55 pm

Problem related to Eigen Analysis

Post by RafidSHuq » Sat Feb 06, 2021 2:26 pm

For a 7 storied HSS steel cross braced timber frame with post tension, the Time Period is coming much higher (2.17 s) than expected and also when number of stories is limited to one as shown in the code below, I am getting the following error:

ArpackSolver::Error with _saupd info = -9
Starting vector is zero.
WARNING DirectIntegrationAnalysis::eigen() - EigenSOE failed in solve()
missing function argument at _@_
in expression "pow(_@_,0.5)"

Any suggestion?
----------------------------------------------------------------------------------------------------
## Units: kiloNewtons (kN), millimetres (mm), seconds (s)

###################################################################################################
# Set Up & Source Definition #
###################################################################################################
wipe all;
model BasicBuilder -ndm 3 -ndf 6;

###################################################################################################
# Define type of support: "Pinned" = pinned; "Fixed" = fixed;
###################################################################################################

set SupportType "Pinned";

###################################################################################################
# Define type of Beam Column connection: "Pinned" = pinned; "Partial" = partial; "Rigid" = rigid;
###################################################################################################
# If the connection type is partial, please assign the K_panel value.
set ConnectionType "Pinned";

###################################################################################################
# Define if there is post-tensioning behavior
###################################################################################################
set additionalFunc "PostTension"; #"PostTension" Or "None"

###################################################################################################
# Define Frame Geometry, Nodes, and Constraints
###################################################################################################
# define structure-geometry parameters
#--------------------------------------------------------------------------------------------
set WBay 6500.; # Bay width in millimeters
set HPanel {3700.}; # Height of each panel in millimeters
set TypicalSeismicWeight 1229.; # Weight of Typical Floors (in kN)
set TopFloorSeismicWeight 983.; # Weight of Top Floor (in kN)

#Typical Floors
set P_LC 1075.; # Gravity columns axial force demand (7/8 of Floor Gravity Load)
set P_SC 77.; # BF Columns axial force demand (1/16 of Floor Gravity Loadin Each Node)

#Top Floor
set P_LC_TOP 860.; # Gravity columns axial force demand (7/8 of Floor Gravity Load)
set P_SC_TOP 61.5; # BF Columns axial force demand (1/16 of Floor Gravity Load in Each Node)

set Pi 3.14159265;

# Initial out-of-straightness
set f_L [expr 1/500.]; # Initial Imperfection of Brace
set f_L_C [expr 1/1000.]; # Initial Imperfection of Column

#--------------------------------------------------------------------------------------------

set NStory [llength $HPanel]; # number of stories
if {$NStory > 20} {
puts "WARNING! the number of story exceed 20"
};

#----------------------------------------------------------------------------------------------
# Characteristics of the Beams and Columns:
# ---------------------------------------------------------------------------------------------
# Define Column Section REC 465 x 465
set b_column 465.;
set h_column 465.;
set A_column [expr $b_column*$h_column]; # mm^2
set Iy_column [expr 1./12 * $h_column * pow($b_column,3)];
set Iz_column [expr 1./12 * $b_column * pow($h_column,3)];
set J_column [expr $b_column*pow($h_column,3)*(1./3.-0.21*$h_column/$h_column*(1-(pow($h_column,4)/12./pow($b_column,4))))]; # mm^4

set A_column_rigid [expr $A_column * 10.];
set Iy_column_rigid [expr $Iy_column * 10.];
set Iz_column_rigid [expr $Iz_column * 10.];
set J_column_rigid [expr $J_column * 10.];

## Define Beam Section REC 265 x 494
set b_beam 265.;
set h_beam 494.;
set Astrut_12 [expr $b_beam*$h_beam]; # mm^2
set Strut_Iy [expr 1./12 * $h_beam * pow($b_beam,3)];
set Strut_Iz [expr 1./12 * $b_beam * pow($h_beam,3)];
set Strut_J [expr $b_beam*pow($h_beam,3)*(1./3.-0.21*$h_beam/$h_beam*(1-(pow($h_beam,4)/12./pow($b_beam,4))))]; # mm^4

set Astrut_12_rigid [expr $Astrut_12 * 10.];
set Strut_Iy_rigid [expr $Strut_Iy * 10.];
set Strut_Iz_rigid [expr $Strut_Iz * 10.];
set Strut_J_rigid [expr $Strut_J * 10.];

#----------------------------------------------------------------------------------------------
# Characteristics of the Braces:
#----------------------------------------------------------------------------------------------
# Be careful! The number of braces should be the same as the NStory
# Be aware! The brace member have to be HSS (square-hollowed)

# Brace cross-sectional properties - 64x64x4.8 - for Panel 1
set A(1) 656.;
set b(1) 44.5;
set d(1) 44.5;
set t(1) 4.8;
set J(1) 246000.;

# Gusse Plate Properties
# ----------------------------
# Gusset Stiffness & Strength
set Gusset_C_torsion_1 40352.;

set Gusset_Mp_bending_1 15059.;
set Gusset_C_bending_1 1169196.;


set Gusset_Mp_bending_2 15059.;
set Gusset_C_bending_2 1169196.;

#----------------------------------------------------------------------------------------------
set NBrace [array size t]
if { $NBrace != $NStory} {
puts " ";
puts "WARNING! the number of brace member is wrong!";
puts "The NBrace should equal to NStory!";
puts " ";
};
#----------------------------------------------------------------------------------------------
# Define Rigid Element
set A_Rigid 6560.; # 10 times of brace section

set Iy_Rigid 1690000.; # 10 times of brace section
set Iz_Rigid 1690000.; # 10 times of brace section
set J_Rigid 2460000.; # 10 times of brace section

# Define P-delta Columns and Rigid Links
set TrussMatID 600; # define a material ID
set ALean [expr 3 * $A_column]; # define area of truss section (make much larger than A of frame elements)
set ILean [expr 3 * $Iz_column]; # moment of inertia for p-delta columns (make much larger than I of frame elements)
set JLean [expr 3 * $J_column]; # moment of inertia for p-delta columns (make much larger than I of frame elements)

# Steel material properties
# -------------------------
set Es 200.0;
set nu 0.3;
set G [expr $Es / 2. / (1 + $nu)];
set Fy_B 0.345;

# Timber material properties
set E_t 12.8;
set G_t 0.82;

###################################################################################################
###################################################################################################
# Number of elements and integration points
# Do not change this number
set NELEM 10; # Number of element of brace members
set NELEMC 6; # Number of element of columns
set ptoint 5;

#------------------------------------------------------------------------------------------
set NBays 1;
set HBuilding 0.0;
set HFloor 0.0;
set Floor {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set HStory_H {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
set HBuilding [expr $HBuilding + [lindex $HPanel [expr $h-1]]]; # height of building
set HFloor [expr $HFloor + [lindex $HPanel [expr $h-1]]];
lset Floor $h $HFloor;
set Story_H [expr 0.8*[lindex $HPanel [expr $h-1]]];
lset HStory_H $h $Story_H
};

# Calculate Locations of Beam/Column Joints:
set Pier1 0.0; # left column line
set Pier2 [expr $Pier1 + $WBay]; # right column line
set Pier3 [expr $Pier2 + $WBay]; # P-delta column line
set Negligible 1e-9; # a very smnumber to avoid problems with zero

# Strut End Rigid Zone
# --------------------------------------------------------
set Strut_R_L [expr $WBay * 0.05]; # Beam Rigid Length

# Column End Rigid Zone
# --------------------------------------------------------
set Column_R_L_B {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.}; # Column Rigid Length Top
set Column_R_L_T {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.}; # Column Rigid Length Bottom
set Column_L_H {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.}; # Column height between rigid zones
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
set Column_R_L_B_H [expr [lindex $HPanel [expr $h-1]] * 0.05];
set Column_R_L_T_H [expr [lindex $HPanel [expr $h-1]] * 0.05];
set Column_L_H_H [expr [lindex $HPanel [expr $h-1]] - $Column_R_L_B_H - $Column_R_L_T_H];
lset Column_R_L_B $h $Column_R_L_B_H;
lset Column_R_L_T $h $Column_R_L_T_H;
lset Column_L_H $h $Column_L_H_H;
};

# Bracing Members: Length, Material, and Brace cosine/sine
# --------------------------------------------------------
set Brace_L {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.}; # Length of Brace
set Brace_L_H {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set Brace_L_C {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set Gasset_R_Zone {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set Gasset_L_Zone {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set Teta {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set cosTeta {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};
set sinTeta {0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.};

for {set h 1} { $h < [expr $NStory + 1]} {incr h 1} {
set Brace_L_N [expr sqrt([expr [lindex $HPanel [expr $h-1]] * [lindex $HPanel [expr $h-1]]] + $WBay*$WBay)];
set Brace_L_H_N [expr $Brace_L_N * 0.8];
set Brace_L_C_N [expr $Brace_L_N * 0.45 - $b($h)];
set Gasset_R_Zone_N [expr 0.05 * $Brace_L_N];
set Gasset_L_Zone_N [expr 0.05 * $Brace_L_N];
set TetaN [expr tan([lindex $HPanel [expr $h-1]] / $WBay)];
set cosTetaN [expr $WBay/$Brace_L_N];
set sinTetaN [expr [lindex $HPanel [expr $h-1]]/$Brace_L_N];

lset Brace_L $h $Brace_L_N;
lset Brace_L_H $h $Brace_L_H_N;
lset Brace_L_C $h $Brace_L_C_N;
lset Gasset_R_Zone $h $Gasset_R_Zone_N;
lset Gasset_L_Zone $h $Gasset_L_Zone_N;
lset Teta $h $TetaN;
lset cosTeta $h $cosTetaN;
lset sinTeta $h $sinTetaN;
};

# Base node for leaning column
node 1 $Pier3 0. 0.;
# define nodes and assign masses to beam-column intersections of frame
# ---------------------------------------------------------------------------------------
for {set h 1} { $h < [expr $NStory + 1]} {incr h 1} {

# Main frame node
node [expr $h*100+1] $Pier1 [lindex $Floor [expr $h-1]] 0.;
node [expr $h*100+2] $Pier2 [lindex $Floor [expr $h-1]] 0.;
node [expr $h*100+3] $Pier1 [lindex $Floor $h] 0.;
node [expr $h*100+4] $Pier2 [lindex $Floor $h] 0.;

# node for leaning column
node [expr $h*10000+1] $Pier3 [lindex $Floor $h] 0.;
node [expr $h*10000+2] $Pier3 [lindex $Floor $h] 0.;

# Column rigid zone nodes
node [expr $h*100+10] $Pier1 [expr [lindex $Floor [expr $h-1]] + [lindex $Column_R_L_B $h]] 0.;
node [expr $h*100+20] $Pier2 [expr [lindex $Floor [expr $h-1]] + [lindex $Column_R_L_B $h]] 0.;
node [expr $h*100+16] $Pier1 [expr [lindex $Floor $h] - [lindex $Column_R_L_T $h]] 0.;
node [expr $h*100+26] $Pier2 [expr [lindex $Floor $h] - [lindex $Column_R_L_T $h]] 0.;

# Column middle nodes
for {set i [expr $h*100+11]} {$i < [expr $NELEMC + [expr $h*100+10]]} {incr i 1} {
set Li [expr ($i - [expr $h*100+10]) * ([lindex $Column_L_H $h]/ ($NELEMC))]; # Length of each six parts in middle of columns
set xi [expr $Pier1 + ($f_L_C * [lindex $Column_L_H $h] * sin($Pi * $Li / [lindex $Column_L_H $h]))];
set yi [expr ([lindex $Floor [expr $h-1]] + [lindex $Column_R_L_B $h] + $Li)];
set fci [expr $f_L_C * [lindex $HStory_H $h] * sin($Pi * ($Li + [lindex $Column_R_L_B $h]) / [lindex $HStory_H $h])];
node $i $xi $yi $fci;
};
for {set i [expr $h*100+21]} {$i < [expr $NELEMC + [expr $h*100+20]]} {incr i 1} {
set Li [expr ($i - [expr $h*100+20]) * ([lindex $Column_L_H $h]/ ($NELEMC))];
set xi [expr $Pier2 + ($f_L_C * [lindex $Column_L_H $h] * sin($Pi * $Li / [lindex $Column_L_H $h]))];
set yi [expr ([lindex $Floor [expr $h-1]] + [lindex $Column_R_L_B $h] + $Li)];
set fci [expr $f_L_C * [lindex $HStory_H $h] * sin($Pi * ($Li + [lindex $Column_R_L_B $h]) / [lindex $HStory_H $h])];
node $i $xi $yi $fci;
};

# Nodes on Beams
node [expr $h*100+70] $Pier1 [lindex $Floor $h] 0.;
node [expr $h*100+71] [expr $Pier1 + $Strut_R_L] [lindex $Floor $h] 0.;
node [expr $h*100+72] [expr $Pier2 - $Strut_R_L] [lindex $Floor $h] 0.;
node [expr $h*100+73] $Pier2 [lindex $Floor $h] 0.;
if {$additionalFunc == "PostTension"} {
node [expr $h*100+82] [expr $Pier1 + $Strut_R_L] [lindex $Floor $h] 0.;
node [expr $h*100+83] [expr $Pier2 - $Strut_R_L] [lindex $Floor $h] 0.;
};

# Nodes on Brace members
#------------------------------------------------------------------------
# Nodes on the end of Braces (Hinge)
node [expr $h*100+30] $Pier1 [lindex $Floor [expr $h-1]] 0.;
node [expr $h*100+50] $Pier2 [lindex $Floor [expr $h-1]] 0.;
node [expr $h*100+66] $Pier1 [lindex $Floor $h] 0.;
node [expr $h*100+46] $Pier2 [lindex $Floor $h] 0.;

# Nodes on the rigid zone of braces
node [expr $h*100+31] [expr $Pier1 + [lindex $cosTeta $h] * [lindex $Gasset_R_Zone $h]] [expr [lindex $Floor [expr $h-1]] + [lindex $sinTeta $h] * [lindex $Gasset_R_Zone $h]] 0.;
node [expr $h*100+51] [expr $Pier2 - [lindex $cosTeta $h] * [lindex $Gasset_R_Zone $h]] [expr [lindex $Floor [expr $h-1]] + [lindex $sinTeta $h] * [lindex $Gasset_R_Zone $h]] 0.;
node [expr $h*100+65] [expr $Pier1 + [lindex $cosTeta $h] * [lindex $Gasset_L_Zone $h]] [expr [lindex $Floor $h] - [lindex $sinTeta $h] * [lindex $Gasset_L_Zone $h]] 0.;
node [expr $h*100+45] [expr $Pier2 - [lindex $cosTeta $h] * [lindex $Gasset_L_Zone $h]] [expr [lindex $Floor $h] - [lindex $sinTeta $h] * [lindex $Gasset_L_Zone $h]] 0.;

# Nodes of braces plastic hinge
node [expr $h*100+32] [expr $Pier1 + [lindex $cosTeta $h] * [lindex $Gasset_R_Zone $h]] [expr [lindex $Floor [expr $h-1]] + [lindex $sinTeta $h] * [lindex $Gasset_R_Zone $h]] 0.;
node [expr $h*100+52] [expr $Pier2 - [lindex $cosTeta $h] * [lindex $Gasset_R_Zone $h]] [expr [lindex $Floor [expr $h-1]] + [lindex $sinTeta $h] * [lindex $Gasset_R_Zone $h]] 0.;
node [expr $h*100+64] [expr $Pier1 + [lindex $cosTeta $h] * [lindex $Gasset_L_Zone $h]] [expr [lindex $Floor $h] - [lindex $sinTeta $h] * [lindex $Gasset_L_Zone $h]] 0.;
node [expr $h*100+44] [expr $Pier2 - [lindex $cosTeta $h] * [lindex $Gasset_L_Zone $h]] [expr [lindex $Floor $h] - [lindex $sinTeta $h] * [lindex $Gasset_L_Zone $h]] 0.;

# Nodes at the middle of rigid zone of braces
node [expr $h*100+38] [expr $Pier1 + 0.5 * $WBay] [expr [lindex $Floor [expr $h-1]] + 0.5 * [lindex $HPanel [expr $h-1]]] 0.;

node [expr $h*100+37] [expr $Pier1 + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $sinTeta $h])] 0.;
node [expr $h*100+57] [expr $Pier2 - (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $sinTeta $h])] 0.;

node [expr $h*100+59] [expr $Pier1 + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) + $b($h)) * [lindex $sinTeta $h])] 0.;
node [expr $h*100+39] [expr $Pier2 - (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) + $b($h)) * [lindex $sinTeta $h])] 0.;
node [expr $h*100+80] [expr $Pier2 - (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $sinTeta $h])] 0.;
node [expr $h*100+81] [expr $Pier1 + (((0.5 * [lindex $Brace_L $h]) - $b($h)) * [lindex $cosTeta $h])] [expr [lindex $Floor [expr $h-1]] + (((0.5 * [lindex $Brace_L $h]) + $b($h)) * [lindex $sinTeta $h])] 0.;

# Brace middle nodes at each story
# ----------------------------------------
for {set i [expr $h*100+33]} {$i < [expr ($NELEM/2) + [expr $h*100+32]]} {incr i 1} {
set Li [expr ($i - [expr $h*100+32]) * ([lindex $Brace_L_C $h] / ($NELEM/2)) ];
set xi [expr ([lindex $Gasset_R_Zone $h] + $Li )* [lindex $cosTeta $h]];
set yi [expr [lindex $Floor [expr $h-1]] + ([lindex $Gasset_R_Zone $h] + $Li) * [lindex $sinTeta $h]];
set fi [expr $f_L * [lindex $Brace_L_C $h] * sin($Pi * $Li / [lindex $Brace_L_C $h])];
node $i $xi $yi $fi;
};

for {set i [expr $h*100+43]} {$i > [expr [expr $h*100+44] - ($NELEM/2)]} {incr i -1} {
set Li [expr ([expr $h*100+44] - $i) * ([lindex $Brace_L_C $h] / ($NELEM/2)) ];
set xi [expr $Pier2 - ([lindex $Gasset_R_Zone $h] + $Li )* [lindex $cosTeta $h]];
set yi [expr [lindex $Floor $h] - ([lindex $Gasset_R_Zone $h] + $Li) * [lindex $sinTeta $h]];
set fi [expr $f_L * (-1) * [lindex $Brace_L_C $h] * sin($Pi * $Li / [lindex $Brace_L_C $h])];
node $i $xi $yi $fi;
};

for {set i [expr $h*100+53]} {$i < [expr ($NELEM/2) + [expr $h*100+52]]} {incr i 1} {
set Li [expr ($i - [expr $h*100+52]) * ([lindex $Brace_L_C $h] / ($NELEM/2)) ];
set xi [expr $Pier2 - ([lindex $Gasset_R_Zone $h] + $Li )* [lindex $cosTeta $h]];
set yi [expr [lindex $Floor [expr $h-1]] + ([lindex $Gasset_R_Zone $h] + $Li) * [lindex $sinTeta $h]];
set fi [expr $f_L * [lindex $Brace_L_C $h] * sin($Pi * $Li / [lindex $Brace_L_C $h])];
node $i $xi $yi $fi;
};

for {set i [expr $h*100+63]} {$i > [expr [expr $h*100+64] - ($NELEM/2)]} {incr i -1} {
set Li [expr ([expr $h*100+64] - $i) * ([lindex $Brace_L_C $h] / ($NELEM/2)) ];
set xi [expr ([lindex $Gasset_R_Zone $h] + $Li )* [lindex $cosTeta $h]];
set yi [expr [lindex $Floor $h] - ([lindex $Gasset_R_Zone $h] + $Li) * [lindex $sinTeta $h]];
set fi [expr $f_L * (-1) * [lindex $Brace_L_C $h] * sin($Pi * $Li / [lindex $Brace_L_C $h])];
node $i $xi $yi $fi;
};
};

# Equal translational displacements at member connections
#-------------------------------------------------------
if {$SupportType == "Pinned"} {
fix 101 1 1 1 0 1 0;
fix 102 1 1 1 0 1 0;
} elseif { $SupportType == "Fixed"} {
fix 101 1 1 1 1 1 1;
fix 102 1 1 1 1 1 1;
};

for {set h 1} { $h < [expr $NStory + 1]} {incr h 1} {
fix [expr $h*100+3] 0 0 1 0 1 0;
fix [expr $h*100+4] 0 0 1 0 1 0;
};

fix 1 1 1 1 0 1 0;

# constrain beam-column joints in a floor to have the same lateral displacement using the "equalDOF" command
#---------------------------------------------------------------------------------------------------------------
set dof1 1; # constrain movement in dof 1 (x-direction)
set dof2 2; # constrain movement in dof 2 (y-direction)
set dof3 3; # constrain movement in dof 3 (z-direction)
set dof4 4; # constrain Rotation about dof 1 (x-direction)
set dof5 5; # constrain Rotation about dof 2 (y-direction)
set dof6 6; # constrain Rotation about dof 3 (z-direction)

for {set h 1} { $h < $NStory} {incr h 1} {
equalDOF [expr $h*100+3] [expr ($h+1)*100+1] $dof1 $dof2 $dof3 $dof4 $dof5 $dof6;
equalDOF [expr $h*100+4] [expr ($h+1)*100+2] $dof1 $dof2 $dof3 $dof4 $dof5 $dof6;
};

for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
# The end of braces are pinned connected to the corner
equalDOF [expr $h*100+1] [expr $h*100+30] $dof1 $dof2 $dof3 $dof4 $dof5;
equalDOF [expr $h*100+2] [expr $h*100+50] $dof1 $dof2 $dof3 $dof4 $dof5;
equalDOF [expr $h*100+3] [expr $h*100+66] $dof1 $dof2 $dof3 $dof4 $dof5;
equalDOF [expr $h*100+4] [expr $h*100+46] $dof1 $dof2 $dof3 $dof4 $dof5;

# release rotating resistance for Leaning column
equalDOF [expr $h*10000+1] [expr $h*10000+2] $dof1 $dof2 $dof3 $dof4 $dof5;

if {$ConnectionType == "Rigid"} {
equalDOF [expr $h*100+3] [expr $h*100+70] $dof1 $dof2 $dof3 $dof4 $dof5 $dof6;
equalDOF [expr $h*100+4] [expr $h*100+73] $dof1 $dof2 $dof3 $dof4 $dof5 $dof6;
};

if {$additionalFunc == "PostTension"} {
equalDOF [expr $h*100+71] [expr $h*100+82] $dof1 $dof2 $dof3 $dof4 $dof5;
equalDOF [expr $h*100+72] [expr $h*100+83] $dof1 $dof2 $dof3 $dof4 $dof5;
};

};

# Masses
#-------------------------------------------------------------------
for {set h 1} { $h < [expr $NStory]} {incr h 1} {
mass [expr $h*100+3] [expr $TypicalSeismicWeight / 16./9810.] [expr $TypicalSeismicWeight / 16./9810.] 0. 0. 0. 0.;
mass [expr $h*100+4] [expr $TypicalSeismicWeight / 16./9810.] [expr $TypicalSeismicWeight / 16./9810.] 0. 0. 0. 0.;
mass [expr $h*10000+1] [expr $TypicalSeismicWeight*(7./8.)/9810.] [expr $TypicalSeismicWeight*(7./8.)/9810.] 0. 0. 0. 0.;
};

# Vector for definitions of the member local axes
#-------------------------------------------------------------------
set vecxzX 0
set vecxzY 0
set vecxzZ 1

# Type of geometric nonlinearity (1-linear, 2-Pdelta, 3-Corotational)
# --------------------------------------------------------------------
geomTransf Corotational 3 $vecxzX $vecxzY $vecxzZ
set transfTag 3

###################################################################################################
# Define Section Properties and Elements
###################################################################################################

# define elastic beam elements
# --------------------------------------------------------------------
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
if {$additionalFunc == "None"} {
element elasticBeamColumn [expr $h*100+70] [expr $h*100+70] [expr $h*100+71] $Astrut_12_rigid $E_t $G_t $Strut_J_rigid $Strut_Iy_rigid $Strut_Iz_rigid $transfTag;
element elasticBeamColumn [expr $h*100+71] [expr $h*100+71] [expr $h*100+72] $Astrut_12 $E_t $G_t $Strut_J $Strut_Iy $Strut_Iz $transfTag;
element elasticBeamColumn [expr $h*100+72] [expr $h*100+72] [expr $h*100+73] $Astrut_12_rigid $E_t $G_t $Strut_J_rigid $Strut_Iy_rigid $Strut_Iz_rigid $transfTag;
} elseif {$additionalFunc == "PostTension"} {
element elasticBeamColumn [expr $h*100+70] [expr $h*100+70] [expr $h*100+71] $Astrut_12_rigid $E_t $G_t $Strut_J_rigid $Strut_Iy_rigid $Strut_Iz_rigid $transfTag;
element elasticBeamColumn [expr $h*100+71] [expr $h*100+82] [expr $h*100+83] $Astrut_12 $E_t $G_t $Strut_J $Strut_Iy $Strut_Iz $transfTag;
element elasticBeamColumn [expr $h*100+72] [expr $h*100+72] [expr $h*100+73] $Astrut_12_rigid $E_t $G_t $Strut_J_rigid $Strut_Iy_rigid $Strut_Iz_rigid $transfTag;
};
};

#--------------------------------------------------------------------
# define p-delta columns and rigid links
# -------------------------------------------------------------------
uniaxialMaterial Elastic $TrussMatID $E_t;
set K 1e-6;
uniaxialMaterial Elastic 500 $K

for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
element truss [expr $h*100+4] [expr $h*100+4] [expr $h*10000+2] $ALean $TrussMatID;
};
for {set h 1} { $h < [expr $NStory]} {incr h 1} {
element elasticBeamColumn [expr $h+1] [expr $h*10000+2] [expr ($h+1)*10000+1] $ALean $E_t $G_t $JLean $ILean $ILean $transfTag;
};
element elasticBeamColumn 1 1 10001 $ALean $E_t $G_t $JLean $ILean $ILean $transfTag;

for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
element zeroLength [expr ($h+2)*1000] [expr $h*10000+1] [expr $h*10000+2] -mat 500 -dir 6;
};

#--------------------------------------------------------------------
# define brace elements
# -------------------------------------------------------------------
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
element elasticBeamColumn [expr $h*100+30] [expr $h*100+30] [expr $h*100+31] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+50] [expr $h*100+50] [expr $h*100+51] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+45] [expr $h*100+45] [expr $h*100+46] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+65] [expr $h*100+65] [expr $h*100+66] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;

element elasticBeamColumn [expr $h*100+37] [expr $h*100+37] [expr $h*100+38] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+38] [expr $h*100+38] [expr $h*100+39] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+57] [expr $h*100+80] [expr $h*100+38] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
element elasticBeamColumn [expr $h*100+58] [expr $h*100+38] [expr $h*100+81] $A_Rigid $Es $G $J_Rigid $Iy_Rigid $Iz_Rigid $transfTag;
};


# -------------------------------------------------------------------------
# Fiber discretization of the bracing member cross-section
# -------------------------------------------------------------------------

# Brace material
set bb [expr (0.1 * $Fy_B / 0.04) / $Es];
set R0 30.;
set cR1 0.925;
set cR2 0.15;
set a1 0.25;
set a2 20.;
set a3 0.25;
set a4 20.;

set RSLC [expr 0. * $Fy_B];
set RSLT [expr 0. * $Fy_B];

for {set i 21} {$i <= 34} {incr i 1} {
set RSL [expr $RSLT - (($i - 21)/100) * $RSLT * 10];
uniaxialMaterial Steel02 $i $Fy_B $Es $bb $R0 $cR1 $cR2 $a1 $a2 $a3 $a4 $RSL;
};

uniaxialMaterial Steel02 40 $Fy_B $Es $bb $R0 $cR1 $cR2 $a1 $a2 $a3 $a4 $RSLC;

# Brace Section properties of each Floor
#-----------------------------------------------------------------------------------------------------
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
# J of the bracing member (Torsion)
uniaxialMaterial Elastic [expr 120+$h] [expr $G * $J($h)];

set bc_1 [expr $b($h) - $t($h)];
set dc_1 [expr $d($h) - $t($h)];
set rc_1 [expr (($A($h) / $t($h)) - 2. * ($bc_1 + $dc_1)) / (2. * $Pi - 8.)];

set bc_1_RSL [expr $bc_1 * 0.13];
set dc_1_RSL [expr $dc_1 * 0.13];

#Brace Section for Panel 1
section Fiber [expr 10+$h] -GJ 1e12 {

# Top flange
for {set i 21} {$i <= 33} {incr i 1} {
patch quad $i 5 1 [expr -$bc_1 / 2. + $rc_1 + ($i - 21) * $bc_1_RSL / 13.] [expr $dc_1 / 2. - $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 20) * $bc_1_RSL / 13.] [expr $dc_1 / 2. - $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 20) * $bc_1_RSL / 13.] [expr $dc_1 / 2. + $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 21) * $bc_1_RSL / 13.] [expr $dc_1 / 2. + $t($h) / 2.]
};
patch quad 40 10 1 [expr -$bc_1 / 2. + $rc_1 + $bc_1_RSL ] [expr $dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - $bc_1_RSL] [expr $dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - $bc_1_RSL] [expr $dc_1 / 2. + $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + $bc_1_RSL] [expr $dc_1 / 2. + $t($h) / 2.]

for {set i 34} {$i <= 46} {incr i 1} {
patch quad [expr $i - 13] 5 1 [expr $bc_1 / 2. - $rc_1 - ($i - 33) * $bc_1_RSL / 13.] [expr $dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 34) * $bc_1_RSL / 13.] [expr $dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 34) * $bc_1_RSL / 13.] [expr $dc_1 / 2. + $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 33) * $bc_1_RSL / 13.] [expr $dc_1 / 2. + $t($h) / 2.]
};

# Botton flange
for {set i 21} {$i <= 33} {incr i 1} {
patch quad $i 5 1 [expr -$bc_1 / 2. + $rc_1 + ($i - 21) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. - $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 20) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. - $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 20) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. + $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + ($i - 21) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. + $t($h) / 2.]
};
patch quad 40 10 1 [expr -$bc_1 / 2. + $rc_1 + $bc_1_RSL ] [expr -$dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - $bc_1_RSL] [expr -$dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - $bc_1_RSL] [expr -$dc_1 / 2. + $t($h) / 2.] [expr -$bc_1 / 2. + $rc_1 + $bc_1_RSL] [expr -$dc_1 / 2. + $t($h) / 2.]

for {set i 34} {$i <= 46} {incr i 1} {
patch quad [expr $i - 13] 5 1 [expr $bc_1 / 2. - $rc_1 - ($i - 33) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 34) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. - $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 34) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. + $t($h) / 2.] [expr $bc_1 / 2. - $rc_1 - ($i - 33) * $bc_1_RSL / 13.] [expr -$dc_1 / 2. + $t($h) / 2.]
};

# LHS web
for {set i 21} {$i <= 33} {incr i 1} {
patch quad $i 5 1 [expr -$bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 21) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. + $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 21) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. + $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 20) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 20) * $dc_1_RSL / 13.]
};
patch quad 40 10 1 [expr -$bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL ] [expr -$bc_1 / 2. + $t($h)1 / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL] [expr -$bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - $dc_1_RSL] [expr -$bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL]

for {set i 34} {$i <= 46} {incr i 1} {
patch quad [expr $i - 13] 5 1 [expr -$bc_1 / 2. - $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 33) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 33) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 34) * $dc_1_RSL / 13.] [expr -$bc_1 / 2. - $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 34) * $dc_1_RSL / 13.]
};

# RHS web
for {set i 21} {$i <= 33} {incr i 1} {
patch quad $i 5 1 [expr $bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 21) * $dc_1_RSL / 13.] [expr $bc_1 / 2. + $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 21) * $dc_1_RSL / 13.] [expr $bc_1 / 2. + $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 20) * $dc_1_RSL / 13.] [expr $bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + ($i - 20) * $dc_1_RSL / 13.]
};
patch quad 40 10 1 [expr $bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL ] [expr $bc_1 / 2. + $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL] [expr $bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - $dc_1_RSL] [expr $bc_1 / 2. - $t($h) / 2.] [expr -$dc_1 / 2. + $rc_1 + $dc_1_RSL]

for {set i 34} {$i <= 46} {incr i 1} {
patch quad [expr $i - 13] 5 1 [expr $bc_1 / 2. - $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 33) * $dc_1_RSL / 13.] [expr $bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 33) * $dc_1_RSL / 13.] [expr $bc_1 / 2. + $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 34) * $dc_1_RSL / 13.] [expr $bc_1 / 2. - $t($h) / 2.] [expr $dc_1 / 2. - $rc_1 - ($i - 34) * $dc_1_RSL / 13.]
};

# Top LHS corner
patch circ 21 4 5 [expr -$bc_1 / 2. + $rc_1] [expr $dc_1 / 2. - $rc_1] [expr $rc_1 - $t($h) / 2.] [expr $rc_1 + $t($h) / 2.] 90.0 180.0
# Lower LHS corner
patch circ 21 4 5 [expr -$bc_1 / 2. + $rc_1] [expr -$dc_1 / 2. + $rc_1] [expr $rc_1 - $t($h) / 2.] [expr $rc_1 + $t($h) / 2.] 180.0 270.0
# Lower RHS corner
patch circ 21 4 5 [expr $bc_1 / 2. - $rc_1] [expr -$dc_1 / 2. + $rc_1] [expr $rc_1 - $t($h)1 / 2.] [expr $rc_1 + $t($h) / 2.] 270.0 360.0
# Top RHS corner
patch circ 21 4 5 [expr $bc_1 / 2. - $rc_1] [expr $dc_1 / 2. - $rc_1] [expr $rc_1 - $t($h) / 2.] [expr $rc_1 + $t($h) / 2.] 0.0 90.0
};

# Adding torsional stiffness to the nonlinear beam-column element
section Aggregator [expr 100+$h] [expr 120+$h] T -section [expr 10+$h];
};

# Brace Elements
# ---------------------------------------
set tol 1e-6
set maxIters 100

for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {

for {set i [expr $h*100+32]} {$i < [expr ($NELEM/2) + ($h*100+32)]} {incr i 1} {
element forceBeamColumn $i $i [expr $i + 1] $ptoint [expr 100+$h] $transfTag -iter $maxIters $tol;
};

for {set i [expr $h*100+39]} {$i < [expr ($NELEM/2) + ($h*100+39)]} {incr i 1} {
element forceBeamColumn $i $i [expr $i + 1] $ptoint [expr 100+$h] $transfTag -iter $maxIters $tol;
};

for {set i [expr $h*100+52]} {$i < [expr ($NELEM/2) + ($h*100+52)]} {incr i 1} {
element forceBeamColumn $i $i [expr $i + 1] $ptoint [expr 100+$h] $transfTag -iter $maxIters $tol;
};

for {set i [expr $h*100+59]} {$i < [expr ($NELEM/2) + ($h*100+59)]} {incr i 1} {
element forceBeamColumn $i $i [expr $i + 1] $ptoint [expr 100+$h] $transfTag -iter $maxIters $tol;
};
};

# Column middle elements
# ---------------------------------------
# Rigid end element on columns
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
element elasticBeamColumn [expr $h*100+9] [expr $h*100+1] [expr $h*100+10] $A_column_rigid $E_t $G_t $J_column_rigid $Iy_column_rigid $Iz_column_rigid $transfTag;
element elasticBeamColumn [expr $h*100+16] [expr $h*100+16] [expr $h*100+3] $A_column_rigid $E_t $G_t $J_column_rigid $Iy_column_rigid $Iz_column_rigid $transfTag;
element elasticBeamColumn [expr $h*100+19] [expr $h*100+2] [expr $h*100+20] $A_column_rigid $E_t $G_t $J_column_rigid $Iy_column_rigid $Iz_column_rigid $transfTag;
element elasticBeamColumn [expr $h*100+26] [expr $h*100+26] [expr $h*100+4] $A_column_rigid $E_t $G_t $J_column_rigid $Iy_column_rigid $Iz_column_rigid $transfTag;

for {set i [expr $h*100+10]} {$i < [expr $NELEMC + [expr $h*100+10]]} {incr i 1} {
element elasticBeamColumn $i $i [expr $i + 1] $A_column $E_t $G_t $J_column $Iy_column $Iz_column $transfTag;
};
for {set i [expr $h*100+20]} {$i < [expr $NELEMC + [expr $h*100+20]]} {incr i 1} {
element elasticBeamColumn $i $i [expr $i + 1] $A_column $E_t $G_t $J_column $Iy_column $Iz_column $transfTag;
};

};

# Brace end CONNECTIONS
# -----------------------------
# C of Brace End Springs for Torsion - Local Axis 4 (x)
uniaxialMaterial Elastic 200 $Gusset_C_torsion_1;

# C and M of Brace End Springs for out-of-plane Buckling - Local Axis 5 (y)
uniaxialMaterial Steel02 201 $Gusset_Mp_bending_1 $Gusset_C_bending_1 0.01 20 0.925 0.15 0.0005 0.01 0.0005 0.01;
uniaxialMaterial Steel02 202 $Gusset_Mp_bending_2 $Gusset_C_bending_2 0.01 20 0.925 0.15 0.0005 0.01 0.0005 0.01;

# Stiff Spring
uniaxialMaterial Elastic 1305 900000000.;

# Flexible Spring (For Pin Connection)
uniaxialMaterial Elastic 1306 10.;

# Timber Connection Zone (For Partial Conection)
uniaxialMaterial Elastic 1307 $K_panel;

# Post-Tension Bi-Linear Spring
set K1_post 7500000.0;
set K2_post 1600000.0;
set K3_post 450000.0;

set M1_post 7000.0; # kN-mm
set M2_post 11000.0;
set M3_post 20000.0;

set u1_post [expr $M1_post/$K1_post];
set u2_post [expr $u1_post+($M2_post-$M1_post)/($K2_post)];
set u3_post [expr $u2_post+($M3_post-$M2_post)/($K3_post)];

#uniaxialMaterial ElasticBilin $matTag $EP1 $EP2 $epsP2 <$EN1 $EN2 $epsN2>
uniaxialMaterial ElasticBilin 1308 300000000. 40000. 0.00042;

# Rotational Spring for rigid Connection
uniaxialMaterial Elastic 1309 999999000.;

# Local axes of the brace springs
for {set h 1} { $h < [expr $NStory+1]} {incr h 1} {
set x1_1_L [lindex $cosTeta $h];
set x2_1_L [lindex $sinTeta $h];
set x3_1_L 0.;
set yp1_1_L [expr -[lindex $sinTeta $h]];
set yp2_1_L [lindex $cosTeta $h];
set yp3_1_L 0.;

set x1_1_R [expr -[lindex $cosTeta $h]];
set x2_1_R [lindex $sinTeta $h];
set x3_1_R 0.;
set yp1_1_R [lindex $sinTeta $h];
set yp2_1_R [lindex $cosTeta $h];
set yp3_1_R 0.;

# Rotational Springs at Brace Ends
element zeroLength [expr $h*100+31] [expr $h*100+31] [expr $h*100+32] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_L $x2_1_L $x3_1_L $yp1_1_L $yp2_1_L $yp3_1_L;
element zeroLength [expr $h*100+44] [expr $h*100+44] [expr $h*100+45] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_L $x2_1_L $x3_1_L $yp1_1_L $yp2_1_L $yp3_1_L;

element zeroLength [expr $h*100+51] [expr $h*100+51] [expr $h*100+52] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_R $x2_1_R $x3_1_R $yp1_1_R $yp2_1_R $yp3_1_R;
element zeroLength [expr $h*100+64] [expr $h*100+64] [expr $h*100+65] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_R $x2_1_R $x3_1_R $yp1_1_R $yp2_1_R $yp3_1_R;

# Rotational Springs at the middle of the brace (discontinuous brace)
element zeroLength [expr $h*100+80] [expr $h*100+57] [expr $h*100+80] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_R $x2_1_R $x3_1_R $yp1_1_R $yp2_1_R $yp3_1_R
element zeroLength [expr $h*100+81] [expr $h*100+81] [expr $h*100+59] -mat 1305 1305 1305 200 201 202 -dir 1 2 3 4 5 6 orient $x1_1_R $x2_1_R $x3_1_R $yp1_1_R $yp2_1_R $yp3_1_R

# Bi-linear Rotational Spring at the end of beams, simulating the post-tensioning behavior
if {$additionalFunc == "PostTension"} {
element zeroLength [expr $h*100+82] [expr $h*100+71] [expr $h*100+82] -mat 1308 -dir 6;
element zeroLength [expr $h*100+83] [expr $h*100+83] [expr $h*100+72] -mat 1308 -dir 6;
};

# Rotational Spring for the Timber connection zone
if {$ConnectionType == "Partial"} {
element zeroLength [expr $h*100+69] [expr $h*100+3] [expr $h*100+70] -mat 1305 1305 1305 1305 1305 1307 -dir 1 2 3 4 5 6;
element zeroLength [expr $h*100+73] [expr $h*100+73] [expr $h*100+4] -mat 1305 1305 1305 1305 1305 1307 -dir 1 2 3 4 5 6;

} elseif {$ConnectionType == "Pinned"} {
element zeroLength [expr $h*100+69] [expr $h*100+3] [expr $h*100+70] -mat 1305 1305 1305 1305 1305 1306 -dir 1 2 3 4 5 6;
element zeroLength [expr $h*100+73] [expr $h*100+73] [expr $h*100+4] -mat 1305 1305 1305 1305 1305 1306 -dir 1 2 3 4 5 6;
equalDOF [expr $h*100+3] [expr $h*100+70] 1 2 3 4 5;
equalDOF [expr $h*100+4] [expr $h*100+73] 1 2 3 4 5;

} elseif {$ConnectionType == "Rigid"} {
element zeroLength [expr $h*100+69] [expr $h*100+3] [expr $h*100+70] -mat 1309 -dir 6;
element zeroLength [expr $h*100+73] [expr $h*100+73] [expr $h*100+4] -mat 1309 -dir 6;
equalDOF [expr $h*100+3] [expr $h*100+70] 1 2 3 4 5 6;
equalDOF [expr $h*100+4] [expr $h*100+73] 1 2 3 4 5 6;

};
};


############################################################################
# Eigenvalue Analysis #
############################################################################
set pi [expr 2.0*asin(1.0)]; # Definition of pi
set nEigenI 1; # mode i = 1
set nEigenJ 2; # mode j = 2
set lambdaN [eigen [expr $nEigenJ]]; # eigenvalue analysis for nEigenJ modes
set lambdaI [lindex $lambdaN [expr 0]]; # eigenvalue mode i = 1
set lambdaJ [lindex $lambdaN [expr $nEigenJ-1]]; # eigenvalue mode j = 2
set w1 [expr pow($lambdaI,0.5)]; # w1 (1st mode circular frequency)
set w2 [expr pow($lambdaJ,0.5)]; # w2 (2nd mode circular frequency)
set T1 [expr 2.0*$pi/$w1]; # 1st mode period of the structure
set T2 [expr 2.0*$pi/$w2]; # 2nd mode period of the structure
puts "T1 = $T1 s"; # display the first mode period in the command window
puts "T2 = $T2 s"; # display the second mode period in the command window

selimgunay
Posts: 879
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: Problem related to Eigen Analysis

Post by selimgunay » Tue Feb 09, 2021 2:59 pm

It looks like you have a leaning column, You can check if the large period is dues to something wrong that you may be defining with that. So one quick check could be to remove the leaning column and see what happens

Post Reply