Change of convergence tolerance
Moderators: silvia, selimgunay, Moderators
-
- Posts: 93
- Joined: Thu Feb 12, 2009 8:31 pm
- Location: The University of Tokyo
Change of convergence tolerance
Hello, I'm trying to perform nonlinear time history analysis of a building.
The building is slightly complex and it fails to converge when a certain brittle member yields. So my solution is to increase the tolerance at the instant when the brittle member yields, but I only know how to define the tolerance initially.
Can anybody tell me how I can change the tolerance for just a certain time steps at a certain instant and change the tolerance back after that?
Thank you very much in advance!
The building is slightly complex and it fails to converge when a certain brittle member yields. So my solution is to increase the tolerance at the instant when the brittle member yields, but I only know how to define the tolerance initially.
Can anybody tell me how I can change the tolerance for just a certain time steps at a certain instant and change the tolerance back after that?
Thank you very much in advance!
Most of the time tolerance is not the only parameter that is to be changed for the analysis to work. I would suggest you to use Silvia's code for changing algorithm, test, number of iteration...
set Nsteps [expr int($TmaxAnalysis/$DtAnalysis)];
set ok [analyze $Nsteps $DtAnalysis]; # actually perform analysis; returns ok=0 if analysis was successful
if {$ok != 0} { ; # if analysis was not successful.
# change some analysis parameters to achieve convergence
# performance is slower inside this loop
# Time-controlled analysis
set ok 0;
set controlTime [getTime];
while {$controlTime < $TmaxAnalysis && $ok == 0} {
set ok [analyze 1 $DtAnalysis]
set controlTime [getTime]
set ok [analyze 1 $DtAnalysis]
if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
test NormDispIncr $Tol 1000 0
algorithm Newton -initial
set ok [analyze 1 $DtAnalysis]
test $TestType $Tol $maxNumIter 0
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying Broyden .."
algorithm Broyden 8
set ok [analyze 1 $DtAnalysis]
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch .8
set ok [analyze 1 $DtAnalysis]
algorithm $algorithmType
}
}
}; # end if ok !0
I copied this from:
Ex2b.Canti2D.InelasticSection.EQ.tcl at
http://opensees.berkeley.edu/wiki/index ... ic_Section
set Nsteps [expr int($TmaxAnalysis/$DtAnalysis)];
set ok [analyze $Nsteps $DtAnalysis]; # actually perform analysis; returns ok=0 if analysis was successful
if {$ok != 0} { ; # if analysis was not successful.
# change some analysis parameters to achieve convergence
# performance is slower inside this loop
# Time-controlled analysis
set ok 0;
set controlTime [getTime];
while {$controlTime < $TmaxAnalysis && $ok == 0} {
set ok [analyze 1 $DtAnalysis]
set controlTime [getTime]
set ok [analyze 1 $DtAnalysis]
if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
test NormDispIncr $Tol 1000 0
algorithm Newton -initial
set ok [analyze 1 $DtAnalysis]
test $TestType $Tol $maxNumIter 0
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying Broyden .."
algorithm Broyden 8
set ok [analyze 1 $DtAnalysis]
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch .8
set ok [analyze 1 $DtAnalysis]
algorithm $algorithmType
}
}
}; # end if ok !0
I copied this from:
Ex2b.Canti2D.InelasticSection.EQ.tcl at
http://opensees.berkeley.edu/wiki/index ... ic_Section
-
- Posts: 93
- Joined: Thu Feb 12, 2009 8:31 pm
- Location: The University of Tokyo
Thank you for your help vesna!
Changing algorithm indeed deals with convergence problem sometimes but there are some analysis in which no matter how I change the algorithm it doesn't work, so I have no choice but to change the tolerence for a little bit.
Can you tell me how I can change only the tolerence? I tried to modified the code you posted but it doesn't work, I don't know Tcl language well (ㅜㅜ)
Thank you in advance!
Changing algorithm indeed deals with convergence problem sometimes but there are some analysis in which no matter how I change the algorithm it doesn't work, so I have no choice but to change the tolerence for a little bit.
Can you tell me how I can change only the tolerence? I tried to modified the code you posted but it doesn't work, I don't know Tcl language well (ㅜㅜ)
Thank you in advance!
Here is another example with the tolerance only:
set tFinal 15.0;
set Tol1 1.0e-6
set Tol2 1.0e-2
constraints Transformation
numberer RCM
system BandGeneral
test NormDispIncr $Tol1 6 2
algorithm Newton
integrator Newmark 0.5 0.25
analysis Transient
set ok 0
set currentTime 0.0
while {$ok == 0 && $currentTime < $tFinal} {
set ok [analyze 1 0.01]
if {$ok != 0} {
test NormDispIncr $Tol2 6 2
set ok [analyze 1 0.01]
test NormDispIncr $Tol1 6 2
} set currentTime [getTime]
}
set tFinal 15.0;
set Tol1 1.0e-6
set Tol2 1.0e-2
constraints Transformation
numberer RCM
system BandGeneral
test NormDispIncr $Tol1 6 2
algorithm Newton
integrator Newmark 0.5 0.25
analysis Transient
set ok 0
set currentTime 0.0
while {$ok == 0 && $currentTime < $tFinal} {
set ok [analyze 1 0.01]
if {$ok != 0} {
test NormDispIncr $Tol2 6 2
set ok [analyze 1 0.01]
test NormDispIncr $Tol1 6 2
} set currentTime [getTime]
}
Dear Vesna
I used VariableTransient comment for analysis. The analysis sometimes is failed. I would change convergence tolerance. Do I use the following comments?
“
Here is another example with the tolerance only:
set tFinal 15.0;
set Tol1 1.0e-6
set Tol2 1.0e-2
.
.
.
set ok 0
set currentTime 0.0
while {$ok == 0 && $currentTime < $tFinal} {
set ok [analyze 1 0.01]
if {$ok != 0} {
test NormDispIncr $Tol2 6 2
set ok [analyze 1 0.01]
test NormDispIncr $Tol1 6 2
} set currentTime [getTime]
}
“
Thanks.
I used VariableTransient comment for analysis. The analysis sometimes is failed. I would change convergence tolerance. Do I use the following comments?
“
Here is another example with the tolerance only:
set tFinal 15.0;
set Tol1 1.0e-6
set Tol2 1.0e-2
.
.
.
set ok 0
set currentTime 0.0
while {$ok == 0 && $currentTime < $tFinal} {
set ok [analyze 1 0.01]
if {$ok != 0} {
test NormDispIncr $Tol2 6 2
set ok [analyze 1 0.01]
test NormDispIncr $Tol1 6 2
} set currentTime [getTime]
}
“
Thanks.