How to vary offset during simulation
이전 댓글 표시
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
2020년 4월 17일
what offset, phase?
Luiz Souza
2020년 4월 17일
편집: Luiz Souza
2020년 4월 17일
답변 (2개)
Jesús Zambrano
2020년 4월 18일
1 개 추천
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
2020년 4월 19일
편집: Luiz Souza
2020년 4월 19일
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
2020년 4월 20일
편집: Fangjun Jiang
2020년 4월 20일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Block Libraries에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!