Cell arrays issues in Simscape component equations
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Juan Sagarduy
le 31 Oct 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
0 commentaires
Voir également
Catégories
En savoir plus sur Simscape Fluids dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!