
#--------------------#
   source S06_SF.tcl
#--------------------#

#################
# DISPLAY MODEL #
#################

set scale 22
recorder display DispShape 450 0 500 400 -wipe
vup 0 1 0 # dirn defining up direction of view plane
vpn 0 0 1 # direction of outward normal to view plane
prp 2 1.50 10 # eye location in local coord sys defined by viewing system
display 1 -5 1
viewWindow -$scale $scale -$scale  $scale ;#scale view for Structure


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

# MODAL ANALYSIS #
##################

eigen 4;
for {set i 0} {$i < 4} {incr i} {
	puts "[expr 2*3.1416/(pow([lindex [eigen 4] $i],0.5))]";
}

##################
# GRAVITY SOLVER #
##################


constraints Plain;
numberer RCM;
system BandGeneral;
test NormDispIncr 1.e-8 8 2;
algorithm Newton; 
integrator LoadControl 0.1;
analysis Static;
analyze 10;
loadConst -time 0.0;


####################
# Define Recorders #
####################

file mkdir Data;
file mkdir Data/Nodes;
file mkdir Data/Springs;


# Define a list of Nodes
    set NodeList  { 202025 203025 204025 205025 206025 207025}

# Define a list of Column Sprigs
    set ColumnSprigsListAll { {	5001011	5001021	}
                              {	5001012	5001022	}
                              {	5002011	5002021	}
                              {	5002012	5002022	}
                              {	5003011	5003021	}
                              {	5003012	5003022	}
                              {	5004011	5004021	}
                              {	5004012	5004022	}
                              {	5005011	5005021	}
                              {	5005012	5005022	}
                              {	5006011	5006021	}
                              {	5006012	5006022	}
                                                              }

# Define a list of Beam Sprigs
    set BeamSprigsListAll   { {	4002011	4002012	}
                              {	4003011	4003012	}
                              {	4004011	4004012	}
                              {	4005011	4005012	}
                              {	4006011	4006012	}
                              {	4007011	4007012	}
                                                              }


 foreach NodeListNUM $NodeList {
   recorder Node     -file Data/Nodes/$NodeListNUM._NodeDispl.out -time -node $NodeListNUM -dof 1 2 3 disp;
  }

 foreach ColumnSprigsList $ColumnSprigsListAll {
  foreach ColumnSprigsNUM $ColumnSprigsList {
   recorder Element  -file Data/Springs/$ColumnSprigsNUM._MomRot.out -ele $ColumnSprigsNUM defoANDforce;
  }
 }

 foreach BeamSprigsList $BeamSprigsListAll {
  foreach BeamSprigsNUM $BeamSprigsList {
   recorder Element  -file Data/Springs/$BeamSprigsNUM._MomRot.out -ele $BeamSprigsNUM defoANDforce;
  }
 }


## To Get The Mode Shape: Uncomment The Code Below And Set Nsteps01=1

#  file mkdir Data/ModeShapes;
#  set numModes 4
#  for { set MN 1 } { $MN <= $numModes } { incr MN } {
#    recorder Node -file Data/ModeShapes/ModeShape_$MN.out -time -node 202025 203025 204025 205025 206025 207025 -dof 1 "eigen $MN"
#       }


###################
# Pushover Loads #
###################

# 2 Types of Lateral Loading Are Defined; Comment and Uncomment Which You Want To Use)

pattern Plain 2 Linear {

#Loads Based on Wihi (ASCE7-16 Eq 12.8-12)
   #         node         FX        FY    MZ
#   load 	202015	0.0251	0	0
#   load 	203015	0.0686	0	0
#   load 	204015	0.1234	0	0
#   load 	205015	0.1872	0	0
#   load 	206015	0.2587	0	0
#   load 	207015	0.3369	0	0

#Loads Based on Mode Shape 1
   #         node         FX        FY    MZ
   load 	202015	0.04044799	0	0
   load 	203015	0.092497305	0	0
   load 	204015	0.149219516	0	0
   load 	205015	0.198246763	0	0
   load 	206015	0.245508341	0	0
   load 	207015	0.274080086	0	0

 }


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

# Pushover Solver (Cyclic & Monotonic) #
########################################

## For Monotonic Pushover Set Nsteps01 and Set The Other Nsteps=0
## For Cyclic Pushover Set As Many Nsteps As You Want; Odd Nsteps Are For +x Displacement & Even Nsteps Are For -x Displacement

set PushInc 0.0005
set ControlNode 207025

set 	Nsteps01	3264
set 	Nsteps02	0
set 	Nsteps03	0
set 	Nsteps04	0
set 	Nsteps05	0
set 	Nsteps06	0
set 	Nsteps07	0
set 	Nsteps08	0
set 	Nsteps09	0
set 	Nsteps10	0
set 	Nsteps11	0
set 	Nsteps12	0
set 	Nsteps13	0
set 	Nsteps14	0
set 	Nsteps15	0
set 	Nsteps16	0
set 	Nsteps17	0
set 	Nsteps18	0
set 	Nsteps19	0
set 	Nsteps20	0
set 	Nsteps21	0
set 	Nsteps22	0
set 	Nsteps23	0
set 	Nsteps24	0
set 	Nsteps25	0



constraints Transformation;		
numberer RCM;
system BandGeneral;     
test NormDispIncr 1.e-8 200 2;
set algorithmTypeStatic KrylovNewton;
algorithm $algorithmTypeStatic; 
integrator DisplacementControl  $ControlNode  1 $PushInc;
analysis Static;

set Nsteps $Nsteps01;

# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
### -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps02;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps03;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps04;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps05;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps06;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps07;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps08;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps09;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps10;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps11;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps12;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps13;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps14;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps15;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps16;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps17;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps18;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps19;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps20;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps21;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps22;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps23;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
integrator DisplacementControl  $ControlNode  1 -$PushInc;
set Nsteps $Nsteps24;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------

integrator DisplacementControl  $ControlNode  1 $PushInc;
set Nsteps $Nsteps25;
# -----------------------------------------------------------------------------------
for {set step 1} {$step <= $Nsteps} {incr step} {
	set ok [analyze 1];
# ------------------------------------if convergence failure-------------------------
	if {$ok != 0} {
		puts "\nTrying Newton with Initial Tangent...\n"
		test NormDispIncr 1.e-8 2000 2;
		algorithm Newton -initial;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying Broyden...\n"
		algorithm Broyden 8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying NewtonWithLineSearch...\n"
		algorithm NewtonLineSearch 0.8;
		set ok [analyze 1];
	}
	if {$ok != 0} {
		puts "\nTrying ModifiedNewton...\n"
		algorithm ModifiedNewton;
		set ok [analyze 1];
	}
	test NormDispIncr 1.e-8 200 2;
	algorithm $algorithmTypeStatic;
};
# -----------------------------------------------------------------------------------------------------
