You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the System trait took an unmutable reference to self:
/// Trait needed to be implemented by the user.pubtraitSystem<V>{fnsystem(&self,x:f64,y:&V,dy:&mutV);}
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 the System 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
The text was updated successfully, but these errors were encountered:
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.
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 the
System
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
The text was updated successfully, but these errors were encountered: