How to do Interface between Aspen Hysys and Matlab and perform Hybrid optimization

16 次查看(过去 30 天)
Hi
Is there anyone who can me help me please. I am doing LNG plant optimization. To perform the optimization I first did the simulation on Hysys and interface HYSYS with Matlab. The model is still now in steady-state condition. When I am using the compressor outlet pressure as the decision variables, The simulation is working and it can minimize the energy consumption.
But, when I am using the refrigerant mass flow rate or outlet pressure of throttle valves as decision variables, the simulation get's unconverged and the simulation stopped.
In addition to this, when I am using refrigerant mass fraction as decision variables and run the optimization it shows the following error "Invoke Error, Dispatch Exception: No such interface supported"
If I the convert the simulation into dynamic mode, the problem will be solved ?
whenever, i am trying to convert the model into dynamic it's showing that notification in this picture.
  14 个评论
Rasel Ahmed
Rasel Ahmed 2021-5-17
Hi liang,
I am sharing the codes to interface hysys with matlab, and providing another link of the details code. Have you tried to use mixed refrigerant mass fraction / mass flow as decision variables ?. I am facing some problem that I couldn't change the mixed refrigerant mass fraction values.
MyObject=actxserver('Hysys.Application');
global MySimCase;
FileNamePath = 'C3MR7v6';
MySimCase = MyObject.SimulationCases.Open([cd,strcat('\',...
FileNamePath,'.hsc')]);
MySimCase.Visible = true;
MyOperations = MySimCase.Flowsheet.Operations; % Getting data from our simcase operations
MyFlowSheet = MySimCase.get('flowsheet'); %accessing to flowsheet
MyMaterialStreams = MyFlowSheet.get('MaterialStreams'); %accessing to simulated material streams
MyEnergyStreams = MyFlowSheet.get('EnergyStreams'); % Energy streams
Ting Liang
Ting Liang 2021-5-19
Thanks a lot for your sharing.
Sorry, I am not working on mixed refrigerant, but on air, sorry that I cannot help with your problem now, but hope we can communicate with and help each other more later.
Thanks.
Best regards
Ting Liang

请先登录,再进行评论。

回答(1 个)

bilal kazmi
bilal kazmi 2020-12-24
if you provide any help in this please share some file as iam also in search of specific file
  1 个评论
Rasel Ahmed
Rasel Ahmed 2021-5-17
Hi kazmi,
I am sharing the codes to interface hysys with matlab, and providing another link of the details code. Have you tried to use mixed refrigerant mass fraction / mass flow as decision variables ?. I am facing some problem that I couldn't change the mixed refrigerant mass fraction values.
MyObject=actxserver('Hysys.Application');
global MySimCase;
FileNamePath = 'C3MR7v6';
MySimCase = MyObject.SimulationCases.Open([cd,strcat('\',...
FileNamePath,'.hsc')]);
MySimCase.Visible = true;
MyOperations = MySimCase.Flowsheet.Operations; % Getting data from our simcase operations
MyFlowSheet = MySimCase.get('flowsheet'); %accessing to flowsheet
MyMaterialStreams = MyFlowSheet.get('MaterialStreams'); %accessing to simulated material streams
MyEnergyStreams = MyFlowSheet.get('EnergyStreams'); % Energy streams

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Thermal Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by