Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAP2000 API using MATLAB - Time History Analysis 3

Status
Not open for further replies.

bridgehealth

Structural
May 23, 2011
2
I'm trying to run an time history analysis using the SAP API with MATLAB to run several different (100s) of time history records on a structure. I've been able to create the actual time history load case itself (using SAPMod.LoadCases.ModHistLinear.SetCase) and able to change the number of time steps (using SAPMod.LoadCases.ModHistLinear.SetTimeStep), but when I try to actually change the parameters of the time history (such as input, load pattern, etc...) using SAPMod.LoadCases.ModHistLinear.SetLoads, it doesn't work. However, I can do it manually and get the information back using SAPMod.LoadCases.ModHistLinear.GetLoads, but then just trying to put it back into it doesn't work.

Please help if you have any hints!
 
Replies continue below

Recommended for you

Hi newtonthegreat,

If you define Value like this:

Value=zeros(6,1)
Value(1) = true;
Value(2) = true;
Value(3) = true;
Value(4) = true;
Value(5) = true;
Value(6) = true;

and then call "whos":

>> whos Value
Name Size Bytes Class Attributes
Value 6x1 48 double

you can see that the variable is an array of doubles because the logical (true/false) is converted to double (1/0) and then stored in Value (defined previously as double).

You could try something like this:

>> t = true;
>> f = false;
>> Value = [t; t; t; f; f; f];
>> whos Value
Name Size Bytes Class Attributes
Value 6x1 6 logical

Now the variable is an array of logicals.

I have succesfully tried this way in methods like:

SapModel.PropLink.SetMultiLinearPlastic
SapModel.FrameObj.SetReleases
SapModel.PointObj.SetRestraint
.
.
.

 
In the closed thread


khalilalloqa asked

"Hello, where could i find the VBA examples for sap verifications?"

For SAP2000 V14 they are located in one file in the path:

[Program files]\Computers and Structures\SAP2000 14\Verification\SAP2000_Verification_1400.xls
 

Hi Osquru,
You are right. I just checked my previous models and I found another way of doing the same thing is to initialize as below and then assign value.

Value = logical(zeros(6,1));
for i=1:6
Value(i)=true;
end

ret = SapModel.ConstraintDef.SetBody('Body1', Value);

That's how I was doing up till now but earlier I didnt even realise how important that step was.
Anyways thanks for giving me another method and explaining it so nicely.

Thanks
 
Hi Osquro and everyone,
Currently I am working on a model in which I need to define a non prismatic section in SAP2000. Below is the syntax that I wrote for that. I was able to get the two cross section that I am going to define at starting and ending node but unfortunately the non prismatic section is not getting assigned through my code.


ret=SapModel.PropFrame.SetISection('A','A36',20,6,0.5,0.3,8,0.8);
ret=SapModel.PropFrame.SetISection('B','A36',10,6,0.5,0.3,8,0.8);

%Both syntaxes above are working fine but this below one it gives ret=1 (unassigned value).

NoItem=1;
StSec={'A';'A'};
EndSec={'B';'B'};
mlen=[1;1];
m=double(mlen);
mtype=[1;1];
EI33=[2;2];
EI22=[1;1];

ret=SapModel.PropFrame.SetNonPrismatic('Var1',NoItem,StSec,EndSec,m,mtype,EI33,EI22,-1)
%above syntax assigns a variable section for non prismatic section defined by cross section A at starting node and B at ending node.

I would appreciate if somebody can give me some hint or suggest something to solve this.

Thanks!!
 
newtonthegreat

It didn't work in my machine.

Sometimes to learn the syntax of other commands, I've tried reading data provided by GET method before using SET method. For example, try the method GetNonPrismatic in a existing file, so you can see the expected arguments to be used in the function SetNonPrismatic.

But in this case Matlab just crashes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor