Thank you.
You converted displacements into a list. This make sense.
But I got two questions.
1. Displacement data is always stored one on each line in displ.txt. After we read the $fl into data, do we still need to split it on newlines?
2. Why double the "$Dincr-$stepI"? I think $Dincr-$stepI already represent the displacement increment for next step.
[quote="zvidrih"]Hi,
on the other hand you can also modify the static reversed cyclic analysis (example 4 - 2D file: Ex4.Portal2D.analyze.Static.Cycle.tcl)
in the above example file the cyclic load is generated automaticaly, but you can read $iDmax from a file:
eg: (read displacements from a file disp.txt
set stepI 0.0
set fl [open disp.txt]
set data [read $fl]
close $fl
set iDmax [split $data \n]
set stepI 0.0
foreach Dincr $iDmax {
# puts $Dincr
integrator DisplacementControl $IDctrlNode $IDctrlDOF [expr double($Dincr-$stepI)]
analysis Static
# ----------------------------------------------first analyze command------------------------
set ok [analyze 1]
# ----------------------------------------------if convergence failure-------------------------
if {$ok != 0} {
# if analysis fails, we try some other stuff
# performance is slower inside this loop global maxNumIterStatic; # max no. of iterations performed before "failure to converge" is ret'd
if {$ok != 0} {
puts "Trying Newton with Initial Tangent .."
test NormDispIncr $TolStatic 2000 0
algorithm Newton -initial
set ok [analyze 1]
test $testTypeStatic $TolStatic $maxNumIterStatic 0
algorithm $algorithmTypeStatic
}
if {$ok != 0} {
puts "Trying Broyden .."
algorithm Broyden 8
set ok [analyze 1 ]
algorithm $algorithmTypeStatic
}
if {$ok != 0} {
puts "Trying NewtonWithLineSearch .."
algorithm NewtonLineSearch 0.8
set ok [analyze 1]
algorithm $algorithmTypeStatic
}
if {$ok != 0} {
# set putout [format $fmt1 "PROBLEM" $IDctrlNode $IDctrlDOF [nodeDisp $IDctrlNode $IDctrlDOF] $LunitTXT]
# puts $putout
return -1
}; # end if
}; # end if
set stepI $Dincr
}; # end of iDmaxCycl
another way would be the use of MultipleSupport Pattern...[/quote]
Displacment excitation input
Moderators: silvia, selimgunay, Moderators
Re: Cyclic test
Yuhao Feng
Research Assistant & graduate student
CCEE Dept. North Carolina State University
Research Assistant & graduate student
CCEE Dept. North Carolina State University
About double
to: yfeng
[quote]
1. Displacement data is always stored one on each line in displ.txt. After we read the $fl into data, do we still need to split it on newlines?
[/quote]
This is just a precaution - I only tried to give the example, but i think it's necessary.
The same goes to your question 2. Since you read the string value you might get some troubles with operations... ("4" + 1 might result in "41" instead of 5.) It's just a (bad) habit from php, java etc...
To make the long story short: The "split" and "double" are not necessary, if the code works without 'em.
[quote]
1. Displacement data is always stored one on each line in displ.txt. After we read the $fl into data, do we still need to split it on newlines?
[/quote]
This is just a precaution - I only tried to give the example, but i think it's necessary.
The same goes to your question 2. Since you read the string value you might get some troubles with operations... ("4" + 1 might result in "41" instead of 5.) It's just a (bad) habit from php, java etc...
To make the long story short: The "split" and "double" are not necessary, if the code works without 'em.
Zlatko Vidrih
Institute of Structural Engineering, earthquake Engineering and Construction IT
Faculty of Civil and Geodetic Engineering
University of Ljubljana, Slovenia
Institute of Structural Engineering, earthquake Engineering and Construction IT
Faculty of Civil and Geodetic Engineering
University of Ljubljana, Slovenia
Here is the script
foreach Dincr $iDmax {
# puts $Dincr
integrator DisplacementControl $IDctrlNode $IDctrlDOF [expr double($Dincr-$stepI)]
[quote="silvia"]i don't understand question 2, can you please give me the part of the script you are referring to?[/quote]
foreach Dincr $iDmax {
# puts $Dincr
integrator DisplacementControl $IDctrlNode $IDctrlDOF [expr double($Dincr-$stepI)]
[quote="silvia"]i don't understand question 2, can you please give me the part of the script you are referring to?[/quote]
Yuhao Feng
Research Assistant & graduate student
CCEE Dept. North Carolina State University
Research Assistant & graduate student
CCEE Dept. North Carolina State University