multiple runs through MATLAB

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

Moderators: silvia, selimgunay, Moderators

Post Reply
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

multiple runs through MATLAB

Post by bkosbab »

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.
silvia
Posts: 3909
Joined: Tue Jan 11, 2005 7:44 am
Location: Degenkolb Engineers
Contact:

Post by silvia »

you really should contact Gang Wang about this!
Silvia Mazzoni, PhD
Structural Consultant
Degenkolb Engineers
235 Montgomery Street, Suite 500
San Francisco, CA. 94104
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

Post by bkosbab »

Yes, I have in the past. He is aware of the issue, but doesn't have the time to troubleshoot/debug. I'm just looking for a work-around.
rjaeger
Posts: 102
Joined: Thu Aug 31, 2006 9:57 pm
Location: UC Davis

Post by rjaeger »

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
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

Post by bkosbab »

That's sort of what I had in mind. However, I was hoping to run a MATLAB for loop using a series of ground motions, and pass the ground motion name to the opensees tcl file automatically. Unfortunately, I can't figure out how to pass a MATLAB variable into the nested Opensees.
rjaeger
Posts: 102
Joined: Thu Aug 31, 2006 9:57 pm
Location: UC Davis

Post by rjaeger »

You can do this using what I said above. Create a tcl file and then pass it to opensees, all within the same for loop.
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

Post by bkosbab »

Sorry, I misread your idea the first time. I can try this. 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 a small script with the problem so that i can look into gang's problem.
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

Post by bkosbab »

sure, I'll do that tomorrow morning.
bkosbab
Posts: 30
Joined: Tue Nov 14, 2006 12:15 pm
Location: Georgia Institute of Technology

Post by bkosbab »

e-mail sent
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

i have fixed the bug .. the revised code is in the repository and will be reflected in version 2.0.1 when it is released .. i can send a link to a beta version of the release if anybody else is suffering from this problem.
Post Reply