Skip to main content

Physics in Julia: combining Unitful.jl with DifferentialEquations.jl

H.2215 (Ferrer) | Day 2 | 12:20 - 12:35 | Speakers: Daria Klimaszewska

Physics in Julia: combining Unitful.jl with DifferentialEquations.jl
A picture of a talk at FOSDEM 2024
Open in browser
Get involved in the conversation!Join the chat

Notes

Abstract

Julia is a language particularly well suited for scientific computing - both thanks to inherent language features (including built-in CPU and GPU parallelism, math-oriented multi-dimensional array handling, and top notch performance), as well as thanks to an actively maintained ecosystem of packages. In this talk, I will focus on two of them: Unitful.jl and DifferentialEquations.jl, and on the challenges in using them in concert. Unitful.jl enables to programmatically express and JIT-compile-time verify the consistence of physical units across the user codebase - contributing to readability, testability and maintainability of the code. DifferentialEquations.jl - a flagship Julia numerical computation package - offers numerical solvers for modelling problems across a wide range of domains, including physics. However, as pointed out in several instances by the community, and as will be demonstrated in the talk, getting the two to work together requires attention. I will present a robust design pattern for combing them - leveraging the fundamental trait of physics, namely that physical dimensionality in mathematical models is solely originating from the constants. This solution benefits from Julia syntax, but is in general applicable to analogous tools in other JIT-compiled languages.

Attachments


Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.