The sine wave comes out as flat as flat line .
10 views (last 30 days)
Show older comments
When I do the sine wave to scope normally its ok but when i put it into a system it come out as a flat line and the system output is also not the right one .

3 Comments
VBBV
on 22 Jun 2025
However, it should not affect sine output in scope block which is some what kinda strange. As Paul said, it should be sinusoidal but appears as straight line due to large output values from other signals.
You can test it by plotting the output only between 18s and 19s.
Answers (1)
Paul
on 21 Jun 2025
The yellow line likely isn't flat, it just looks that way becuase the y-axis is scaled by 10^15. Try sending the that signal to its own scope.
As for the instability itself, maybe it's being caused by the -1 gain block on the feedback line at the top of the diagram, that ultimately is input to the negative port of the sum block, thereby causing a positive feedback loop. Just a guess.
3 Comments
Paul
on 22 Jun 2025
I suspect that the sine wave looks like that in the scope because the solver steps are too large relative to the period of the sine wave.
If it's important that the output of the Sine Wave look sinusoidal in that Scope, then go to Modeling -> Model Settings -> Solver->Solver Details.
If using a fixed-step solver, set the Fixed Step Size to be about 10x smaller than the period of the Sine Wave.
If using a variable-step solver, set the Max Step Size to be about 10x smaller than the period of the Sine Wave.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
