Change of convergence tolerance

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

Moderators: silvia, selimgunay, Moderators

Post Reply
buddhasarah
Posts: 93
Joined: Thu Feb 12, 2009 8:31 pm
Location: The University of Tokyo

Change of convergence tolerance

Post by buddhasarah »

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!
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Post by vesna »

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
buddhasarah
Posts: 93
Joined: Thu Feb 12, 2009 8:31 pm
Location: The University of Tokyo

Post by buddhasarah »

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!
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Post by vesna »

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]
}
mohsenkh
Posts: 27
Joined: Wed Apr 21, 2010 7:40 am

Post by mohsenkh »

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.
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

personally, if i was having convergence problems, i'd check my model!
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
Post Reply