Skip to content

Repeatibility issue: Torque solver not cleaning properly #260

@DeSanz

Description

@DeSanz

Hello, I have been doing some repeatability tests and just found that there seems to be an issue with the RK45 solver (and probably other ones) not flushing its memory when, for example, a new m is defined.

What I see is that if you run the same simulation in a loop like this one:

for p:=0; p<12; p++{
    t = 0
    m = Uniform(-1,0.2,0)
    run(1e-9)
}

different results are obtained for each loop.

It seems to be an issue of the solver not flushing the torques in the memory because I can do this to force a flush:

for p:=0; p<12; p++{
    m = Uniform(-1,0.2,0)
    SetSolver(1)
    steps(10)
    SetSolver(5)
    t = 0
    m = Uniform(-1,0.2,0)
    run(1e-9)
}

and then (almost) fully reproducible results are obtained.

This looks to me like a serious bug, because intuitively one should not have to manually flush the torque buffer when changing m and this can lead to non-reproducibility of results when people do e.g. parameter scans using a loop.

I attach an example file with a complete script showing the issue.
Fix_solver_buffer.txt

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions