OpenSees Matlab Interaction

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

Moderators: silvia, selimgunay, Moderators

Post Reply
RobertoPhd
Posts: 3
Joined: Mon Dec 10, 2018 8:48 am

OpenSees Matlab Interaction

Post by RobertoPhd »

Dear OpenSees Community
I know about the possibility to run an OpenSees analysis from Matlab by
simply using the command "!OpenSees.exe ANALYSIS.tcl".
My question is: is there any way to make Matlab and OpenSees interact step
by step during an analysis?

To better explain: is it possible to control the Output of OpenSees through
Matlab at each Step, and, based on this output, to modify for example the
load conditions on the structure (or the velocity of certain DOFs or so on)
from the ith step to the i+1th step, and then make the analysis to proceed
from the i+1th step.

I'm thinking about some Matlab code like:

for i=1:numStep
-- RUN STEP_i IN OPENSEES --
if (StructureDisplacement(i) > 1)
-- MODIFY INPUT LOAD --
end
end

I hope I was able to explain myself.
I ask if anybody knows how to do such a thing or an alternative for obtaining the same result.
If not possible with Matlab, python might be useful as well.

Thanks in advance!
Roberto
selimgunay
Posts: 917
Joined: Mon Sep 09, 2013 8:50 pm
Location: University of California, Berkeley

Re: OpenSees Matlab Interaction

Post by selimgunay »

This is probably possible as everything stays in the Opensees memory as long as you don't run the wipe command. To see if it would work, I would just try it without Matlab first. For that purpose, you can create a tcl with your analysis that runs only several steps. Then you can prepare another tcl file with only the updated loads and run this file and see how it works. You can automate the process with Matlab if this runs fine.
Post Reply