running Matlab in Opensees

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

Moderators: silvia, selimgunay, Moderators

Post Reply
zeynepp
Posts: 4
Joined: Tue Mar 31, 2009 5:34 pm
Location: UCLA

running Matlab in Opensees

Post by zeynepp »

Hi,

I am doing a pushover analysis and recording the displacements in a Matlab output file in order to make it check each displacement not to exceed a certain value. When you run the Matlab file, if any displacement is larger than that value, it gives "result=FAIL" and exits.

Is it possible to call back and run that Matlab file in Opensees and get the result? I want Opensees to exit the analysis if the 'result' is FAIL.

Thanks,

Zeynep
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

do the check in OpenSees and not matlab.
use the nodeDisp command to get nodal displacements.
zeynepp
Posts: 4
Joined: Tue Mar 31, 2009 5:34 pm
Location: UCLA

Post by zeynepp »

Thanks for the reply.
And is there any command to check stresses or strains? Actually the idea in creating that Matlab output was to check the strains at some locations in a fiber section. I want to check the strains that I get using recorder command during but not after the analysis.
msa_imeg
Posts: 19
Joined: Sun Mar 09, 2008 9:15 pm
Location: Ferdowsi University of Mashhad

Post by msa_imeg »

I think you must writing new script file like this :
....
constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral; # how to store and solve the system of equations in the analysis
test NormDispIncr $Tol 20 ; # determine if convergence has been achieved at the end of an iteration step
algorithm Newton; # use Newton's solution algorithm: updates tangent stiffness at every iteration
integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr
analysis Static; # define type of analysis static or transient

while {$u <= $Dmax and check another condition to countinue pushing } {
#puts "$u"
analyze 1;
set u [expr $u+$Dincr];
# here check section stress or strain
#...
#
}

...

but Problem is I think Opensees doesn't have any command Like
nodeDisp $dof $nTag
you should define new command in commands.cpp file to return section force at each step !?
ionwang
Posts: 16
Joined: Wed Mar 25, 2009 7:40 am
Location: HIT

Post by ionwang »

[quote="zeynepp"]Thanks for the reply.
And is there any command to check stresses or strains? Actually the idea in creating that Matlab output was to check the strains at some locations in a fiber section. I want to check the strains that I get using recorder command during but not after the analysis.[/quote]

If you can make it by matlab, you can do it by opensees likewise. The second one is easier to complete.
I don't know how to get the strain information during the analysis.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

use the eleResponse command.

the syntax is:

eleResponse eleTag? arg1? arg2? ...

where the arguments arg1, arg2, etc are the exact smae ones used in the recorder Element comand.

for a simple truss example if these are the recorder commands used:

recorder Element -time -ele 1 2 3 -file a.out axialForce
recorder Element -time -ele 1 2 3 -file b.out material stress

then these are the corresponding eleResponse commands

set a [eleResponse 1 forces]
set b [eleResponse 1 material stress]
puts $a
puts $b
Post Reply