Cell arrays issues in Simscape component equations

조회 수: 2 (최근 30일)
Rocío Bonilla Villares
Rocío Bonilla Villares 2020년 10월 16일
답변: Juan Sagarduy 2020년 10월 31일
Hi,
I'm trying to create a non-ideal flowmeter (i.e. pressure drop different from 0) using simscape component block and modifying slightly the "hydraulic flow rate sensor" block's source data. For that, I've calculated the pressure losses outside and included them as an input (P_loss). However, when I run the model, it stays in the first moments and I have to stop it manually. Does anybody know the reason? I've also tried to use cell arrays indexing and value and cell2mat functions to equalize P_loss and p but matlab does not permit these actions in "equations blocks". Here is the .ssc file:
component nonideal_flowmeter
inputs
P_loss = {0, 'Pa'}; % P_loss:left
end
nodes
A = foundation.hydraulic.hydraulic; % A:left
B = foundation.hydraulic.hydraulic; % B:right
end
variables
q = {1e-3, 'm^3/s'}; % Flow rate
p = {0, 'Pa'}; % Pressure differential
end
branches
q : A.q -> B.q;
end
equations
p == A.p - B.p;
p == P_loss;
end
end

답변 (1개)

Juan Sagarduy
Juan Sagarduy 2020년 10월 31일
Hola Rocio
My advice is to use a hydraulic resistance instead and convert it to a flow sensor by having a low resistance And extracting the flow as output.
The problem you have is that Simscape struggles to comply with your ploss constraint while pa-pb diverges from this value in the hydraulic network.
Mucha suerte / Juan

카테고리

Help CenterFile Exchange에서 Simscape Fluids에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by