필터 지우기
필터 지우기

Extracting the intermediate solution variables in simscape

조회 수: 2 (최근 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 CenterFile Exchange에서 Upgrading 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