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

조회 수: 22 (최근 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에서 Fluid Dynamics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by