alternative way of calling Coolprop every sampling time in simulink
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello all,
I am using Coolprop for humid air properties in Simulink with Matlab function block. It is working well without any error, but it's too slow. I guess it is calling Coolprop from python library every sampling time, and it makes simulation slow. Here is how I use the Coolprop on my code below.
function y = matlabfunc(input1, input2, input3)
coder.extrinsic('py.CoolProp.CoolProp.HAPropsSI');
y = py.CoolProp.CoolProp.HAPropsSI('Vha','Hha',input1,'P',input2,'RH',input3);
end
Is there any alternative way to use Coolprop with faster speed? For example, calling Coolprop only one time before simulation starts, load it into workspace or somewhere, and use it.
Thanks!
0 comentarios
Respuestas (1)
Rasmita
el 16 de Feb. de 2023
Hi Seungho,
It is my understanding that, you want to run above mentioned function only one time before simulation.
For this, you can add this function content in 'startFcn' callback of the model.
For this, go to Model Properties -> Callback Tab -> startFcn.
It will be called once before the simulation starts.
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!