NEW SCRIPT: Static Analysis -- Adaptive Update for Step Size

If you have a script you think might be useful to others post it
here. Hopefully we will be able to get the most useful of these incorporated in the manuals.

Moderators: silvia, Moderators

NEW SCRIPT: Static Analysis -- Adaptive Update for Step Size

Postby blaiman » Wed Sep 25, 2013 10:30 pm

Hello everyone,

Attached is a copy of a source file that a colleague and I created which will update the step size of a static analysis automatically with a maximum step size and a minimum step size.
It should be straight forward to use given the definitions of which parameter represents and it has been tested out on several cases to check its validity. Hope it comes in handy to some
(if not most) of you out there.


############################################################################
# adaptiveUpdate.tcl
# Author: Brighton Laiman, 09/25/2013
# Co-Author: Matthew D. Smith, 09/25/2013
#
# This routine updates the step size for a displacement control analysis
# is the initial step size used was too large.
#
# Variables
# Dmax = maximum displacement of control node for analysis
# Nsteps = initial number of steps for analysis
# IDctrlNode = node number that controls the displacement analysis
# IDctrlDOF = DOF corresponding to IDctrlNODE that is being used
# Tol = tolerance used for testing to see if step has converged
# algorithmTypeStatic = solution algorithm to revert back to
# maxDivisor = denominator determining the minimum step size
#
############################################################################

proc adaptiveUpdate { Nsteps Dmax IDctrlNode IDctrlDOF Tol algorithmTypeStatic maxDivisor} {
set Dincr [expr $Dmax / $Nsteps];
set maxStepSize [expr $Dmax/$Nsteps];
set minStepSize [expr $maxStepSize/$maxDivisor];
set currentDisp 0.0;
set counter 0;

while {abs($currentDisp) < abs($Dmax)} {
set ok [analyze 1];

if {[expr $currentDisp + $Dincr] > $Dmax} {
set Dincr [expr $Dmax - $currentDisp];
}

while {$ok != 0} {
if {abs($Dincr) < abs($minStepSize)} {
puts "PROBLEM: node=$IDctrlNode, DOF=$IDctrlDOF, disp=[nodeDisp $IDctrlNode $IDctrlDOF]"
puts "MINIMUM STEP SIZE IS EXCEEDED! ANALYSIS FAILED!!!"
return -1
}
set counter 0;
set Dincr [expr $Dincr / 4.];
puts "The StepSize is QUARTERED: $Dincr"
integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr;
set ok [analyze 1];

if {$ok != 0} {
puts "Trying Broyden Algorithm..."
algorithm Broyden 8;
set ok [analyze 1];
algorithm $algorithmTypeStatic;
}
if {$ok != 0} {
puts "Trying NewtonLineSearch Algorithm..."
algorithm NewtonLineSearch -tol 0.8;
set ok [analyze 1];
algorithm $algorithmTypeStatic;
}
if {$ok != 0} {
puts "Trying ModifiedNewton Algorithm..."
algorithm ModifiedNewton;
set ok [analyze 1];
algorithm $algorithmTypeStatic;
}
}; # end adaptive update while loop

set currentDisp [nodeDisp $IDctrlNode $IDctrlDOF]
set counter [expr $counter+1];

if {$counter == 4} {
set counter 0;
set tmp [expr $Dincr*2.];
if {abs($tmp) < abs($maxStepSize)} {
set Dincr $tmp;
} else {
set Dincr $maxStepSize;
}
puts "The StepSize is DOUBLED: $Dincr"
integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr;
}; # end if
}; # end main while loop
}
Last edited by blaiman on Sat Sep 28, 2013 10:34 am, edited 3 times in total.
Brighton Laiman
Development Engineer
RISA Technologies
Foothill Ranch, CA
blaiman
 
Posts: 55
Joined: Wed Jul 11, 2012 11:59 am
Location: RISA Technologies

Re: NEW SCRIPT: Static Analysis -- Adaptive Update for Step

Postby MDSmith526 » Thu Sep 26, 2013 5:22 pm

Comment removed by poster. Why is there no delete option?
Last edited by MDSmith526 on Fri Sep 27, 2013 6:32 am, edited 2 times in total.
Matthew D Smith, PhD, PE
Research Civil Engineer
Information Technology Laboratory
Engineering Research and Development Center
US Army Corps of Engineers
Vicksburg, MS
MDSmith526
 
Posts: 48
Joined: Sat Mar 13, 2010 4:13 pm
Location: USACE

Re: NEW SCRIPT: Static Analysis -- Adaptive Update for Step

Postby blaiman » Thu Sep 26, 2013 6:07 pm

It should be completely updated now.
Brighton Laiman
Development Engineer
RISA Technologies
Foothill Ranch, CA
blaiman
 
Posts: 55
Joined: Wed Jul 11, 2012 11:59 am
Location: RISA Technologies

Re: NEW SCRIPT: Static Analysis -- Adaptive Update for Step

Postby pendiray » Wed Oct 11, 2017 8:56 am

update services all outstanding events, including those that come due while update is operating. It was provided to allow tasks such as refreshing a GUI to happen immediately
pendiray
 
Posts: 1
Joined: Wed Oct 11, 2017 8:46 am


Return to Useful Scripts.

Who is online

Users browsing this forum: No registered users and 1 guest