running Matlab in Opensees
Moderators: silvia, selimgunay, Moderators
running Matlab in Opensees
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
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
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 !?
....
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 !?
[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.
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.
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
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