Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a9706ef
Work in progress code for cosim integration
abdourahmanbarry Apr 21, 2026
1ce5b1a
Added partition interfaces to power electronics and updated cmake fil…
abdourahmanbarry Jun 1, 2026
a94ef4f
Made minor changes to partition interface code
abdourahmanbarry Jun 3, 2026
1efd772
Updated Hires test problem to implicit form
abdourahmanbarry Jun 3, 2026
43206dc
Change comments in partition interfaces
abdourahmanbarry Jun 3, 2026
6eae8bc
Added a subsystem model for evaluating partitions
abdourahmanbarry Jun 15, 2026
bd1fbef
Added a partitioned microgrid test problem
abdourahmanbarry Jun 15, 2026
cefe3dc
Updated bus partition interface to work with new SubsystemModel
abdourahmanbarry Jun 15, 2026
f206a16
Work in progress cosimulation implementation: in rought shape
abdourahmanbarry Jun 15, 2026
5264c15
Cleaned up code in subsystem and made the partition microgrid test ex…
abdourahmanbarry Jun 15, 2026
c7748e6
First attempt at arbitrary partitioning
abdourahmanbarry Jun 24, 2026
73e933c
Added microgrid with four partitions
abdourahmanbarry Jun 24, 2026
3e0c3e7
first version of subsystem
abdourahmanbarry Jun 24, 2026
d153d0b
Added partitioned scale microgrid example
abdourahmanbarry Jun 24, 2026
24ebdf5
Rmoved obsolete interfaces and clean up partitioning code
abdourahmanbarry Jun 26, 2026
d3bb7e7
Partition Scale Microgrid configured with 10000IBRs
abdourahmanbarry Jun 27, 2026
7e45954
Added Jacobian contributions for bus interfaces
abdourahmanbarry Jul 6, 2026
670254b
Benchmark Setup for Parallel Function Evaluation
abdourahmanbarry Jun 27, 2026
92d645e
Minor updates
abdourahmanbarry Jul 7, 2026
d0fd324
Added subsystem Jacobian
abdourahmanbarry Jul 7, 2026
023b631
Updated Hires test problem
abdourahmanbarry Jul 13, 2026
c9a7782
Add subsystem Jacobian testing utilities and update partition test pr…
abdourahmanbarry Jul 13, 2026
24f5816
Update partitioning code to work with recent changes in develop
abdourahmanbarry Jul 19, 2026
dda8868
Updated copy constructor in circuit component
abdourahmanbarry Jul 20, 2026
b332349
Removed Neumaier Compensation
abdourahmanbarry Jul 20, 2026
e93b552
Updated Hires test problem
abdourahmanbarry Jul 20, 2026
7594e5b
Removed print statements
abdourahmanbarry Jul 20, 2026
fed86cd
Apply pre-commit fixes
abdourahmanbarry Jul 20, 2026
e340477
Make SubsystemModel inherit from PowerElectronicsModel for code reuse
abdourahmanbarry Jul 23, 2026
7027b9d
Apply pre-commit fixes
abdourahmanbarry Jul 23, 2026
1506088
Updated SubsystemModel and Partition interfaces
abdourahmanbarry Jul 24, 2026
87b9165
Updated examples to reflect new changes in subsystem model and partit…
abdourahmanbarry Jul 24, 2026
7d20e97
Apply pre-commit fixes
abdourahmanbarry Jul 24, 2026
61c370c
Addressed leaks
abdourahmanbarry Jul 24, 2026
f65baeb
Update partitioning code to use the no-copy implementation from develop
abdourahmanbarry Aug 3, 2026
4514c75
Apply pre-commit fixes
abdourahmanbarry Aug 3, 2026
8313dbd
Improve subsystem partitioning and bus interface handling
abdourahmanbarry Aug 6, 2026
c39b666
Apply pre-commit fixes
abdourahmanbarry Aug 6, 2026
d727689
Update ChangeLog file
abdourahmanbarry Aug 6, 2026
65041a9
Remove co-simulation changes for separate pull request
abdourahmanbarry Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- Added EMT model and operator documentation.
- Added `REGCA` converter model implementation for PhasorDynamics.
- Remove unnecessary data copying while evaluating `PowerElectronics` models, speeding up large simulations by up to 3x
- Added subsystem partitioning support for `PowerElectronics` models, including partition interfaces, and independent residual and Jacobian evaluation.

## v0.1

Expand Down
282 changes: 282 additions & 0 deletions GridKit/Model/PartitionEvaluator.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
#pragma once

#include <functional>

#include "Evaluator.hpp"

