Failing to converge

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

Moderators: silvia, selimgunay, Moderators

Post Reply
yingying
Posts: 12
Joined: Sun Oct 15, 2017 1:01 am
Location: university of Bath

Failing to converge

Post by yingying »

I am running two earthquakes on a model simulating an earth dam. The first earthquake is shorter and has smaller accelerations, this runs fine. However when I run the second earthquake, it fails to converge:

WARNING: CTestNormDispIncr::test() - failed to converge
after: 30 iterations current Norm: 6.7019e-005 (max: 5e-005, Norm deltaR: 2899.44)
NewtnRaphson::solveCurrentStep() -the ConvergenceTest object failed in test()
DirectIntegrationAnalysis::analyze() - the Algorithm failed at time 10.92
OpenSees > analyze failed, returned: -3 error flag

When I increase the NormDispIncr iterations from 30 to 100, the model fails to converge at a later time (40secs rather than 10.92secs, the total length of the earthquake is 60secs). When I change the iterations to 200, it once again fails to converge at 40secs.

WARNING: CTestNormDispIncr::test() - failed to converge
after: 200 iterations current Norm: 0.000124496 (max: 5e-005, Norm deltaR: 4679.25)
NewtnRaphson::solveCurrentStep() -the ConvergenceTest object failed in test()
DirectIntegrationAnalysis::analyze() - the Algorithm failed at time 40.02
OpenSees > analyze failed, returned: -3 error flag
-3
OpenSees >

What could be the possible causes of this and how can i fix this?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Failing to converge

Post by fmk »

NewtonRaphson does not always converge .. try something other than just increaing the number of iterations!

http://opensees.berkeley.edu/wiki/index ... ple3.3.tcl
selimgunay
Posts: 916
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: Failing to converge

Post by selimgunay »

You can use the adaptive solution strategy below.

set Tol 1.0e-8;
set maxNumIter 100;
set printFlag 0;
set NewmarkGamma 0.5;
set NewmarkBeta 0.25;
set TestType EnergyIncr;

set algorithmType NewtonLineSearch;
for {set ik 1} {$ik <= $Nsteps} {incr ik 1} {
puts "$ik"
# puts "$ik"
set ok [analyze 1 $dtForAnalysis]
# Convergence
if {$ok != 0} {
puts "Trying Bisection ...";
algorithm NewtonLineSearch <-type Bisection>;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying Secant ...";
algorithm NewtonLineSearch <-type Secant>;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying RegulaFalsi ...";
algorithm NewtonLineSearch <-type RegulaFalsi>;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying KrylovNewton ...";
algorithm KrylovNewton;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying Newton ...";
algorithm Newton;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying BFGS ...";
algorithm BFGS;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying Broyden ...";
algorithm Broyden;
set ok [analyze 1 $dtForAnalysis]
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying HHT 0.9 ...";
integrator HHT 0.9;
set ok [analyze 1 $dtForAnalysis]
# integrator TRBDF2;
integrator Newmark $NewmarkGamma $NewmarkBeta;
};
if {$ok != 0} {
puts "Trying OS ...";
integrator AlphaOS 1.00;
algorithm Linear;
set ok [analyze 1 $dtForAnalysis]
# integrator TRBDF2;
integrator Newmark $NewmarkGamma $NewmarkBeta;
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying OSG ...";
integrator AlphaOSGeneralized 1.00;
algorithm Linear;
set ok [analyze 1 $dtForAnalysis]
# integrator TRBDF2;
integrator Newmark $NewmarkGamma $NewmarkBeta;
algorithm $algorithmType;
};
if {$ok != 0} {
puts "Trying more iterations...";
test $TestType $Tol 1000 $printFlag;
set ok [analyze 1 $dtForAnalysis]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-7 ...";
test $TestType 1.0e-7 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-6 ...";
test $TestType 1.0e-6 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-5 ...";
test $TestType 1.0e-5 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/2.0]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/4.0]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/8.0]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/16.0]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/32.0]
test $TestType $Tol $maxNumIter $printFlag;
};
if {$ok != 0} {
puts "Trying tolerance 1.0e-3 ...";
test $TestType 1.0e-3 $maxNumIter 0;
set ok [analyze 1 $dtForAnalysis/64.0]
test $TestType $Tol $maxNumIter $printFlag;
};





if {$ok != 0} {
set Nstepsmax [expr $ik-1]
break;
}

}

if {[expr $ik-1] == $Nsteps} {

set AnalysisA [expr 1] } else {

set AnalysisA [expr 0] };

puts "Analysis completion=$AnalysisA"

set fileid10 [open "ConvergenceIndicator.txt" a];
puts $fileid10 "$AnalysisA"
close $fileid10
sasakiharuka
Posts: 12
Joined: Fri Jan 19, 2018 12:33 am

Re: Failing to converge

Post by sasakiharuka »

I try the code in tcl. There are some variables that did not initialize. And I have the same convergence problem. Could you please post the complete code for the adaptive solution strategy? I'm very grateful for your kind help.
Last edited by sasakiharuka on Sun Jan 13, 2019 11:18 pm, edited 1 time in total.
Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Re: Failing to converge

Post by Prafullamalla »

just copy paste the @seimgunay code in your analysis part and it should work. that code can be used in all the analysis
Prafulla Malla, Nepal
Praf_malla@hotmail.com
Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Re: Failing to converge

Post by Prafullamalla »

Regarding to convergence, I want to ask a question. I saw an example file in which time step dt was decreased. Is it ok to reduce the time step in earthquake analysis? and if the time step is reduced, does it take the interpolated acceleration for corresponding time step?
Prafulla Malla, Nepal
Praf_malla@hotmail.com
sasakiharuka
Posts: 12
Joined: Fri Jan 19, 2018 12:33 am

Re: Failing to converge

Post by sasakiharuka »

The @seimgunay code for the adaptive solution strategy has some variables that did not initialize. "dtForAnalysis " is time-step increment. But what's the "Nsteps " mean? Does it mean the number of analysis steps to perform?
Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Re: Failing to converge

Post by Prafullamalla »

Nsteps is total number of steps to analyze. So, Nsteps=no of earthquake data. For example, if you have 1600 acceleration vs time earthquake data, then you need to analyze 1600 times. So, Nsteps=1600
Prafulla Malla, Nepal
Praf_malla@hotmail.com
selimgunay
Posts: 916
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: Failing to converge

Post by selimgunay »

Yes the interpolation is done automatically.
sasakiharuka
Posts: 12
Joined: Fri Jan 19, 2018 12:33 am

Re: Failing to converge

Post by sasakiharuka »

@ Prafullamalla Thanks for your kind help!
selimgunay
Posts: 916
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: Failing to converge

Post by selimgunay »

Nsteps is the number of analysis time steps. Total analysis time is equal to Nsteps * dtForAnalysis
sasakiharuka
Posts: 12
Joined: Fri Jan 19, 2018 12:33 am

Re: Failing to converge

Post by sasakiharuka »

ok, Thank you so much.@ selimgunay
Prafullamalla
Posts: 160
Joined: Mon Feb 02, 2015 6:32 pm

Re: Failing to converge

Post by Prafullamalla »

thanks @selimgunay
Prafulla Malla, Nepal
Praf_malla@hotmail.com
Post Reply