Commit d54be5e0 authored by Markus Mirz's avatar Markus Mirz
Browse files

Add cps files to dpsim repo


Former-commit-id: f1915347
parent 1e5d2a4e
[submodule "Dependencies/libcps"]
path = Dependencies/libcps
url = ../cpowersystems.git
[submodule "Examples/CIM/grid-data"]
path = Examples/CIM/grid-data
url = ../../grid-data/cim-grid-data.git
......
set(CIMPP_DIR Dependencies/libcimpp)
option(WITH_CIM_SUBMODULE "Build with CIMpp as submodule" OFF)
set(CIM_VERSION "16v29a")
set(USE_CIM_VERSION "IEC61970_16v29a")
include(FindPackageHandleStandardArgs)
if(WIN32 AND NOT WITH_CIM_SUBMODULE)
set(CIMPP_INCLUDE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/${CIMPP_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/${CIMPP_DIR}/${CIM_VERSION}
)
find_library(CIMPP_LIBRARY
NAMES libcimpp.lib
PATH_SUFFIXES
Debug
Release
PATHS
${CMAKE_CURRENT_BINARY_DIR}/${CIMPP_DIR}
)
set(ARABICA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${CIMPP_DIR}/thirdparty/arabica/include)
find_library(ARABICA_LIBRARY
NAMES arabica.lib
PATH_SUFFIXES
Debug
Release
PATHS
${CMAKE_CURRENT_BINARY_DIR}/${CIMPP_DIR}/thirdparty/arabica
)
find_package_handle_standard_args(CIMpp DEFAULT_MSG CIMPP_LIBRARY CIMPP_INCLUDE_DIR)
mark_as_advanced(CIMPP_INCLUDE_DIR)
if(CIMPP_LIBRARY AND ARABICA_LIBRARY)
set(WITH_CIM_SUBMODULE OFF)
else()
set(WITH_CIM_SUBMODULE ON)
set(CIMPP_INCLUDE_DIR "")
set(CIMPP_LIBRARY "")
set(ARABICA_INCLUDE_DIR "")
set(ARABICA_LIBRARY "")
endif()
endif()
if (WITH_CIM_SUBMODULE)
# When adding CIMpp via a subdirectory, all the neccessary
# details about include directories, library name and path
# are associated with the CIMpp target 'libcimpp'
# We therefore do not need to keep track of CIMPP_INCLUDE_DIR
# seperately
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
add_subdirectory(Dependencies/libcimpp)
set(CIMPP_LIBRARY libcimpp)
set(CIMPP_LIBRARIES ${CIMPP_LIBRARY})
set(CIMPP_INCLUDE_DIR "")
find_package_handle_standard_args(CIMpp DEFAULT_MSG CIMPP_LIBRARY)
elseif(NOT WIN32)
find_path(CIMPP_INCLUDE_DIR
NAMES CIMModel.hpp
PATH_SUFFIXES
cimpp/${CIM_VERSION}
${CIM_VERSION}
include/src
)
find_library(CIMPP_LIBRARY
NAMES cimpp${CIM_VERSION}
PATH_SUFFIXES
lib/static
)
# handle the QUIETLY and REQUIRED arguments and set CIMPP_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(CIMpp DEFAULT_MSG CIMPP_LIBRARY CIMPP_INCLUDE_DIR)
mark_as_advanced(CIMPP_INCLUDE_DIR)
endif()
mark_as_advanced(CIMPP_LIBRARY)
set(CIMPP_LIBRARIES ${CIMPP_LIBRARY} ${ARABICA_LIBRARY})
set(CIMPP_INCLUDE_DIRS ${CIMPP_INCLUDE_DIR} ${ARABICA_INCLUDE_DIR})
option(WITH_EIGEN_SUBMODULE "Build with Eigen as submodule" OFF)
if (WITH_EIGEN_SUBMODULE OR WIN32)
# This could be used when an optimized version of eigen is required
# add_subdirectory(Dependencies/eigen)
find_path(EIGEN3_INCLUDE_DIR
NAMES signature_of_eigen3_matrix_library
PATHS
Dependencies/eigen
)
else()
set(TEMP_PATH ${CMAKE_MODULE_PATH})
# We temporarily clear the module path to avoid recursion
set(CMAKE_MODULE_PATH "")
find_package(Eigen3 REQUIRED)
set(CMAKE_MODULE_PATH ${TEMP_PATH})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 REQUIRED_VARS EIGEN3_INCLUDE_DIR)
......@@ -47,6 +47,19 @@ check_symbol_exists(getopt_long getopt.h HAVE_GETOPT)
include(GetVersion)
GetVersion(${PROJECT_SOURCE_DIR} "DPSIM")
find_package(Eigen3 3.0 REQUIRED)
option(SPDLOG_BUILD_TESTING "Build spdlog tests" OFF)
option(SPDLOG_BUILD_BENCH "Build spdlog benchmarks" OFF)
option(SPDLOG_BUILD_EXAMPLES "Build spdlog examples" OFF)
# Workaround for spdlog in Windows
# A custom FindSpdlog does not work currently
option(WITH_SPDLOG_SUBMODULE "Build with Spdlog as submodule" OFF)
if (WITH_SPDLOG_SUBMODULE OR WIN32)
set(SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/spdlog/include)
else()
find_package(spdlog REQUIRED)
endif()
find_package(CIMpp)
add_subdirectory(Dependencies/libcps)
find_package(PythonInterp 3.6)
......
Subproject commit 811f480b1b3eea0971f432e551c8e30aebbc954c
include(FindPackageHandleStandardArgs)
if (WIN32)
# GSL is currently not supported for Windows
else()
find_path(GSL_INCLUDE_DIR
NAMES gsl_version.h
PATH_SUFFIXES gsl
)
find_library(GSL_LIBRARY NAMES libgsl.so)
find_library(GSL_CBLAS_LIBRARY NAMES libgslcblas.so)
set(GSL_LIBRARIES
${GSL_LIBRARY}
${GSL_CBLAS_LIBRARY}
)
# handle the QUIETLY and REQUIRED arguments and set SUNDIALS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR)
mark_as_advanced(GSL_INCLUDE_DIR)
endif()
find_library(CGRAPH_LIBRARY
NAMES
cgraph
PATH_SUFFIXES
lib
)
find_library(GVC_LIBRARY
NAMES
gvc
PATH_SUFFIXES
lib
)
find_path(GRAPHVIZ_INCLUDE_DIR
NAMES
graphviz/cgraph.h
PATH_SUFFIXES
include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Graphviz REQUIRED_VARS CGRAPH_LIBRARY GVC_LIBRARY GRAPHVIZ_INCLUDE_DIR)
mark_as_advanced(GRAPHVIZ_LIBRARY GRAPHVIZ_INCLUDE_DIR)
set(GRAPHVIZ_LIBRARIES ${CGRAPH_LIBRARY} ${GVC_LIBRARY})
set(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR})
# - Find the NumPy libraries
# This module finds if NumPy is installed, and sets the following variables
# indicating where it is.
#
# TODO: Update to provide the libraries and paths for linking npymath lib.
#
# NUMPY_FOUND - was NumPy found
# NUMPY_VERSION - the version of NumPy found as a string
# NUMPY_VERSION_MAJOR - the major version number of NumPy
# NUMPY_VERSION_MINOR - the minor version number of NumPy
# NUMPY_VERSION_PATCH - the patch version number of NumPy
# NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601
# NUMPY_INCLUDE_DIR - path to the NumPy include files
#
# Source: https://raw.githubusercontent.com/BVLC/caffe/master/cmake/Modules/FindNumPy.cmake
unset(NUMPY_VERSION)
unset(NUMPY_INCLUDE_DIR)
if(PYTHONINTERP_FOUND)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"import numpy as n; print(n.__version__); print(n.get_include());"
RESULT_VARIABLE __result
OUTPUT_VARIABLE __output
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(__result MATCHES 0)
string(REGEX REPLACE ";" "\\\\;" __values ${__output})
string(REGEX REPLACE "\r?\n" ";" __values ${__values})
list(GET __values 0 NUMPY_VERSION)
list(GET __values 1 NUMPY_INCLUDE_DIR)
string(REGEX MATCH "^([0-9])+\\.([0-9])+\\.([0-9])+" __ver_check "${NUMPY_VERSION}")
if(NOT "${__ver_check}" STREQUAL "")
set(NUMPY_VERSION_MAJOR ${CMAKE_MATCH_1})
set(NUMPY_VERSION_MINOR ${CMAKE_MATCH_2})
set(NUMPY_VERSION_PATCH ${CMAKE_MATCH_3})
math(EXPR NUMPY_VERSION_DECIMAL
"(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}")
string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_DIR})
else()
unset(NUMPY_VERSION)
unset(NUMPY_INCLUDE_DIR)
message(STATUS "Requested NumPy version and include path, but got instead:\n${__output}\n")
endif()
endif()
else()
message(STATUS "To find NumPy Python interpretator is required to be found.")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NumPy
REQUIRED_VARS NUMPY_INCLUDE_DIR NUMPY_VERSION
VERSION_VAR NUMPY_VERSION
)
mark_as_advanced(NUMPY_INCLUDE_DIR)
set(NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR})
\ No newline at end of file
include(FindPackageHandleStandardArgs)
if (WIN32)
message(STATIS "Sundials is currently not supported in Windows")
else()
find_path(SUNDIALS_INCLUDE_DIR
NAMES sundials_version.h
PATH_SUFFIXES sundials
)
find_library(SUNDIALS_ARKODE_LIBRARY NAMES sundials_arkode)
find_library(SUNDIALS_CVODE_LIBRARY NAMES sundials_cvode)
find_library(SUNDIALS_CVODES_LIBRARY NAMES sundials_cvodes)
find_library(SUNDIALS_IDA_LIBRARY NAMES sundials_ida)
find_library(SUNDIALS_IDAS_LIBRARY NAMES sundials_idas)
find_library(SUNDIALS_KINSOL_LIBRARY NAMES sundials_kinsol)
set(SUNDIALS_LIBRARIES
${SUNDIALS_ARKODE_LIBRARY}
${SUNDIALS_CVODE_LIBRARY}
${SUNDIALS_CVODES_LIBRARY}
${SUNDIALS_IDA_LIBRARY}
${SUNDIALS_IDAS_LIBRARY}
${SUNDIALS_KINSOL_LIBRARY}
)
# handle the QUIETLY and REQUIRED arguments and set SUNDIALS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Sundials DEFAULT_MSG SUNDIALS_ARKODE_LIBRARY SUNDIALS_INCLUDE_DIR)
mark_as_advanced(SUNDIALS_INCLUDE_DIR)
endif()
cmake_minimum_required(VERSION 3.6)
project(CPowerSystems CXX)
if(${CMAKE_VERSION} VERSION_GREATER "3.12.0")
# Allow setting Graphviz_ROOT for windows builds
cmake_policy(SET CMP0074 NEW)
endif()
# Enable C++11 support
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include(CheckCXXCompilerFlag)
if(MSVC)
check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
# TODO activate this again after fixing warnings
# set(CPS_CXX_FLAGS /W4 /WX)
endif()
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(CPS_CXX_FLAGS -Wall -Werror)
endif()
endif()
set(Python_ADDITIONAL_VERSIONS 3.5 3.6 3.7)
find_package(Threads REQUIRED)
find_package(PythonInterp 3.5)
find_package(PythonLibs 3.5)
find_package(Graphviz)
find_package(Sundials)
find_package(GSL)
find_package(NumPy)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
set(Python_FOUND ON)
endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(Linux_FOUND ON)
elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
set(MacOS_FOUND ON)
endif()
include(CMakeDependentOption)
cmake_dependent_option(WITH_NUMPY "Enable NumPy" ON "NumPy_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable support for Graphviz Graphs" ON "Graphviz_FOUND" OFF)
# Show feature summary
include(FeatureSummary)
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Graphviz WITH_GRAPHVIZ "Graphviz Graphs")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Sundials WITH_SUNDIALS "Sundials solvers")
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
feature_summary(WHAT ALL VAR enabledFeaturesText)
message(STATUS "Feature summary for CPS")
message(STATUS "${enabledFeaturesText}")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/cps/Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/Include/cps/Config.h
)
set(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/Include
${CMAKE_CURRENT_BINARY_DIR}/Include
${EIGEN3_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
)
set(LIBRARIES
Threads::Threads
)
if(Linux_FOUND OR MacOS_FOUND)
# TODO This doesn't actually depend on which OS or compiler is used, but which
# stdlib. For now, under Linux only GNU's libstdc++ seems to work anyway.
# With LLVM's libc++, -lc++fs should probably be used
list(APPEND LIBRARIES stdc++fs)
endif()
add_subdirectory(Source)
add_subdirectory(Examples)
add_subdirectory(Tests)
This diff is collapsed.
*.synctex.gz
*.log
*.toc
*.aux
*.pdf
*.bbl
*.blg
*.dvi
*.out
%----------------------------------------------------------
% Packages and other configurations
%----------------------------------------------------------
\documentclass{report}
\usepackage{graphicx} % Needed to insert images into the document
\graphicspath{{img/}} % Sets the default location of pictures
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{xcolor}
\newcommand{\todo}[1]{\textcolor{red}{[TODO: #1]}}
\title{Documentation of the Dynamic Phasor Simulator - DPsim}
\author{Markus Mirz, Jan Dinkelbach, Viviane Sapucaia, Antonello Monti}
\begin{document}
\maketitle
\tableofcontents
%----------------------------------------------------------
% Content
%----------------------------------------------------------
\include{content/introduction}
\include{content/dynamic_phasors}
\include{content/nodal_analysis}
\include{content/powerflow}
\chapter{Models}
\include{content/branches}
\include{content/synchronous_machine}
\include{content/induction_machine}
\include{content/power_converters}
\include{content/appendix}
%----------------------------------------------------------
% Bibliography
%----------------------------------------------------------
\bibliographystyle{ieeetr}
\bibliography{bibliography}
%----------------------------------------------------------
% End
%----------------------------------------------------------
\end{document}
%----------------------------------------------------------
% Books
%----------------------------------------------------------
@book{kundur1994power,
title={Power system stability and control},
author={Kundur, Prabha and Balu, Neal J and Lauby, Mark G},
volume={7},
year={1994},
publisher={McGraw-hill New York}
}
@article{krause2002,
title={Analysis of Electric Machinery and Drive Systems},
author={Krause, Paul and Wasynczuk, Oleg and Sudhoff, Scott and Pekarek, Steven},
journal={IEEE Press},
year={2002}
}
@book{maas2003nonlinear,
title={Nonlinear microwave and RF circuits},
author={Maas, Stephen A},
year={2003},
publisher={Artech House}
}
@book{suarez2009analysis,
title={Analysis and design of autonomous microwave circuits},
author={Su{\'a}rez, Almudena},
volume={190},
year={2009},
publisher={John Wiley \& Sons}
}
@book{haykin2009communication,
title={Communication Systems, 5th Edition},
author={Haykin, Simon and Moher, Michael},
year={2009},
publisher={Wiley}
}
@book{proakis2001communication,
title={Communication Systems, 5th Edition},
author={Proakis, John and Salehi, Masoud},
year={2001},
publisher={Prentice Hall}
}
@book{schreier2010statistical,
title={Statistical signal processing of complex-valued data: the theory of improper and noncircular signals},
author={Schreier, Peter J and Scharf, Louis L},
year={2010},
publisher={Cambridge University Press}
}
%----------------------------------------------------------
% Papers
%----------------------------------------------------------
@article{wang2010methods,
title={Methods of interfacing rotating machine models in transient simulation programs},
author={Wang, L and Jatskevich, J and Dinavahi, V and Dommel, HW and Martinez, JA and Strunz, K and Rioual, M and Chang, GW and Iravani, R},
journal={IEEE Transactions on Power Delivery},
volume={25},
number={2},
pages={891--903},
year={2010},
publisher={IEEE}
}
@article{sanders1991generalized,
title={Generalized averaging method for power conversion circuits},
author={Sanders, Seth R and Noworolski, J Mark and Liu, Xiaojun Z and Verghese, George C},
journal={IEEE Transactions on Power Electronics},
volume={6},
number={2},
pages={251--259},
year={1991},
publisher={IEEE}
}
@article{venkatasubramanian1995fast,
title={Fast time-varying phasor analysis in the balanced three-phase large electric power system},
author={Venkatasubramanian, Vaithianathan and Schattler, Heinz and Zaborszky, John},
journal={IEEE Transactions on Automatic Control},
volume={40},
number={11},
pages={1975--1982},
year={1995},
publisher={IEEE}
}
@article{strunz2006frequency,
title={Frequency-adaptive network modeling for integrative simulation of natural and envelope waveforms in power systems and circuits},
author={Strunz, Kai and Shintaku, Rachel and Gao, Feng},
journal={IEEE Transactions on Circuits and Systems I: Regular Papers},
volume={53},
number={12},
pages={2788--2803},
year={2006},
publisher={IEEE}
}
@inproceedings{demiray2008evaluation,
title={Evaluation study for the simulation of power system transients using dynamic phasor models},
author={Demiray, T and Andersson, G and Busarello, L},
booktitle={Transmission and Distribution Conference and Exposition: Latin America, 2008 IEEE/PES},
pages={1--6},
year={2008},
organization={IEEE}
}
@article{mattavelli1999ssr,
title={SSR analysis with dynamic phasor model of thyristor-controlled series capacitor},
author={Mattavelli, Paolo and Stankovic, Aleksandar M and Verghese, George C},
journal={IEEE Transactions on Power Systems},
volume={14},
number={1},
pages={200--208},
year={1999},
publisher={IEEE}
}
@article{stefanov2002modeling,
title={Modeling of UPFC operation under unbalanced conditions with dynamic phasors},
author={Stefanov, Predrag C and Stankovic, Aleksandar M},
journal={IEEE Transactions on Power Systems},
volume={17},
number={2},
pages={395--403},
year={2002},
publisher={IEEE}
}
@inproceedings{demiray2007dynamic,
title={Dynamic phasor modeling of the doubly-fed induction generator under unbalanced conditions},
author={Demiray, Turhan and Milano, F and Andersson, G{\"o}ran},
booktitle={Power Tech, 2007 IEEE Lausanne},
pages={1049--1054},
year={2007},
organization={IEEE}
}
@article{stankovic2000analysis,
title={Analysis of asymmetrical faults in power systems using dynamic phasors},
author={Stankovic, Aleksandar M and Aydin, Timur},
journal={IEEE Transactions on Power Systems},
volume={15},
number={3},
pages={1062--1068},
year={2000},
publisher={IEEE}
}
@article{stankovic2002dynamic,
title={Dynamic phasors in modeling and analysis of unbalanced polyphase AC machines},