Skip to content

Portal

Track parameter changes in simulations

From this discourse thread

Changing parameters using traditional DiffEqCallbacks.jl with prob.ps[sym] = val in the middle of a simulation cannot be tracked.

From v10, ModelingToolkit.SymbolicDiscreteCallback can track changed parameters in a callback. See https://docs.sciml.ai/ModelingToolkit/dev/basics/Events/#save_discretes

For example,

ev = ModelingToolkit.SymbolicDiscreteCallback(
    [1.0] => [iStim ~ 5],
    discrete_parameters = iStim,
    iv = t)
@mtkcompile sys = ODESystem([D(x) ~ rhs, rhs ~ -x + v_istim, v_istim ~ iStim], t; discrete_events = [ev])
prob = ODEProblem(sys, [], (0, 10.0))
@time sol = solve(prob)

Publish Julian Jupyter notebooks

This post will demonstrate my template repositoryabout

  • How to use Docker to build a Julian Jupyter notebooks runtime environment.
  • How to use GitHub actions to execute notebooks in the docker container in parallel.
  • How to use jupyter-book to publish notebooks automatically when changes are pushed to GitHub.