I am using IPython widgets to create an interactive plot that will help students understand the determinants of accuracy of various ODE solvers available in scipy.integrate.ode
. However, I can't seem to find much in the way of documentation on the various types of widgets and their keyword args.
from IPython.html.widgets import *
@interact(h=FloatTextWidget(), atol=FloatTextWidget(), rtol=FloatTextWidget(),
k=IndexSliderWidget(), integrator=TextWidget()))
def plot_lotka_volterra_residuals(h=1e-1, atol=1e-3, rtol=1e-3, k=3, integrator='dopri5'):
"""Plots residuals of the Lotka-Volterra system."""
# make a pretty plot!
In particular, I would like to know how to set a default value for each widget.
The declaration of the widgets takes a value
keyword argument; you may be able to adapt examples such as this, or try Rossant's detailed Europy tutorial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With