Coding project
Sph Sym SM
Interactive nonlinear ODE solver (C++, ImGui / ImPlot) supplementing my paper Static spherically symmetric electroweak models with fermions. Built on a custom math library written from scratch.
| stack | C++20numerical solversImGuiImPlotCMake |
|---|---|
| repo | msobak/SphSymSM |

Overview
Interactive solver in C++ for the coupled nonlinear ODE system arising from the spherically symmetric Standard Model of particle physics coupled to gravity, developed as part of my postdoctoral research at the University of Vienna, in particular in relation to the paper Static spherically symmetric electroweak models with fermions.
Technical highlights
- Custom templated math library written from scratch.
- Uses
variants(C++17) for type-safe unions describing different coordinate systems. - Uses
concepts(C++20) to correctly constrain template types. - GUI built with ImGui / ImPlot.
- CMake build system.
Implementation
General
The project is built using the CMake build system. All of the third-party dependencies are fetched automatically at the CMake configuration step.
Structure
The project almost entirely consists of header-only modules, with a single main.cpp file that constructs the App and runs it.
The modules are Math, Model, GUI, each wrapped in its own namespace.
-
The
Mathnamespace is a generic math library implementing complex numbers, tensors and an adaptive RKF45 integrator, all templated on an arbitrary floating point type and dimension. In particular, it only uses fixed-size stack-allocated memory. Template parameters are constrained usingconcepts. -
The
Modelnamespace provides implementations for the different fields appearing in the model, and also implements all the non-linear ODEs using these structures as well as a solver for them using theMathlibrary. -
The
GUInamespace sets up the interface using ImGui and allows the user to choose initial data for the ODE problem in real time. Implements runtime switching between different coordinate systems, floating point types and integrator tolerances, as well as various options for the plots. Also allows for interaction with CSV files containing saved initial data.
