Discrete Time Integrator does not integrate every time step
Show older comments
Hello,
I would like to integrate a function with the Discrete Time Integrator in Simulink. I have a signal, which I first squared in order to have it only positive. My simulation time is let´s say 0.1s and I´d like to integrate over time steps of 0.01s. Therefore, the sample time of the Discrete Time Integrator is also 0.01s.

In the scope you can see the input signal "error", which can be positive and negative, and the squared error (the gain only helps to make it all visible in the scope at one glimpse). The problem is the integrated signal. Why is there no jump at 0.04s and 0.07s? It is always like this, also with different input signals like a simple jump signal.

I need this to build the reward signal for a reinforcement learning agent. Therefore, I also have continuous states and cannot change the solver. I would be very pleased, if someone has a suggestion. Thank you.
3 Comments
Mathieu NOE
on 9 Feb 2024
hello
It would be interesting to know the sampling rate of the signal entering the integrator
Lucia Liedl
on 9 Feb 2024
Mathieu NOE
on 9 Feb 2024
ok
I see you modifed your simulink file , does it work better now ? how does your fourth trace look like ?
Accepted Answer
More Answers (0)
Categories
Find more on Circuit Envelope Simulation 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!







