Julia array tips
Convert vector of vector to matrix
Use the stack function.
Convert linear index to 2D indices
Use CartesianIndices((nrow, ncol))
1.
Use the stack function.
Use CartesianIndices((nrow, ncol))
1.
Some notes of Tom Kwong's book Hands on Design patterns in Julia.
When your Julia codebase grows larger, you might want to organize it into modules and packages.
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,
This post will demonstrate my template repositoryabout
jupyter-book
to publish notebooks automatically when changes are pushed to GitHub.Some tips about JuliaPy/PyPlot.jl, the matplotlib
(Python) visualization library for Julia. See also docs for matplotlib since PyPlot.jl
largely follows matplotlib
's API.
In the VSCode plot panel and fredrikekre/Literate.jl notebooks, PNG images are generally smaller than SVG ones. To force plots to be shown as PNG images, you can use tkf/DisplayAs.jl to show objects in a chosen MIME type.
f = ODEFunction(sys)
could be useful in plotting vector fields.