Displacment excitation input

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

Moderators: silvia, selimgunay, Moderators

yfeng
Posts: 73
Joined: Thu Aug 28, 2008 11:47 am
Location: North Carolina State University

Re: Cyclic test

Post by yfeng »

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]
Yuhao Feng
Research Assistant & graduate student
CCEE Dept. North Carolina State University
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

it reads continous, i think.
you have to play with that.
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

i don't understand question 2, can you please give me the part of the script you are referring to?
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
zvidrih
Posts: 39
Joined: Wed Apr 30, 2008 1:55 am
Location: Ljubljana, Slovenia

About double

Post by zvidrih »

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.
Zlatko Vidrih
Institute of Structural Engineering, earthquake Engineering and Construction IT
Faculty of Civil and Geodetic Engineering
University of Ljubljana, Slovenia
yfeng
Posts: 73
Joined: Thu Aug 28, 2008 11:47 am
Location: North Carolina State University

Post by yfeng »

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]
Yuhao Feng
Research Assistant & graduate student
CCEE Dept. North Carolina State University
Post Reply