Domain Time change

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

Moderators: silvia, selimgunay, Moderators

Post Reply
mghaffarinia
Posts: 5
Joined: Mon Oct 17, 2011 4:54 am
Location: METU

Domain Time change

Post by mghaffarinia »

Dear Vensa,
Recently I face with a problem that is related to time. I apply an earthquake to a 2-D frame. Due to convergence problems I use the method that is recommended in one of the tutorials which is to change the algorithm (Linear, KrylovNewton, Newton,...) during the analyze if a convergence problem occurs. In normal the earthquake is 32 seconds, however when this code confronted with a convergence problem and enters to the while loop to find the appropriate algorithm, then the time increases to 50 seconds. What should I do to keep the time constant when code enters to the while loop?
here is the part of the code I'm talking about:

for {set i 1} {$i <=$Nsteps} {incr i 1} {
set ok [analyze 1 $DtAnalysis]; # actually perform analysis; returns ok=0 if analysis was successful
# if analysis was not successful.
if {$ok != 0} { ;
# 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 Modified Newton.."
algorithm ModifiedNewton
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}

if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
algorithm Newton -initial
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying Newton with Initial Then Current Tangent .."
algorithm Newton -initialThenCurrent
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}

if {$ok != 0} {
puts "Trying Broyden .."
algorithm Broyden 8
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch 0.8
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}
if {$ok != 0} {
puts "Trying Linear .."
algorithm Linear
set ok [analyze 1 [expr $DtAnalysis]]
algorithm $algorithmType
}

}
}; # end if ok !0

eigen generalized 3
# set eigenvalues [eigen generalized 3]
set nEigenI 1;
set nEigenII 2;
set nEigenJ 3;
set lambdaN [eigen [expr $nEigenJ]];
set lambdaI [lindex $lambdaN [expr $nEigenI-1]];
set lambdaII [lindex $lambdaN [expr $nEigenII-1]];
set lambdaJ [lindex $lambdaN [expr $nEigenJ-1]];
puts $file2a $lambdaI
puts $file2b $lambdaII
puts $file2c $lambdaJ

# Update Rayleigh
set betaKcurr [expr $KcurrSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # current-K; +beatKcurr*KCurrent
set betaKcomm [expr $KcommSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # last-committed K; +betaKcomm*KlastCommitt
set betaKinit [expr $KinitSwitch*2.*$xDamp/($omegaI+$omegaJ)]; # initial-K; +beatKinit*Kini
rayleigh $alphaM $betaKcurr $betaKinit $betaKcomm; # RAYLEIGH damping
puts $i
}
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: Domain Time change

Post by vesna »

I do not see anything in the code that would change the total time of the analysis. Make sure that Nsteps and DtAnalysis are defined correctly.
Post Reply