How to link MATLAB to Aspen Adsorption? But i have Aspen Adsorption linking with Excel VBA code is here
Sub aspenaAdorption()
‘ Declare variables for the ACM application, document, and simulation
Dim ACMApp As Object
Dim ACMDocument As Object
Dim ACMSimulation As Object
‘ Create an instance of the ACM application
Set ACMApp = CreateObject("ACM Application")
‘ Use "ACM Application" for Aspen Custom Modeler
‘ Use "ADS Application" for Aspen Adsorption
‘ Make the ACM application visible
ACMApp.Visible = True
‘ Open the specified simulation document
Set ACMDocument = ACMApp.OpenDocument("C:UsersuserDesktopH2_Purification.acmf")
‘ Set the simulation object to the current simulation in the application
Set ACMSimulation = ACMApp.Simulation
‘ Set the simulation to run in dynamic mode
ACMSimulation.RunMode = "Dynamic"
‘ Run the simulation
ACMSimulation.Run (True)
‘ Check if the simulation was successful and display a message box
If ACMSimulation.Successful Then
MsgBox "Simulation Complete"
Else
MsgBox "Simulation Failed"
End If
‘ Quit the ACM application
ACMApp.Quit
End SubSub aspenaAdorption()
‘ Declare variables for the ACM application, document, and simulation
Dim ACMApp As Object
Dim ACMDocument As Object
Dim ACMSimulation As Object
‘ Create an instance of the ACM application
Set ACMApp = CreateObject("ACM Application")
‘ Use "ACM Application" for Aspen Custom Modeler
‘ Use "ADS Application" for Aspen Adsorption
‘ Make the ACM application visible
ACMApp.Visible = True
‘ Open the specified simulation document
Set ACMDocument = ACMApp.OpenDocument("C:UsersuserDesktopH2_Purification.acmf")
‘ Set the simulation object to the current simulation in the application
Set ACMSimulation = ACMApp.Simulation
‘ Set the simulation to run in dynamic mode
ACMSimulation.RunMode = "Dynamic"
‘ Run the simulation
ACMSimulation.Run (True)
‘ Check if the simulation was successful and display a message box
If ACMSimulation.Successful Then
MsgBox "Simulation Complete"
Else
MsgBox "Simulation Failed"
End If
‘ Quit the ACM application
ACMApp.Quit
End Sub Sub aspenaAdorption()
‘ Declare variables for the ACM application, document, and simulation
Dim ACMApp As Object
Dim ACMDocument As Object
Dim ACMSimulation As Object
‘ Create an instance of the ACM application
Set ACMApp = CreateObject("ACM Application")
‘ Use "ACM Application" for Aspen Custom Modeler
‘ Use "ADS Application" for Aspen Adsorption
‘ Make the ACM application visible
ACMApp.Visible = True
‘ Open the specified simulation document
Set ACMDocument = ACMApp.OpenDocument("C:UsersuserDesktopH2_Purification.acmf")
‘ Set the simulation object to the current simulation in the application
Set ACMSimulation = ACMApp.Simulation
‘ Set the simulation to run in dynamic mode
ACMSimulation.RunMode = "Dynamic"
‘ Run the simulation
ACMSimulation.Run (True)
‘ Check if the simulation was successful and display a message box
If ACMSimulation.Successful Then
MsgBox "Simulation Complete"
Else
MsgBox "Simulation Failed"
End If
‘ Quit the ACM application
ACMApp.Quit
End Sub aspenadsorption, aspen, aspen adsorption link, aspen matlab MATLAB Answers — New Questions