Open thdhondt opened 1 year ago
Hi Thomas,
Thanks for reaching out, it's always great to hear from people using the crate!
As for your question, there's no specific reason why an immutable reference is used as opposed to a mutable one. I didn't encounter your use case when I was developing the crate for my projects and hence didn't cover it. What you can try is fork the crate and modify the signature of the method to accept a mutable reference.
Best,
This is what I did (https://github.com/thdhondt/ode-solvers/tree/Solout-for-other-solvers-and-allocation-reduction) and it works perfectly.
I did start from another fork, however, as I also needed the solout
method for the Rk4
solver.
Hello @thdhondt, thanks for your solution. It helps me for my system. It has a couple of equations those dont not figured as y' = f(x) form. But it changes over time. It's be wonderful if this fork will be merged as soon as possible.
Hi @srenevey ,
First of all, thanks a lot for the work you have put into this crate! It has been really helpful for getting started with numerical simulation using Rust.
I was wondering if there was a specific reason why the
system
method in theSystem
trait took an unmutable reference toself
:The system I am currently simulating has a small controller built-in. It is a simple state machine that transitions based on the values inside the
State
vector. Unfortunately, I am unable to store this data inside my object implementing theSystem
trait, as I can't modify it via the&self
reference.I am currently a beginner in Rust, so I'm mostly interested in understanding if this was an explicit design decision or just a use case that was not yet covered :).
Thanks in advance for your assistance.
Thomas