Set solver trace level
strace
level
i
strace
causes
the solver to display diagnostic information in the MATLAB® Command
Window, depending on the value of level
level
. Values
are 0
(no information) or 1
(maximum
information about time steps, integration steps, zero crossings, and
solver resets).
i
is the short form of the command.
Display maximum information about a simulation for the model vdp
using
the Simulink® debugger.
In the MATLAB Command Window, enter:
sldebug 'vdp'
The MATLAB command prompt >> changes to the Simulink debugger prompt (sldebug @0): >>.
Get information about the notation. Enter:
help time
The MATLAB Command Window displays:
Time is displayed as: TM = <time while in MajorTimeStep> Tm = <time while in MinorTimeStep> Tr = <time while in solver reset> Tz = <time at or just after zero crossing> TzL = <time while in major step just before (at left post of) zero crossing> TzR = <time while in major step at or just after (at right post of) zero crossing> Ts = <time of successful integration step> Tf = <time of failed integration step> Tn = <time while in Newton iteration> (when using implicit solvers) Tj = <time during Jacobian evaluation> (when using implicit solvers) Step size is displayed as: Hm = <step size at the start of solver phase> Hs = <successful integration step size> Hf = <failed integration step size> Hn = <step size during Newton iteration> (when using implicit solvers) Hz = <value of 'TM - TzL' during zero crossing search> Iz = <value of 'Tz - TzL' during zero crossing search>
Set trace to display all information. Enter:
strace 1
When diagnostic tracing is on, the debugger displays the start of major and minor time steps.
[TM = 13.21072088374186 ] Start of Major Time Step [Tm = 13.21072088374186 ] Start of Minor Time Step
The debugger displays integration information. This information includes the time step of the integration method, step size of the integration method, outcome of the integration step, normalized error, and index of the state.
[Tm = 13.21072088374186 ] [H = 0.2751116230148764 ] Begin Integration Step [Tf = 13.48583250675674 ] [Hf = 0.2751116230148764 ] Fail [Er = 1.0404e+000] [Ix = 1] [Tm = 13.21072088374186 ] [H = 0.2183536061326544 ] Retry [Ts = 13.42907448987452 ] [Hs = 0.2183536061326539 ] Pass [Er = 2.8856e-001] [Ix = 1]
For zero crossings, the debugger displays information about the iterative search algorithm when the zero crossing occurred. This information includes the time step of the zero crossing, step size of the zero crossing detection algorithm, length of the time interval bracketing the zero crossing, and a flag denoting the rising or falling direction of the zero crossing.
[Tz = 3.615333333333301 ] Detected 1 Zero Crossing Event 0[F] Begin iterative search to bracket zero crossing event [Tz = 3.621111157580072 ] [Hz = 0.005777824246771424 ] [Iz = 4.2222e-003] 0[F] [Tz = 3.621116982080098 ] [Hz = 0.005783648746797265 ] [Iz = 4.2164e-003] 0[F] [Tz = 3.621116987943544 ] [Hz = 0.005783654610242994 ] [Iz = 4.2163e-003] 0[F] [Tz = 3.621116987943544 ] [Hz = 0.005783654610242994 ] [Iz = 1.1804e-011] 0[F] [Tz = 3.621116987949452 ] [Hz = 0.005783654616151157 ] [Iz = 5.8962e-012] 0[F] [Tz = 3.621116987949452 ] [Hz = 0.005783654616151157 ] [Iz = 5.1514e-014] 0[F] End iterative search to bracket zero crossing event
When solver resets occur, the debugger displays the time at which the solver was reset.
[Tr = 6.246905153573676 ] Process Solver Reset [Tr = 6.246905153573676 ] Reset Zero Crossing Cache [Tr = 6.246905153573676 ] Reset Derivative Cache