Cell arrays issues in Simscape component equations

1 Ansicht (letzte 30 Tage)
Rocío Bonilla Villares
Rocío Bonilla Villares am 16 Okt. 2020
Beantwortet: Juan Sagarduy am 31 Okt. 2020
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

Antworten (1)

Juan Sagarduy
Juan Sagarduy am 31 Okt. 2020
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

Kategorien

Mehr zu Simscape Fluids finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by