Cell arrays issues in Simscape component equations

1 visualizzazione (ultimi 30 giorni)
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

Risposte (1)

Juan Sagarduy
Juan Sagarduy il 31 Ott 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

Categorie

Scopri di più su Simscape Fluids in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by