Skip to content

interpolate_simulation_result does not yield consistent timepoints #1451

@nijawa

Description

@nijawa

Bug description

The function mio::interpolate_simulation_result does not always yield the expected number of timepoints. If the simulation goes from 0 to days, interpolate_simulation_result does not always result in interpolated timepoints from 0 to days.

Version

Windows

To reproduce

  1. For me this was easiest seen in pycode\examples\simulation\sde_sirs_simple.py but any example should work really
  2. Set days = 5 and run, printed time points are 0, 1, 2, 3, 4, 5, expected 0, 1, 2, 3, 4, 5
  3. Set days = 4 and run, printed timepoints are 0, 1, 2, 3, expected 0, 1, 2, 3, 4

Relevant log output

Example results:

For t = 5:

Time             Susceptible      Infected         Recovered       
         0.00000       8900.00000        100.00000       1000.00000
         1.00000          1.60501       8355.46295       1642.93204
         2.00000          3.15233       7586.63010       2410.21757
         3.00000          5.47813       6887.20686       3107.31502
         4.00000          8.72828       6250.83330       3740.43843
         5.00000         13.44976       5719.91700       4266.63324

For t = 4

Time             Susceptible      Infected         Recovered       
         0.00000       8900.00000        100.00000       1000.00000
         1.00000          1.93701       8383.50728       1614.55571
         2.00000          2.54839       7612.70909       2384.74252
         3.00000          7.00763       6935.67804       3057.31434

Add any relevant information, e.g. used compiler, screenshots.

Checklist

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Metadata

Metadata

Assignees

Labels

class::bugBugs found in the softwareloc::backendThis issue concerns the C++ backend implementation.

Type

No type

Projects

Status

🏗 Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions