How change simscape simulation time from seconds (sec.) to hours (h)

조회 수: 6 (최근 30일)
Michael Feichtinger
Michael Feichtinger 2021년 7월 15일
답변: Yifeng Tang 2022년 8월 3일
Hi everyone,
I am modelling a gas network (Reservoir, mashed network, multiple consumption units with real data) in the Gas Domain of Simscape. The main subject is to get a deeper understanding of the network's conditions (pressure, velocity in pipes et.) in case of errors et.
Dataset with respect to ~ 60 consumption units are provided in unit/interval length of [kg * hour-1] for one year (8760 rows). As I know, the default simulation time is [sec], so I convert all consumption data with the factor 3600 [sec-1] and mapped it to a condrolled mass flow rate units.
The model is working with the deascc with variable-step solver, however, what are the implications in terms of simulation results to convert from [h] in [s] like this?
  • How should i deal with the data - resampling 8760 [h] in [sec] and then backfill isn't really a option because you get 8600*60*60 (rows)?
  • How with simulation time configurations (sample time)?
consumption unit in with kg/s:
Dataframe:
Thank you in advance for any help you can provide.
M.
  댓글 수: 3
Michael Feichtinger
Michael Feichtinger 2021년 8월 3일
Hi Tang, what do you mean with "Multiply the time values in hr by 3600?"
I actually did the opposite of multiplying.
e.g. i divided all [kg/h] values with 3600 to get [kg/s] and then simulate for 8760 s, and converte the result with * 3600 to [kg/h] again.
Yifeng Tang
Yifeng Tang 2021년 8월 4일
You are right, the quantities in say kg/h needs to be divided by 3600 to get kg/s. At the same time, I think you may convert your datenum or datetime data to seconds, and use that time array in seconds in the "from workspace" block. The values between each time value will be linearly interpolated I believe.

댓글을 달려면 로그인하십시오.

답변 (1개)

Yifeng Tang
Yifeng Tang 2022년 8월 3일
Just to summarize the thread of comments, so the question appears as "Answered".
The easiset way is to multiply the duration of time by 3600. At the same time, any "per time" quantity needs to be scaled accordingly. If Simulink-PS or Simscape units are used, the units may be set as "/hr" so manual conversion won't be necessary.
In addition, the seconds command can convert duration from table imports to seconds, so it's easier to set up the simulation.

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by