Mismatch result in comparison operation in Simulink
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I am doing comparision operation of two signals as shown fig 1. In one case, sine and triangular signals are compared whose result is shown in fig 2 and in other case sine, triangular signals are phase shifted by 180 deg, performed same operation as shown in fig3. Ideally, both results should be complement to each other , but observing spikes (shown in fig 3). What can be the reason for this ?. How to achieve ideal complementary responses ?.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1578416/image.png)
Fig 1: Simulink circuit of comparision of two signals
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1578421/image.png)
Fig 2: Sine, Triangular comparision and its result
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1578426/image.png)
Fig 3: Sine, Triangular comparision with 180 deg phase shift and its result.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1578431/image.png)
Simulation solver settings
0 个评论
采纳的回答
Ganesh
2023-12-29
编辑:Ganesh
2023-12-29
I understand that you expect a flat line, complimenting Fig. 1.
However, the response generated seems to be consistent with the expected results. At T=0.005, the value of Sine Wave is equal to that of the Triangular Wave, and as you have allowed the parameter to be "less than or equal to", there is a spike.
You can try changing the block to be strictly lower than if you require a graph that compliments.
To help you understand, you could try to change the relational block to "greater than or equal to" with 0 phase and you will notice a spike in that figure too.
Hope this helps!
0 个评论
更多回答(1 个)
Sulaymon Eshkabilov
2023-12-29
The problem is caused by sine wave generator.
Try to tighten the sample time, e.g. 1e-9.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Power Systems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!