integer value too large to represent (Cyclic loading)

For posts concerning the documentation, errors, ommissions, general comments, etc.

Moderators: silvia, selimgunay, Moderators

Post Reply
OneilHan
Posts: 2
Joined: Thu Dec 27, 2018 10:43 pm

integer value too large to represent (Cyclic loading)

Post by OneilHan » Tue Apr 23, 2019 4:25 am

Hello, I'm a beginner in Opensees.
I've tried to build scripts for reversed cyclic loading(static disp. control).
But there's an error in my script as follows.
Please give me wrong points and describe the reasons why the script is wrong.
Thank you

[ERROR]
integer value too large to represent
while executing
"expr int(abs($Dmax)/$DincrStatic)"
(procedure "GeneratePeaks" line 28)
invoked from within
"GeneratePeaks $Dmax $Dincr $CycleType $Fact"
("foreach" body line 2)
invoked from within
"foreach Dmax $iDmax {
set iDstep [GeneratePeaks $Dmax $Dincr $CycleType $Fact];
for {set i 1} {$i <= $Ncycles} {incr i 1} {
set zeroD 0;
set D0 ..."
(file "Pinching4_2.tcl" line 147)

[SCRIPT]
### SOURCE
source LibGeneratePeaks.tcl;

### PROPERTIES
set iDmax "1 -1 5 -5 10 -10 15 -15 20 -20";
set Fact 1; #12801.600
set Dincr 0.01; #[expr 0.01*100000]; #0.01*12801.600
set CycleType Full;
set Ncycles 1;

### SETUP
constraints Plain;
numberer RCM;
system BandGeneral;
test EnergyIncr 1.0e-6 6 0;
algorithm Newton;
integrator DisplacementControl 3 1 10;
analysis Static;

puts "Basic set-up done. -----"
puts "Trying Newton.";

# Performs RCA -----
set fmt1 "%s Cyclic analysis: CtrlNode %.3i, dof %.1i, Disp=%.4f %s";
set count 0;
foreach Dmax $iDmax {
set iDstep [GeneratePeaks $Dmax $Dincr $CycleType $Fact];
for {set i 1} {$i <= $Ncycles} {incr i 1} {
set zeroD 0;
set D0 0;
foreach Dstep $iDstep {
set D1 $Dstep;
set Dincr [expr $D1 - $D0];
integrator DisplacementControl 3 1 $Dincr;
analysis Static;
set ok [analyze 1];
incr count;
if {$ok != 0} {
puts "Trying Newton with Initial Tangent.";
test NormDispIncr 1.0e-8 2000 0;
algorithm Newton -initial;
set ok [analyze 1];
test EnergyIncr 1.0e-8;
algorithm Newton;
}
if {$ok != 0} {
puts "Trying Broyden.";
algorithm Broyden 8;
set ok [analyze 1]
algorithm Newton;
}
if {$ok != 0} {
puts "Trying Newton with Linesearch.";
algorithm NewtonLineSearch 0.8;
set ok [analyze 1]
algorithm Newton;
}
if {$ok != 0} {
set errormsg [format $fmt1 "Error!" 41 1 [nodeDisp 41 1] mm];
puts $errormsg;
return -1;
}
}
}
}
if {$ok != 0} {
puts [format $fmt1 "Error!" 41 1 [nodeDisp 41 1] mm];
} else {
puts [format $fmt1 "Done!" 41 1 [nodeDisp 41 1] mm];
}



[LibGeneratePeaks.tcl]
proc GeneratePeaks {Dmax {DincrStatic 0.01} {CycleType "Full"} {Fact 1} } {; # generate incremental disps for Dmax
###########################################################################
## GeneratePeaks $Dmax $DincrStatic $CycleType $Fact
###########################################################################
# generate incremental disps for Dmax
# this proc creates a file which defines a vector then executes the file to return the vector of disp. increments
# by Silvia Mazzoni, 2006
# input variables
# $Dmax : peak displacement (can be + or negative)
# $DincrStatic : displacement increment (optional, default=0.01, independently of units)
# $CycleType : Push (0->+peak), Half (0->+peak->0), Full (0->+peak->0->-peak->0) (optional, def=Full)
# $Fact : scaling factor (optional, default=1)
# $iDstepFileName : file name where displacement history is stored temporarily, until next disp. peak
# output variable
# $iDstep : vector of displacement increments
file mkdir rca_data
set outFileID [open rca_data/tmpDsteps.tcl w]
set Disp 0.
puts $outFileID "set iDstep { ";
puts $outFileID $Disp;
puts $outFileID $Disp; # open vector definition and some 0
set Dmax [expr $Dmax*$Fact]; # scale value
if {$Dmax<0} {; # avoid the divide by zero
set dx [expr -$DincrStatic]
} else {
set dx $DincrStatic;
}
set NstepsPeak [expr int(abs($Dmax)/$DincrStatic)]
for {set i 1} {$i <= $NstepsPeak} {incr i 1} {; # zero to one
set Disp [expr $Disp + $dx]
puts $outFileID $Disp; # write to file
}
if {$CycleType !="Push"} {
for {set i 1} {$i <= $NstepsPeak} {incr i 1} {; # one to zero
set Disp [expr $Disp - $dx]
puts $outFileID $Disp; # write to file
}
if {$CycleType !="Half"} {
for {set i 1} {$i <= $NstepsPeak} {incr i 1} {; # zero to minus one
set Disp [expr $Disp - $dx]
puts $outFileID $Disp; # write to file
}
for {set i 1} {$i <= $NstepsPeak} {incr i 1} {; # minus one to zero
set Disp [expr $Disp + $dx]
puts $outFileID $Disp; # write to file
}
}
}
puts $outFileID " }"; # close vector definition
close $outFileID
source rca_data/tmpDsteps.tcl; # source tcl file to define entire vector
return $iDstep
}

Post Reply