multiple runs through MATLAB
Moderators: silvia, selimgunay, Moderators
multiple runs through MATLAB
I would like to run my OpenSees model through multiple earthquakes, one-by-one, automatically. My first thought was a foreach command starting my Tcl file, and progress through a list of ground motion files. Unfortunately, an element I am using (zero length frictional contact element, by Gang Wang) has an issue such that at the end of the run, I must close OpenSees in order to rebuild the model and run another earthquake.
The next thought was to use MATLAB to control OpenSees, but I can't figure out how to pass the matlab variable for the ground motion file on to the nested OpenSees application.
Any thoughts on this? How can I create a script to run multiple earthquakes, closing and reopening opensees between each run?
Thanks so much.
The next thought was to use MATLAB to control OpenSees, but I can't figure out how to pass the matlab variable for the ground motion file on to the nested OpenSees application.
Any thoughts on this? How can I create a script to run multiple earthquakes, closing and reopening opensees between each run?
Thanks so much.
Hi,
have you tried creating the tcl file on the fly? You could create a tcl file and run it all within the same for loop. Here is what I have in mind:
gmotions = ["file1.acc", "file2.acc", ...];
for (i = 1:length(gmotions))
{
<open new output file with i in file name...something like my_opensees_file_i so that you know which tcl file goes with ground motion i>
<use fprint many times to create your tcl file...be sure to call gmotions(i) for the line where you need your input file>
<execute opensees.exe my_opensees_file_i.tcl>
}
I haven't used matlab in a little while so the commands are fuzzy to me. I hope this helps get you started though.
Robbie
have you tried creating the tcl file on the fly? You could create a tcl file and run it all within the same for loop. Here is what I have in mind:
gmotions = ["file1.acc", "file2.acc", ...];
for (i = 1:length(gmotions))
{
<open new output file with i in file name...something like my_opensees_file_i so that you know which tcl file goes with ground motion i>
<use fprint many times to create your tcl file...be sure to call gmotions(i) for the line where you need your input file>
<execute opensees.exe my_opensees_file_i.tcl>
}
I haven't used matlab in a little while so the commands are fuzzy to me. I hope this helps get you started though.
Robbie