필터 지우기
필터 지우기

How can I change Cd parameter of a local restriction for Gas Systems during a simulation run?

조회 수: 1 (최근 30일)
I am working on a pipe system in the Gas System environment offered in Simscape. I would like to change, as the simulation is running, the Discharge Coefficient (Cd) parameter, in the Variable Local Restriction Block. I have tried to set in my model the default parameter behavior as "Tunable": set_param('MyModel','DefaultParameterBehavior','Tunable').
In the Variable Local Restriction Mask, I change the option from "Compile-Time" to "Run-Time", and then set the Cd parameter for example to 0.4 by using set_param:
set_param('MyModel/PipeSystem/Valve1','Cd','0.4')
However the simulations outputs during the run are unaffected.
I checked the parameter readability by typing in the command window:
para=get_param('MyModel/PipeSystem/Valve1','ObjectParameters')
And saw that in the field "Cd" under 'Attributes' there is 'read-write' and 'link-istance'. So it appears that the parameter should be updated without having to recompile the model.
Any suggestion on what I might be overlooking?
Thanks in advance!
Sam

답변 (0개)

카테고리

Help CenterFile Exchange에서 Gas Models에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by