- Add a variable. In equations, add "new_var == intermediate_var;".
- Move code out of "let ... in ..." and use the "intermediate" syntax. Below is an example from the pipe block in the isothermal liquid domain:
Extracting the intermediate solution variables in simscape
조회 수: 2 (최근 30일)
이전 댓글 표시
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??
댓글 수: 0
답변 (1개)
Yifeng Tang
2022년 6월 29일
Two quick ways I can think of:
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Upgrading Hydraulic Models to Use Isothermal Liquid Blocks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!