Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a callback function to project() #236

Open
gustavdelius opened this issue Oct 5, 2021 · 1 comment
Open

Add a callback function to project() #236

gustavdelius opened this issue Oct 5, 2021 · 1 comment

Comments

@gustavdelius
Copy link
Member

This callback function will be called every time a simulation timestep is saved, i.e., at intervals of t_save. The callback function should be able to update the params object used in the simulation, so that one can implement a time-dependence in the rates, for example. This would be useful for experiments with time-dependent temperature for example. Currently this requires the user to write custom functions for all time-dependent rates. In future they could use the callback function to rescale the rate arrays in the params object and then let the standard mizer rate functions do their job.

@gustavdelius
Copy link
Member Author

Experimentally I decided to introduce two callback functions. save_callback is called only when a result is saved (i.e. at intervals of t_save), whereas step_callback is called at every time step (i.e. at intervals of dt). I'll see which one people will use more.
The code is in the callback branch of the mizer repository. So to test it out first do

remotes::install_github("sizespectrum/mizer@callback")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant