
#--------------------#
   source S20N3.tcl
#--------------------#

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

set scale 45
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  { 202045 203045 204045 205045 206045 207045 208045 209045 210045 211045 212045 213045 214045 215045 216045 217045 218045 219045 220045 221045}

# Define a list of Column Sprigs
    set ColumnSprigsListAll { {	5001011	5001021	5001031	5001041	}
                              {	5001012	5001022	5001032	5001042	}
                              {	5002011	5002021	5002031	5002041	}
                              {	5002012	5002022	5002032	5002042	}
                              {	5003011	5003021	5003031	5003041	}
                              {	5003012	5003022	5003032	5003042	}
                              {	5004011	5004021	5004031	5004041	}
                              {	5004012	5004022	5004032	5004042	}
                              {	5005011	5005021	5005031	5005041	}
                              {	5005012	5005022	5005032	5005042	}
                              {	5006011	5006021	5006031	5006041	}
                              {	5006012	5006022	5006032	5006042	}
                              {	5007011	5007021	5007031	5007041	}
                              {	5007012	5007022	5007032	5007042	}
                              {	5008011	5008021	5008031	5008041	}
                              {	5008012	5008022	5008032	5008042	}
                              {	5009011	5009021	5009031	5009041	}
                              {	5009012	5009022	5009032	5009042	}
                              {	5010011	5010021	5010031	5010041	}
                              {	5010012	5010022	5010032	5010042	}
                              {	5011011	5011021	5011031	5011041	}
                              {	5011012	5011022	5011032	5011042	}
                              {	5012011	5012021	5012031	5012041	}
                              {	5012012	5012022	5012032	5012042	}
                              {	5013011	5013021	5013031	5013041	}
                              {	5013012	5013022	5013032	5013042	}
                              {	5014011	5014021	5014031	5014041	}
                              {	5014012	5014022	5014032	5014042	}
                              {	5015011	5015021	5015031	5015041	}
                              {	5015012	5015022	5015032	5015042	}
                              {	5016011	5016021	5016031	5016041	}
                              {	5016012	5016022	5016032	5016042	}
                              {	5017011	5017021	5017031	5017041	}
                              {	5017012	5017022	5017032	5017042	}
                              {	5018011	5018021	5018031	5018041	}
                              {	5018012	5018022	5018032	5018042	}
                              {	5019011	5019021	5019031	5019041	}
                              {	5019012	5019022	5019032	5019042	}
                              {	5020011	5020021	5020031	5020041	}
                              {	5020012	5020022	5020032	5020042	}
                                                                                      }

# Define a list of Beam Sprigs
    set BeamSprigsListAll   { {	4002011	4002012	4002021	4002022	4002031	4002032	}
                              {	4003011	4003012	4003021	4003022	4003031	4003032	}
                              {	4004011	4004012	4004021	4004022	4004031	4004032	}
                              {	4005011	4005012	4005021	4005022	4005031	4005032	}
                              {	4006011	4006012	4006021	4006022	4006031	4006032	}
                              {	4007011	4007012	4007021	4007022	4007031	4007032	}
                              {	4008011	4008012	4008021	4008022	4008031	4008032	}
                              {	4009011	4009012	4009021	4009022	4009031	4009032	}
                              {	4010011	4010012	4010021	4010022	4010031	4010032	}
                              {	4011011	4011012	4011021	4011022	4011031	4011032	}
                              {	4012011	4012012	4012021	4012022	4012031	4012032	}
                              {	4013011	4013012	4013021	4013022	4013031	4013032	}
                              {	4014011	4014012	4014021	4014022	4014031	4014032	}
                              {	4015011	4015012	4015021	4015022	4015031	4015032	}
                              {	4016011	4016012	4016021	4016022	4016031	4016032	}
                              {	4017011	4017012	4017021	4017022	4017031	4017032	}
                              {	4018011	4018012	4018021	4018022	4018031	4018032	}
                              {	4019011	4019012	4019021	4019022	4019031	4019032	}
                              {	4020011	4020012	4020021	4020022	4020031	4020032	}
                              {	4021011	4021012	4021021	4021022	4021031	4021032	}
                                                                                                              }


 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 202045 203045 204045 205045 206045 207045 208045 209045 210045 211045 212045 213045 214045 215045 216045 217045 218045 219045 220045 221045 -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.0005	0	0
#   load 	203015	0.0017	0	0
#   load 	204015	0.0036	0	0
#   load 	205015	0.0062	0	0
#   load 	206015	0.0095	0	0
#   load 	207015	0.0134	0	0
#   load 	208015	0.0181	0	0
#   load 	209015	0.0234	0	0
#   load 	210015	0.0294	0	0
#   load 	211015	0.0361	0	0
#   load 	212015	0.0435	0	0
#   load 	213015	0.0516	0	0
#   load 	214015	0.0604	0	0
#   load 	215015	0.0699	0	0
#   load 	216015	0.0800	0	0
#   load 	217015	0.0909	0	0
#   load 	218015	0.1024	0	0
#   load 	219015	0.1147	0	0
#   load 	220015	0.1276	0	0
#   load 	221015	0.1170	0	0

#Loads Based on Mode Shape 1
   #         node         FX        FY    MZ
   load 	202015	0.004041891	0	0
   load 	203015	0.008251169	0	0
   load 	204015	0.012605358	0	0
   load 	205015	0.017422644	0	0
   load 	206015	0.022425391	0	0
   load 	207015	0.027464313	0	0
   load 	208015	0.032862636	0	0
   load 	209015	0.038284065	0	0
   load 	210015	0.043609479	0	0
   load 	211015	0.049108028	0	0
   load 	212015	0.054517687	0	0
   load 	213015	0.059662844	0	0
   load 	214015	0.064505713	0	0
   load 	215015	0.069377633	0	0
   load 	216015	0.073922488	0	0
   load 	217015	0.077975504	0	0
   load 	218015	0.08150695	0	0
   load 	219015	0.084827165	0	0
   load 	220015	0.087565723	0	0
   load 	221015	0.090063318	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.001
set ControlNode 221045

set 	Nsteps01	1720
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;
};
# -----------------------------------------------------------------------------------------------------