namespace GridKit
{
namespace Model
{

template <class ScalarT, typename IdxT>
class PartitionEvaluator : public Evaluator<ScalarT, IdxT>
{
public:
using Base = Evaluator<ScalarT, IdxT>;
using RealT = typename Base::RealT;
using MatrixT = typename Base::MatrixT;
using CsrMatrixT = typename Base::CsrMatrixT;

using ForcingFunc = std::function<ScalarT(RealT)>;

private:
std::vector<ScalarT> y_;
std::vector<ScalarT> yp_;
std::vector<ScalarT> yB_;
std::vector<ScalarT> ypB_;
std::vector<ScalarT> param_;
std::vector<ScalarT> param_up_;
std::vector<ScalarT> param_lo_;
std::vector<ScalarT> residual_;
std::vector<ScalarT> integrand_;
std::vector<ScalarT> adj_integrand_;
std::vector<ScalarT> adj_residual_;
std::vector<bool> tag_;

MatrixT jacobian_;

std::vector<ScalarT> coupling_;
std::vector<ForcingFunc> forcing_;

public:
int allocate() override
{
return 0;
}

int initialize() override
{
return 0;
}

int tagDifferentiable() override
{
return 0;
}

int evaluateResidual() override
{
return 0;
}

int evaluateJacobian() override
{
return 0;
}

int evaluateIntegrand() override
{
return 0;
}

int initializeAdjoint() override
{
return 0;
}

int evaluateAdjointResidual() override
{
return 0;
}

int evaluateAdjointIntegrand() override
{
return 0;
}

IdxT size() override
{
return 0;
}

IdxT nnz() override
{
return 0;
}

bool hasJacobian() override
{
return false;
}

IdxT sizeQuadrature() override
{
return 0;
}

IdxT sizeParams() override
{
return 0;
}

void updateTime(RealT, RealT) override
{
}

void setTolerances(RealT&, RealT&) const override
{
}

void setMaxSteps(IdxT&) const override
{
}

std::vector<ScalarT>& y() override
{
return y_;
}

const std::vector<ScalarT>& y() const override
{
return y_;
}

std::vector<ScalarT>& yp() override
{
return yp_;
}

const std::vector<ScalarT>& yp() const override
{
return yp_;
}

std::vector<bool>& tag() override
{
return tag_;
}

const std::vector<bool>& tag() const override
{
return tag_;
}

std::vector<ScalarT>& yB() override
{
return yB_;
}

const std::vector<ScalarT>& yB() const override
{
return yB_;
}

std::vector<ScalarT>& ypB() override
{
return ypB_;
}

const std::vector<ScalarT>& ypB() const override
{
return ypB_;
}

std::vector<ScalarT>& param() override
{
return param_;
}

const std::vector<ScalarT>& param() const override
{
return param_;
}

std::vector<ScalarT>& param_up() override
{
return param_up_;
}

const std::vector<ScalarT>& param_up() const override
{
return param_up_;
}

std::vector<ScalarT>& param_lo() override
{
return param_lo_;
}

const std::vector<ScalarT>& param_lo() const override
{
return param_lo_;
}

std::vector<ScalarT>& getResidual() override
{
return residual_;
}

const std::vector<ScalarT>& getResidual() const override
{
return residual_;
}

MatrixT& getJacobian() override
{
return jacobian_;
}

const MatrixT& getJacobian() const override
{
return jacobian_;
}

std::vector<ScalarT>& getIntegrand() override
{
return integrand_;
}

const std::vector<ScalarT>& getIntegrand() const override
{
return integrand_;
}

std::vector<ScalarT>& getAdjointResidual() override
{
return adj_residual_;
}

const std::vector<ScalarT>& getAdjointResidual() const override
{
return adj_residual_;
}

std::vector<ScalarT>& getAdjointIntegrand() override
{
return adj_integrand_;
}

const std::vector<ScalarT>& getAdjointIntegrand() const override
{
return adj_integrand_;
}

void addForcing(const ForcingFunc& f)
{
forcing_.push_back(f);
}

IdxT getCouplingSize() const
{
return static_cast<IdxT>(coupling_.size());
}

IdxT getStateSize() const
{
return static_cast<IdxT>(y_.size());
}

std::vector<ScalarT>& getCoupling()
{
return coupling_;
}

const std::vector<ScalarT>& getCoupling() const
{
return coupling_;
}
};

} // namespace Model
} // namespace GridKit
2 changes: 2 additions & 0 deletions GridKit/Model/PowerElectronics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_subdirectory(TransmissionLine)
add_subdirectory(MicrogridLoad)
add_subdirectory(MicrogridLine)
add_subdirectory(MicrogridBusDQ)
add_subdirectory(PartitionInterface)

install(
FILES CircuitComponent.hpp
Expand All @@ -29,4 +30,5 @@ install(
SystemModelPowerElectronics.hpp
NodeBase.hpp
ExternalConnection.hpp
SubsystemModel.hpp
DESTINATION include/GridKit/Model/PowerElectronics)
Loading
Loading