Simulink - Triangular wave form simulation

6 次查看(过去 30 天)
Hi, I'm trying to generate simple triangular wave and connect the output to a scope.
I used the repeating sequence block and the parameters were set as bellow.
I assume this is something to do with simulation settings.(Continuous function, ODE45)
Furthermore I recieved following warning:Warning: The model 'test22' does not have continuous states, hence Simulink is using the solver 'VariableStepDiscrete' instead of solver 'ode45'. You can disable this diagnostic by explicitly specifying a discrete solver in the solver tab of the Configuration Parameters dialog, or by setting the 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics tab of the Configuration Parameters dialog
Any ideas to fix? thanks

采纳的回答

Rashmil Dahanayake
Rashmil Dahanayake 2013-11-28
I got it working. As suggested updated to fixed step (1/(1000*20)) and selected the solver to discrete.
thanks

更多回答(1 个)

venkat
venkat 2013-11-28
You need to select correct solver configuration. Take solver type Fixed step and make sure the fixed step size is relatively small compared to the repeating sequence signal time period for better accuracy (Since it takes more steps to construct the signal)
Check this
Change solver type to Fixed Step and Fixed -step size to 1/1000/20
For repeating sequence block Take time values as [1/1000/4 1/1000/2 3/1000/4 1/1000]
output values as [0 1 0 -1 0]
Here i am generating a triangular waveform whose frequency is 1000Hz and solver takes 20 steps to constuct each cycle of the waveform.

类别

Help CenterFile Exchange 中查找有关 Configure Simulation Conditions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by