Skip to content

mmaharebi/symulation

Repository files navigation

Symulation

Symulation is a native C++ simulation playground for interactive physics and computational engineering demos. It brings multiple numerical experiments into one desktop application, combining custom visualization, parameter exploration, and solver-focused workflows behind a single UI shell.

Built with raylib, ImGui, ImPlot, ImPlot3D, Eigen, and CGAL, the project currently spans mechanics and electromagnetics, from time-domain motion studies to field visualization and finite-element eigenmode analysis.

A compact simulation lab for exploring how different numerical models behave, how they are parameterized, and how their results can be inspected visually.

Symulation hero

Why Symulation?

The name is intentional: Symulation combines simulation with symbolic, visual, and systems-oriented exploration. The project is meant to feel like a small lab where numerical models can be inspected, adjusted, and compared directly.

Current Modules

Module Focus Documentation
BCC Spring-Mass Lattice Interactive 3D body-centered cubic spring-mass lattice with local impulses, damping, and integration controls. Technical note, GIF
Hertzian Dipole Animated electric and magnetic field visualization for an idealized dipole. Technical note, GIF
Linear Dipole (MoM + Pocklington) Thin-wire dipole current solve with impedance, near/far field, and directivity views. Technical note, GIF
Double Pendulum Chaotic two-link pendulum motion with damping, trails, and direct manipulation. Technical note, GIF
Three-Body Gravity Softened three-body gravity demo with trails, velocity vectors, and energy drift display. Technical note, GIF
Helmholtz FEM (Bezier, mixed BC) Editable Bezier-domain FEM eigenmode solve with mixed boundary conditions and 2D/3D plots. Technical note, GIF

Features

  • Single-window native GUI with a shared runtime shell for multiple simulations.
  • Modular simulation architecture with one active solver/scene loaded at a time.
  • Interactive controls for physical parameters, solver settings, and visualization modes.
  • Mixed 2D and 3D rendering paths for trajectories, fields, meshes, and modal structure.
  • Current simulations include spring-mass lattices, dipole radiation models, chaotic mechanics, gravitational dynamics, and Helmholtz FEM modes.

Technical Highlights

  • C++17 application shell built on raylib, rlImGui, ImGui, ImPlot, and ImPlot3D.
  • Shared simulation interface for registering, activating, resetting, updating, and drawing modules.
  • Custom lightweight 3D viewport helpers for ImGui draw-list based simulation views.
  • Numerical modules using direct integration, dense complex linear solves, CGAL triangulation, and Eigen eigenvalue routines.
  • GPU backend reporting is currently a CPU fallback/stub; CUDA support is not implemented yet.

Requirements

  • CMake 3.25 or newer.
  • A C++17 compiler.
  • A working desktop OpenGL setup on Linux.
  • Git submodules for GUI dependencies: raylib, imgui, implot, implot3d, and rlImGui.
  • System packages for Eigen and CGAL.

On Ubuntu/Debian:

sudo apt install build-essential cmake git libeigen3-dev libcgal-dev xorg-dev libgl1-mesa-dev

Build

Clone with submodules, then build from the repository root.

git clone --recurse-submodules https://github.com/mmaharebi/symulation.git
cd symulation
cmake -S . -B build-local
cmake --build build-local -j

The executable is produced at build-local/symulation.

Run

./build-local/symulation

Layout

  • main.cpp starts the application.
  • src/sym/application.cpp owns the main ImGui shell and simulation registration.
  • src/sym/simulation_manager.cpp manages simulation lifetime and activation.
  • src/sym/simulations/ contains the individual simulation modules.

Usage

  • Open the Simulations menu to switch the active module.
  • Use the View menu or side panel to toggle helper windows.
  • Use each simulation's control panel to tune its parameters.

Notes

  • The GUI dependencies live in Git submodules. If they are missing, run git submodule update --init --recursive.
  • Eigen and CGAL are expected from system packages, though a local eigen/ checkout is still supported for development.
  • GIFs under docs/media/ are part of the documentation and are intended to be committed.
  • GPU reporting is currently a CPU fallback/stub; CUDA support is not implemented yet.
  • build-local is the preferred out-of-tree build directory for day-to-day work.

License

This project is released under the MIT License. See LICENSE for details.

About

Interactive C++ simulation lab for physics, electromagnetics, and numerical visualization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors