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

ODE Status Monitoring #40

Closed
delta-pi-1701 opened this issue Jan 31, 2015 · 6 comments · Fixed by #212
Closed

ODE Status Monitoring #40

delta-pi-1701 opened this issue Jan 31, 2015 · 6 comments · Fixed by #212

Comments

@delta-pi-1701
Copy link

In Matlab we have 'odeprint' which is very handy in monitoring the Progress of ode, is there any equivalent thing for Sundials-Julia?

@ViralBShah
Copy link
Contributor

I am not sure if there is anything at the moment. However, in the API, I believe it should not be difficult to provide a way to register a post-processing function that gets called after evaluation at every time step.

@delta-pi-1701
Copy link
Author

odeprint is really very handy in monitoring the status of ode solver, when sizeof(y_dot) is large and solver takes whole lot of time to solve.

@ViralBShah
Copy link
Contributor

It would be great if you can create a PR. That will be the fastest way to get the functionality in. Otherwise, I am sure one of the regular Sundials contributors will get around to it.

@acroy
Copy link
Contributor

acroy commented Jan 31, 2015

I don't know if there is anything related in the Sundials API, but we could certainly call some monitoring function in our high-level functions cvode and idasol. For example, we could have

abstract ProgressMonitor

# called to initialize progress monitor, eg resetting step counter
function init!(p::ProgressMonitor, tspan, y0)
end

# called after each successful step
function step_done(p::ProgressMonitor, t, y0)
end

# default monitor which does nothing
type DoNothing <: ProgressMonitor
end

# simple monitor which prints each step with the result
type PrintProgress <: ProgressMonitor
end

function step_done(p::PrintProgress, t, y0)
  println("@t=$(t): $(y0)")   # this should give some nicely formatted output
end

And then we make cvode and idasol taking an additional argument of type ProgressMonitor with the default DoNothing(). Users could implement more sophisticated monitors using a progress bar or such.

@ChrisRackauckas
Copy link
Member

This will be fixed with Julia v1.0. We'll plug into the base logging system which allows for this information. It separates the information from the display, so from there supporting Juno or console displays would simply be about someone else building a package which supports it (and Juno is already commited to changing their progress displays to this)

ChrisRackauckas added a commit that referenced this issue May 18, 2019
ChrisRackauckas added a commit that referenced this issue May 18, 2019
@ChrisRackauckas
Copy link
Member

The common interface progress bar support has been added, so sol = solve(prob,CVODE_BDF(),progress=true) etc. all works.

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

Successfully merging a pull request may close this issue.

4 participants