parameters optimization in MATLAB with OPENSEES

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
gaohouzhi
Posts: 28
Joined: Mon Jan 11, 2010 6:44 am
Location: TsingHua University

parameters optimization in MATLAB with OPENSEES

Post by gaohouzhi »

These days I encounter some difficult problems ,so I need your help eagerly.

I want to set up an OpenSees structure model in MatLab circumstances with MatLab commands,like setting up the model in the opensees Tcl interface by hands.

So I can put the element length as the parameters to be optimize in MATLAB using the OpenSees analysis results of the structure model.

The only apparent difference is that this process is finished by inputing MatLab commands in the matlab interfaced.

Of course ,in Matlab ,this process is more difficulty,because this process invloves not only inputing commands in matlab(like the fprintf commands) but also the invoking "openSees.exe" with the words added by those input commands in matlab previously.

I have made many calls for help ,but none responses. Can you help me? I will appreciate any reply. :cry: :cry: :? :?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

ask the authros behind OpenSeesNavigator .. that is a GUI written in matlab for pre and post processing, i.e. writing opensees scripts, executing them, and processing the results files.
zvidrih
Posts: 39
Joined: Wed Apr 30, 2008 1:55 am
Location: Ljubljana, Slovenia

simple

Post by zvidrih »

Hi,

I am not sure what exactly is your question, but I usualy connect matlab with opensees in the following way:

1) write and save the tcl input file by matlab...

eg.

file = fopen('matlabinput.tcl', 'w+');
fprintf(file,'model BasicBuilder -ndm 3 -ndf 6 \n');
fprintf(file,'...
fclose(file);

2) run opensees with that tcl

eval(['!openseespath.exe',' ','matlabinput.tcl']);

(NOTE: it's a good idea to pause matlab before loading the results using the command pause(1); )

3) load the results back to matlab

forces=load(...);
displacements=load(...);

4) do the postprocessing

plot(displacements,forces)...

or perform some optimisation ... change parameters, save new tcl sile ... repeat 1-4

But if you don't need matlab sophistication you can do many things by tcl...
Zlatko Vidrih
Institute of Structural Engineering, earthquake Engineering and Construction IT
Faculty of Civil and Geodetic Engineering
University of Ljubljana, Slovenia
gaohouzhi
Posts: 28
Joined: Mon Jan 11, 2010 6:44 am
Location: TsingHua University

Thanks very a lot

Post by gaohouzhi »

Your advice is very important.
Under your instruction,I make the analysis successfully.
Thank you very very a lot.
alima2065
Posts: 13
Joined: Wed Feb 09, 2011 9:15 am
Location: nar

Re: parameters optimization in MATLAB with OPENSEES

Post by alima2065 »

Dear zvidrih thank you . but i have a problem with this code. When i use eval(['!openseespath.exe',' ','matlabinput.tcl']); it works but i have another sourced file (records.tcl) in “matlabinput.tcl” file and must be executed; but it get out this error
couldn't read file "records.tcl": no such file or directory
I would appreciate if you help me
fede121
Posts: 2
Joined: Wed Jun 06, 2012 3:25 pm
Location: Unipd

Re: parameters optimization in MATLAB with OPENSEES

Post by fede121 »

Dear Alima, I'm reading now your post, it seems to be a path problem. You should check where is your OpenSees working and where it expects to find the records.tcl file.
Hope this helps.
Post Reply