Hi All, my question is the following, I created an expRecorder that contains information of 8 dof, and I need to keep track of them during the analysis, but the information is saved on the recorder and becomes available until the end of the full run, but I need to access to it step by step during the analysis; how could I save an external file that I could open for ex. in Matlab to manage this info, or how can I close the recorder to print the information and then continue saving on the next step and reading and so on...?
Thanks for the help...
How to read during an analysis an expRecorder??
Moderators: silvia, selimgunay, Moderators
Re: How to read during an analysis an expRecorder??
try using "remove recorder $tag" or "remove recorders" command after each step of analysis (whichever works for you).
Re: How to read during an analysis an expRecorder??
Hi again Vesna, thanks for your reply, but still hasn't work.
The real problem is that I need to be reading the recorder as is being created step by step, but I can start reading after 491 points are stored, it looks that OpenSees stores on a buffer and after a while starts sending info to the recorders or so, I'm not sure; what I'm doing is I do analysis step by step since I'm going to do some intermediate calculations calling Matlab, that depend on the information stored on the recorders, my script is this:
while {$counter <= $NumSteps1} {
recorder Drift -file $dataDir/Drift-Story1.out -time -iNode 14 -jNode 24 -dof 1 -perpDirn 2;
set tagRc [recorder Drift -file $dataDir/Drift-Story1.out -time -iNode 14 -jNode 24 -dof 1 -perpDirn 2;]
DynamicAnalysisCollapseSolver1 $dt $dtAn1 $GMtime1 $NStories 0.20 $FloorNodes $HStory1 $HStoryTyp $counter $NumSteps1 $sel $sel2
set timenow [getTime]
set counter [expr $counter+1]
set fileID2 [open $dataDir/Drift-Story1.out r];
set fileData2 [read $fileID2];
close $fileID2;
set lines [split $fileData2 "\n"];
set linea [lindex $lines 0] ;
puts "linea*-------*** $linea"
set fileID25 [open $dataDir/recorder_rt.txt a];
puts $fileID25 "$linea"
close $fileID25;
remove recorder $tagRc
}
Hopefully you can give me a hint on this problem...
Thanks again!
The real problem is that I need to be reading the recorder as is being created step by step, but I can start reading after 491 points are stored, it looks that OpenSees stores on a buffer and after a while starts sending info to the recorders or so, I'm not sure; what I'm doing is I do analysis step by step since I'm going to do some intermediate calculations calling Matlab, that depend on the information stored on the recorders, my script is this:
while {$counter <= $NumSteps1} {
recorder Drift -file $dataDir/Drift-Story1.out -time -iNode 14 -jNode 24 -dof 1 -perpDirn 2;
set tagRc [recorder Drift -file $dataDir/Drift-Story1.out -time -iNode 14 -jNode 24 -dof 1 -perpDirn 2;]
DynamicAnalysisCollapseSolver1 $dt $dtAn1 $GMtime1 $NStories 0.20 $FloorNodes $HStory1 $HStoryTyp $counter $NumSteps1 $sel $sel2
set timenow [getTime]
set counter [expr $counter+1]
set fileID2 [open $dataDir/Drift-Story1.out r];
set fileData2 [read $fileID2];
close $fileID2;
set lines [split $fileData2 "\n"];
set linea [lindex $lines 0] ;
puts "linea*-------*** $linea"
set fileID25 [open $dataDir/recorder_rt.txt a];
puts $fileID25 "$linea"
close $fileID25;
remove recorder $tagRc
}
Hopefully you can give me a hint on this problem...
Thanks again!
-
- Posts: 140
- Joined: Sun Oct 03, 2010 11:36 pm
- Location: Hong Kong
Re: How to read during an analysis an expRecorder??
Does the following help?
# set some parameters
set maxU 15.0; # Max displacement
set ok 0
set currentDisp 0.0
# perform the analysis
while {$ok == 0 && $currentDisp < $maxU} {
set ok [analyze 1]
# if the analysis fails try initial tangent iteration
if {$ok != 0} {
puts "regular newton failed .. lets try an initail stiffness for this step"
test NormDispIncr 1.0e-12 1000
algorithm ModifiedNewton -initial
set ok [analyze 1]
if {$ok == 0} {puts "that worked .. back to regular newton"}
test NormDispIncr 1.0e-12 10
algorithm Newton
}
}
set currentDisp [nodeDip 3 1]
}
from http://opensees.berkeley.edu/wiki/index ... r_Analysis
# set some parameters
set maxU 15.0; # Max displacement
set ok 0
set currentDisp 0.0
# perform the analysis
while {$ok == 0 && $currentDisp < $maxU} {
set ok [analyze 1]
# if the analysis fails try initial tangent iteration
if {$ok != 0} {
puts "regular newton failed .. lets try an initail stiffness for this step"
test NormDispIncr 1.0e-12 1000
algorithm ModifiedNewton -initial
set ok [analyze 1]
if {$ok == 0} {puts "that worked .. back to regular newton"}
test NormDispIncr 1.0e-12 10
algorithm Newton
}
}
set currentDisp [nodeDip 3 1]
}
from http://opensees.berkeley.edu/wiki/index ... r_Analysis
Research Assistant Professor, The Hong Kong Polytechnic University
guanlin@polyu.edu.hk
guanlin@polyu.edu.hk
Re: How to read during an analysis an expRecorder??
What is the initial value of the counter and how do you update it?
If you can not make "remove recorders" work for you, you can use nodeDisp OpenSees command (http://opensees.berkeley.edu/wiki/index ... sp_Command) to retrieve nodal displacements that you can use to calculate drifts.
If you can not make "remove recorders" work for you, you can use nodeDisp OpenSees command (http://opensees.berkeley.edu/wiki/index ... sp_Command) to retrieve nodal displacements that you can use to calculate drifts.