Create New Simulation
Using DPsim for a new simulation scenario.
Here, we will show the implementation of a new simulation scenario defined in C++, which is using DPsim as a library.
Directory Structure
In the end, your directory structure should look like as follows:
my-project
|- CMakeLists.txt
|- source
|- my-scenario.cpp
|- dpsim (as submodule)
CMake File
Your CMakeLists.txt could look like this:
cmake_minimum_required(VERSION 3.14)
project(my-project CXX)
add_subdirectory(dpsim)
add_executable(my-scenario source/my-scenario.cpp)
target_link_libraries(my-scenario dpsim)
Build the Project
The build process is similar to the one of DPsim:
cd my-project
mkdir build && cd build
cmake ..
make my-scenario
Last modified 24.11.2026: build(deps): bump source-map-js from 1.2.1 to 1.2.4 in /docs/hugo (6a9ae3f)