mohhsenardiran
Structural
- Nov 24, 2010
- 1
Dear All,
I am trying to use MATLAB to define a Plastic (Wen) damper. Can anyone tell me how can I use this code in MATLAB?
I have the VB code as below [CSi_OAPI_Documentation]:
Sub SetLinkPropPlasticWen()
'dimension variables
Dim SapObject as cOAPI
Dim SapModel As cSapModel
Dim ret As Long
Dim MyDOF() As Boolean
Dim MyFixed() As Boolean
Dim MyNonLinear() As Boolean
Dim MyKe() As Double
Dim MyCe() As Double
Dim MyK() As Double
Dim MyYield() As Double
Dim MyRatio() As Double
Dim MyExp() As Double
'create Sap2000 object
Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")
'start Sap2000 application
SapObject.ApplicationStart
'create SapModel object
Set SapModel = SapObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel
'create model from template
ret = SapModel.File.New2DFrame(PortalFrame, 2, 144, 2, 288)
'add link property
ReDim MyDOF(5)
ReDim MyFixed(5)
ReDim MyNonLinear(5)
ReDim MyKe(5)
ReDim MyCe(5)
ReDim MyK(5)
ReDim MyYield(5)
ReDim MyRatio(5)
ReDim MyExp(5)
MyDOF(0) = True
MyKe(0) = 12
MyCe(0) = 0.01
MyDOF(1) = True
MyNonLinear(1) = True
MyKe(1) = 12
MyCe(1) = 0.01
MyK(1) = 20
MyYield(1)= 50
MyRatio(1)= 0.1
MyExp(1)= 3
MyDOF(2) = True
MyFixed(2) = True
ret = SapModel.PropLink.SetPlasticWen("PW1", MyDOF, MyFixed, MyNonLinear, MyKe, MyCe, MyK, MyYield, MyRatio, MyExp, 2, 0)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Thanks
I am trying to use MATLAB to define a Plastic (Wen) damper. Can anyone tell me how can I use this code in MATLAB?
I have the VB code as below [CSi_OAPI_Documentation]:
Sub SetLinkPropPlasticWen()
'dimension variables
Dim SapObject as cOAPI
Dim SapModel As cSapModel
Dim ret As Long
Dim MyDOF() As Boolean
Dim MyFixed() As Boolean
Dim MyNonLinear() As Boolean
Dim MyKe() As Double
Dim MyCe() As Double
Dim MyK() As Double
Dim MyYield() As Double
Dim MyRatio() As Double
Dim MyExp() As Double
'create Sap2000 object
Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")
'start Sap2000 application
SapObject.ApplicationStart
'create SapModel object
Set SapModel = SapObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel
'create model from template
ret = SapModel.File.New2DFrame(PortalFrame, 2, 144, 2, 288)
'add link property
ReDim MyDOF(5)
ReDim MyFixed(5)
ReDim MyNonLinear(5)
ReDim MyKe(5)
ReDim MyCe(5)
ReDim MyK(5)
ReDim MyYield(5)
ReDim MyRatio(5)
ReDim MyExp(5)
MyDOF(0) = True
MyKe(0) = 12
MyCe(0) = 0.01
MyDOF(1) = True
MyNonLinear(1) = True
MyKe(1) = 12
MyCe(1) = 0.01
MyK(1) = 20
MyYield(1)= 50
MyRatio(1)= 0.1
MyExp(1)= 3
MyDOF(2) = True
MyFixed(2) = True
ret = SapModel.PropLink.SetPlasticWen("PW1", MyDOF, MyFixed, MyNonLinear, MyKe, MyCe, MyK, MyYield, MyRatio, MyExp, 2, 0)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Thanks