Simulink ode1 fixed time step solver produces unexpected (wrong) results
Show older comments
In one of my models I have an integrator. This integrator integrates a fast varying signal. I set the solver type to fixed time (1.25us) step ode1 (Euler).
To solve ODE
euler method uses the following equation
(Eqaution 1)according to the simulink help https://de.mathworks.com/help/simulink/slref/integrator.html The integrator block is defined as
u(t) is the input to the integrator, y(t) is the output and x(t) is the state.
Since
we can approximate the output of the integrator with the following equation:
(Equation 2)In our case h=1.25us.
I have recorded the input (top of the picture) and output (bottom of the picture) of the integrator (see follwoing figure). The input changes rapidly from a value slightly higher than zero to a value much lower than zero (rapid negative changes).

I have marked two points in time. I would expect the output of the integrator to decrease at the second marked time step. This is because the input at time step 1 is negative (using equation 1). However, the output does not decrease until a further time step. It appears that there is an additional delay.
Does anyone know why this is the case? Is this a bug in Simulink or am I missing something?
Answers (0)
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!