Getting time step size during EQ analysis

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
eroz
Posts: 49
Joined: Wed Sep 14, 2005 7:47 am
Location: San Francisco

Getting time step size during EQ analysis

Post by eroz »

For the new zero-length element I am adding, it is necessary to solve an additional unique set of differential equations at each step. I have incorporated a function into the code to do this and successfully compiled.

But here is the issue: it is necessary during an earthquake analysis to for the function to know the time step size, say t=0.01 sec.s etc., in order to solve the differential equation. For example: if the initial conditions at time t(i)=20.01 is given, the algorithm needs to know what increment (in our case the time step size) is to be addded to t(i). t(i+0.01) will be where the result is computed.

For cases of nonconvergence I have a code that reduces stepsize in the script where I define my structural model (you can see below). In other words, the step size can be altered during analyses. Therefore, it is necessary for me to get the attempted time step size and deliver it to the function solving my differential equation.

How can I get the attempted time step size during a nonlinear earthquake analysis. Or can I?

Thanks.

Note: Code for reducing stepsize in cases of nonconvergence:

for {set i 1} {$i <= $Nsteps} {incr i} {

puts "ALGORITH COMMENT: Level 0"
set converged [analyze 1 $dt]
if { $converged != 0} {


# Level 1
puts "ALGORITH COMMENT: Level 1"
set dt [expr $dt / $stepReduction]
test NormDispIncr 1e-2 10 1
for {set j 1} {$j <= $stepReduction} {incr j} {
set converged [analyze 1 $dt]
if { $converged != 0} {

# Level 2
puts "ALGORITH COMMENT: Level 2"
set dt [expr $dt / $stepReduction]
for {set k 1} {$k <= $stepReduction} {incr k} {
set converged [analyze 1 $dt]
if { $converged != 0} {

# Level 3
puts "ALGORITH COMMENT: Level 3"
set dt [expr $dt / $stepReduction]
for {set l 1} {$l <= $stepReduction} {incr l} {
set converged [analyze 1 $dt]
if { $converged != 0} {

# Level 4
puts "ALGORITH COMMENT: Level 4"
algorithm ModifiedNewton -initial
set converged [analyze 1 $dt]
if {$converged != 0} {
puts "Failed to converge at time [expr (($i - 1) * pow($stepReduction,3) + ($j - 1) * pow($stepReduction,2) + ($k - 1) * $stepReduction + $l) * $dt] s"
set dynamicAnalysisResults(returnValue) -1
return [array get dynamicAnalysisResults]
# return -1
}
algorithm Newton
}
puts "Convergence achieved at time [expr (($i - 1) * pow($stepReduction,3) + ($j - 1) * pow($stepReduction,2) + ($k - 1) * $stepReduction + $l) * $dt] s"
}
set dt [expr $dt * $stepReduction]
}
puts "Convergence achieved at time [expr (($i - 1) * pow($stepReduction,2) + ($j - 1) * $stepReduction + $k) * $dt] s"
}
set dt [expr $dt * $stepReduction]
}
puts "Convergence achieved at time [expr (($i - 1) * $stepReduction + $j) * $dt] s"
}
set dt [expr $dt * $stepReduction]
test NormDispIncr 1e-1 10 0
}
puts "time [expr $i * $dt] s"
puts [getTime]
}
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

i presume you mean how your element .cpp code can get hold of the dT? .. there is
a global variable ops_Dt you can try using .. otherwise keep the last commmited time
save in your element, and invoke getCurrenTTime() on Domain to get current time at
each trial step (saving this as the commited on a commitState().
eroz
Posts: 49
Joined: Wed Sep 14, 2005 7:47 am
Location: San Francisco

Post by eroz »

The Ops _DT seems to have been working fine for me until a couple of days ago. I use it in an additional differential equation solving algorithm inside my new element. However, at some point in the nonlinear time history analysis, ops_Dt sends "0.0" to my additional solver and my algorithm crashes (dividing a number in there by 0.0). Under which circumstances could ops_Dt be yielding "0.0"? Thanks.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

can you send me the analysis script .. i will try
substituting your ele for one of mine and o/p the dt so i can see what is up.
eroz
Posts: 49
Joined: Wed Sep 14, 2005 7:47 am
Location: San Francisco

Post by eroz »

Sent... Thanks.
Post Reply