|
George,
> 1) is there any way to access the current step size of a simulation done in Simulink when a variable-step integrator is used? I would like to use this inside an m function and not for debugging purposes, i.e. I cannot use something like strace.
Feeding the clock block into a memory block then taking the difference will tell you what the step size currently being evaluated is.
This could then be fed into your function as an input.
Of course that does you no good if you need to know the step size before any blocks get updated.
> 2) is there any flag that changes value when simulink moves between the different stages of the loop iteration when variable-step integrators are used? In particular, can I find out whether Simulink computes the model outputs or tries to determine the next step-size?
If you write an m-code S-Function rather than a straight MATLAB function (called from the MATLAB Function block) then yes, Simulink passes the block information on what it is currently doing (i.e. updating states, updating outputs, determining the next sample time).
However, that information is done on a block by block basis.
I don't believe there's a way to determine this information on a model wide basis.
Phil.
|