Sine wave block produces a triangular wave when the "pi" value is in the frequency.

5 ビュー (過去 30 日間)
Stephen Ofori
Stephen Ofori 2019 年 1 月 17 日
回答済み: Neelanshu 2024 年 1 月 2 日

回答 (1 件)

Neelanshu
Neelanshu 2024 年 1 月 2 日
Hi Stephen,
I understand from your query that you need help understanding why the sine wave output appears as a triangular wave when the frequency is set to 100*pi.
I assume you haven't altered any of the solver settings. The issue may be due to a larger time step, which results in the output of the "sine" block not being captured accurately. To rectify this:
  1. Navigate to the "Configuration Parameters" dialog. This can usually be done by clicking on a gear icon.
  2. In the "Configuration Parameters" dialog, locate the "Solver" tab.
  3. Within the "Solver" tab, find the "MaxStepSize" setting.
  4. Change the value of "MaxStepSize" to a smaller number, such as 1e-6.
  5. Apply the changes by clicking "OK" or "Apply" in the dialog.
While the simulation may take longer, this adjustment will provide more data points and, consequently, a smoother curve. Here is the obtained output:
Figure 1 Output of Sine Wave atMaxStepSize” 1e-6
Kindly refer to the following documentation to learn more about solver selection:
Hope this helps,
Regards,
Neelanshu

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by