Error in using refpropm.m in a Matlab function with Simulink

7 visualizzazioni (ultimi 30 giorni)
Hello to everybody, I am trying to write a code in Simulink for modeling a CHP system but, at the moment, I cannot use the refpropm.m inside a MATLAB Function.
The whole code works perfectly in Matlab but, if I put an expression like "y = refpropm('T','p',u,'q',0,'water')" in a Matlab function inside Simulink I receive the following error:
_"This kind of expression is not supported.
Function 'refpropm.m' (#42.9054.9078), line 211, column 29: "@() rp_proto64(BasePath)" Launch diagnostic report."_
I'm using Matlab 2012b win32, but I've installed both versions (win32 and win64).
Can you help me ? Thank you very much Mattia

Risposte (1)

Haris Hussain
Haris Hussain il 14 Giu 2018
Hello Dear
The simplest way to solve the issue is to use Matlab integrated function block and use the following syntax for defining the function refpropm('H','T', u(1),'P',u(2),'water')
i.e. calculating the enthalpy for water for the given values of temperature and Pressure. u(1) is the input value/values for Temperature and u(2) for pressure.

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by