Running Simulation in MATLAB 2018b with different sample time

4 ビュー (過去 30 日間)
Ankit
Ankit 2023 年 3 月 15 日
回答済み: Animesh 2023 年 4 月 3 日
I have a *.fmu which runs at a time step of 0.1s and my overall model is running at a time step of 1ms. I have one working solution but looking for suggestions or better possibilities.
I used a rate transition block to convert the signal with a time step of 1 ms to 0.1s but the output response was with steps, then I used a transfer function to smoothen the output. As otherwise you see steps in your in output signal which is obvious.
Yellow is the signal with 1ms and blue is the signal after modifications. Is it possible to avoid these delays in the signal.
Looking forward for amazing ideas and improvements to this solution

回答 (1 件)

Animesh
Animesh 2023 年 4 月 3 日
Hi,
According to my understanding you want to convert a signal with sample time of 1ms to a signal with sample time of 0.1s. This can be done with the help of Rate Transition block. If you want to increase the accuracy of the output by implementing an algorithm like the one provided below.
Connect a delay block and unit delay blocks on either side of the Rate Transition block and set the value of delay length to 100 in delay block and Output port sample time to 0.1 in Rate Transition block.
The output will now be much more accurate than before.
The output of the above implementation is: -

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by