How to vary offset during simulation

4 ビュー (過去 30 日間)
Luiz Souza
Luiz Souza 2020 年 4 月 17 日
編集済み: Fangjun Jiang 2020 年 4 月 20 日
Hello, i need to vary the offset of a 60hz 180V sinewave during the simulation.
How can i do that? I am trying to use Step and Controlled voltage source, but it's not working.
Any ideas?
Thanks
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 4 月 17 日
what offset, phase?
Luiz Souza
Luiz Souza 2020 年 4 月 17 日
編集済み: Luiz Souza 2020 年 4 月 17 日
Well, i need to vary the offset to:
0V->100V->50V->-20V during the simulation
Same phase

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

回答 (2 件)

Jesús Zambrano
Jesús Zambrano 2020 年 4 月 18 日
Hi Luiz,
You can include a slider (fomr the section Dashboard in the Library) in the Simulink model, and link it to the SineWave bias. Then you can change the bias during the simulation by moving the slider.
  2 件のコメント
Luiz Souza
Luiz Souza 2020 年 4 月 19 日
編集済み: Luiz Souza 2020 年 4 月 19 日
Ok, i'm gonna try, thank you!
But is there a way to vary the offset "automatically"? I need to do it in a determinate time.
Or maybe a block that pauses the simulation when it reaches determinate time.
Thanks
Jesús Zambrano
Jesús Zambrano 2020 年 4 月 19 日
You can include a MATLAB function block with a piece of code to do this change in the time you want. See the screenshot below, where I use the 'Clock' block to ge tthe current simulation time, and when time is equal to 20, the bias is set to 10.
Another good option is to do it with simple blocks. Please read the following post with an example:

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


Fangjun Jiang
Fangjun Jiang 2020 年 4 月 20 日
編集済み: Fangjun Jiang 2020 年 4 月 20 日
So you need to generate V*sin(2*pi*f*t).
There is a block for sin(). Use "Repeating Sequence" or "Repeating Sequence Interpolated" from Simulink Source library where you can specify any time-value pairs.

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by