Cell arrays issues in Simscape component equations

2 visualizaciones (últimos 30 días)
Rocío Bonilla Villares
Rocío Bonilla Villares el 16 de Oct. de 2020
Respondida: Juan Sagarduy el 31 de Oct. de 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

Respuestas (1)

Juan Sagarduy
Juan Sagarduy el 31 de Oct. de 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

Categorías

Más información sobre Simscape Fluids en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by