필터 지우기
필터 지우기

Using Coolprop in Simulink

조회 수: 26 (최근 30일)
Roberto Tascioni
Roberto Tascioni 2018년 4월 6일
댓글: Roberto Tascioni 2022년 1월 17일
Hi everyone, I have a question that bother me from long time, I've written my function of Organic Rankine Cycle .m-file in a Matlab and I'm going to put it inside Simulink, I know there are some possibilities to do it, but the more feasible (I think) consists of using an interpolated lookup table of the "Thermal Liquid Settings (TL) block". I have already (manually) prepared the table in a .mat-file, but the problem is: how I can get physical properties of fluid from the block ? for example a call like :
CoolProp.PropsSI('S','T',T3,'P',p_evap,'Novec649')
there is this example on the website, but it cannot help me Rankine Cycle (Steam Turbine) I want not use a low level interface for several reason, is there someone that is able to provide a solution ? Thanks
Roberto
  댓글 수: 2
Vishal Varadraj
Vishal Varadraj 2022년 1월 17일
Did you manage to figure it out in the end?
Roberto Tascioni
Roberto Tascioni 2022년 1월 17일
yes, Malte Radecke answered to me, I also implemented a lookup table inside a matlab function to speed up the model (dynamic simulations), but it's less precise, depends how many calls you use and what kind of them (error propagation).
Ragards

댓글을 달려면 로그인하십시오.

채택된 답변

Malte Radecke
Malte Radecke 2022년 1월 17일
One way is to call CoolProp like this: https://groups.google.com/g/coolprop-users/c/gakJEFWTQwY
You just need to adjust the code to (if I remember correctly):
function T = fcn(P,Q)
T = zeros(1,1);
coder.extrinsic('py.CoolProp.CoolProp.PropsSI')
T=py.CoolProp.CoolProp.PropsSI('T', 'P', P, 'Q', Q, 'WATER')
end
Remember that you first have to call CoolProp in MATLAB via a Python Wrapper. Look here for more information: http://www.coolprop.org/coolprop/wrappers/MATLAB/index.html

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Thermal Liquid Library에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by