How to store all the sequential signals generated during the Simscape simulation in Simulink and access those signals inside the function block?

1 回表示 (過去 30 日間)
I have a Simscape-based simulation model, and my goal is to integrate a Reinforcement Learning agent that controls the existing inverters in my model. To achieve this, the RL agent requires measurement signals from time (t-k) to t, where k represents a sliding window of a particular size. Unfortunately, I am encountering issues in implementing this functionality to store the sequential measurements and access the required window of measurements to provide them as observations to the RL agent. I would be grateful for any assistance in this matter.
  2 件のコメント
Bipin Paudel
Bipin Paudel 2023 年 4 月 24 日
Generally, the value of k can range from 20. Can we use a single delay block for this value of k? I am under the impression that if I use a delay block, I have to use k different delay blocks. Are there any other solutions?

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2023 年 4 月 24 日
  2 件のコメント
Bipin Paudel
Bipin Paudel 2023 年 4 月 24 日
I have a Simscape-based model with a solver as ode1 (Euler) in model configurations. I got an error while using Buffer that says, "all sample times must be discrete. No continuous or constant sample times are allowed". However, I cannot change my solver parameter to be discrete because, in that case, the simulation will not run.
Fangjun Jiang
Fangjun Jiang 2023 年 4 月 24 日
編集済み: Fangjun Jiang 2023 年 4 月 24 日
I did the following on the "f14" example model, which runs on variable-step ode45.
Insert a 'Signal Specification' block between the signal and the Buffer block and specify a sample time.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDiscontinuities についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by