Integrator problem

Hello,
My question is about Simulink. I designed two systems: - 1. The first system computes an output A which is continuously integrated. The result is stored in B.
- 2. The second system takes A as an entry ("from workspace" block). A is continuously integrated. The result is stored in B2.
I used the same solver (ode4), same time step (4Hz), same initial conditions (0) for the integrator in system 1 and 2. Therefore B and B2 should be strictly equal...but there are differences (up to 10%) between them and I don't understand why. Any idea?
MJ

 Accepted Answer

Guy Rouleau
Guy Rouleau on 2 Dec 2011

0 votes

This is probably because the input signal is different during minor steps. You can confirm that by trying:
- Try ode1 solver. This solver doe snot have minor time steps and should not be affected by that
- Try my central submissin "Minor Time Step Logging". This will allow you to observe the phenomenon.
To make the results match, you can try:
- Verify if the From Workspace is configured to interpolate or not. - Verify the sample time of all blocks in your model. Enable sample time colors. For a continuous system, everything should be black. Grey or Red can lead to the behavior you describe. - Note that minor time steps cannot be logged. Consequently when logging a continuous signal and reloading it, you loose information.

More Answers (1)

Maxime Journot
Maxime Journot on 5 Dec 2011

0 votes

Thanks a lot Mr Rouleau. I suspected the minor time steps of the RK4 but had no mean to monitor them. I used your "Minor Time Step Logging" Simulink block and the cause of the problem appeared obvious.

Categories

Find more on General Applications in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!