Extracting the intermediate solution variables in simscape

3 ビュー (過去 30 日間)
Neeli Sai Krishna
Neeli Sai Krishna 2022 年 3 月 23 日
回答済み: Yifeng Tang 2022 年 6 月 29 日
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??

回答 (1 件)

Yifeng Tang
Yifeng Tang 2022 年 6 月 29 日
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
end
% 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
end
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

カテゴリ

Help Center および File ExchangeUpgrading Hydraulic Models to Use Isothermal Liquid Blocks についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by