Borrar filtros
Borrar filtros

Extracting the intermediate solution variables in simscape

6 visualizaciones (últimos 30 días)
Neeli Sai Krishna
Neeli Sai Krishna el 23 de Mzo. de 2022
Respondida: Yifeng Tang el 29 de Jun. de 2022
I am using hydraulic resistive tube in my piping network. Which tube element incorporates elevation difference between its ends (like if its inclined or vertical pipes). I want to account this using aggregate equivalent length option in resistive tube element. Is it possible? If so how can I?
If I know the friction factor which it calculates during the solution process (available in source code), I can use it in other mathematial operation blocks. But cnt find how to check this value it calculates during the solution process.
Can anyone share how to do this??

Respuestas (1)

Yifeng Tang
Yifeng Tang el 29 de Jun. de 2022
Two quick ways I can think of:
  1. Add a variable. In equations, add "new_var == intermediate_var;".
  2. Move code out of "let ... in ..." and use the "intermediate" syntax. Below is an example from the pipe block in the isothermal liquid domain:
intermediates (Access = private, ExternalAccess = none)
p_A = A.p; % Pressure at port A
p_B = B.p; % Pressure at port B
% For logging
intermediates (Access = private)
rho_I = foundation.isothermal_liquid.mixture_density(p_I, ...
A.bulk_modulus_model, A.air_dissolution_model, A.rho_L_atm, A.beta_L_atm, A.beta_gain, ...
A.air_fraction, A.rho_g_atm, A.polytropic_index, A.p_atm, A.p_crit, A.p_min); % Density of liquid volume
The variables in the second section of the "intermediates" should show up in the simlog and Simscape Results Explorer. More help on this syntax here:
And speaking of the isothermal liquid (IL) domain, use IL instead of the hydraulic domain whenever you can


Más información sobre Upgrading Hydraulic Models to Use Isothermal Liquid Blocks en Help Center y File Exchange.




Community Treasure Hunt

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

Start Hunting!

Translated by