0
votes

I am running a simulink simulation using the fixed-step discrete solver. I've even specified the fixed-step size. I save some data via a "To Workspace" block (I've used the Scope to save to workspace as well with equivalent results). When I look at the time data in the object, the time is not monotonically increasing.

The time value is constant for 5-10 samples, then continues. Any ideas why this happens?

I took a screen shot of the Time vector. You can see it goes flat, then continues, then is flat. I expected a single line.

How I use the "To Workspace" blockThe Time plotted

I asked on the Mathworks site as well. I'll update both if I get an answer.

EDIT: I am working with Mathworks now too. They did show me how to visually inspect sample times. Navigate to Format > Sample Time Display > All. This will show all of the sample times in the simulation.

1
How did you get the time vector? Does your model have multiple sample rates?Navan
Is the block in an iterator or for-each system?MikeT
The time vector is from the object Simulink saved to the workspace. In this case, PWMOUT_FILT.time. My model had 2 sample rates. I tried removing the second rate, but it still didn't work.Eric Cope
@MikeT no, at least not explicitly. Its a control-feedback loop, which I simulate for a period of time. There is one algebraic loop due to the nature of the control feedback loop.Eric Cope

1 Answers

1
votes

This problem was caused, at least partly by the existence of algebraic loops. Since Simulink was recalculating the algebraic loops, the output was capturing these changes.

I was able to click the "minimize algebraic loop occurrences" in the

Configurate Parameters > Model Referencing 

and my loops were eliminated. This is a YMMV answer, but its the best I've found working with Mathworks support.