Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion examples/AdjointSensitivity/AdjointSensitivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
*/
int main()
{
using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
4 changes: 2 additions & 2 deletions examples/DistributedGeneratorTest/DGTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
int main(int argc, char const *argv[])
{

ModelLib::DistributedGeneratorParameters<double, size_t> parms;
GridKit::DistributedGeneratorParameters<double, size_t> parms;
//Parameters from MATLAB Microgrid code for first DG
parms.wb_ = 2.0*M_PI*50.0;
parms.wc_ = 31.41;
Expand All @@ -38,7 +38,7 @@ int main(int argc, char const *argv[])
parms.rLc_ = 0.03;
parms.Lc_ = 0.35e-3;

ModelLib::DistributedGenerator<double, size_t> *dg = new ModelLib::DistributedGenerator<double, size_t>(0, parms, true);
GridKit::DistributedGenerator<double, size_t> *dg = new GridKit::DistributedGenerator<double, size_t>(0, parms, true);

std::vector<double> t1(16,0.0);
std::vector<double> t2{0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5};
Expand Down
2 changes: 1 addition & 1 deletion examples/DynamicConstrainedOpt/DynamicConstrainedOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

int main()
{
using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
2 changes: 1 addition & 1 deletion examples/GenConstLoad/GenConstLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

int main()
{
using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
2 changes: 1 addition & 1 deletion examples/GenInfiniteBus/GenInfiniteBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

int main()
{
using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
2 changes: 1 addition & 1 deletion examples/Grid3Bus/Grid3BusSys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mpc.gencost = [
)";


using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
32 changes: 16 additions & 16 deletions examples/Microgrid/Microgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ int main(int argc, char const *argv[])
bool usejac = true;

//Create model
ModelLib::PowerElectronicsModel<double, size_t>* sysmodel = new ModelLib::PowerElectronicsModel<double, size_t>(reltol, abstol, usejac, max_step_amount);
GridKit::PowerElectronicsModel<double, size_t>* sysmodel = new GridKit::PowerElectronicsModel<double, size_t>(reltol, abstol, usejac, max_step_amount);

//Modeled after the problem in the paper
double RN = 1.0e4;

//DG Params
ModelLib::DistributedGeneratorParameters<double, size_t> parms1;
GridKit::DistributedGeneratorParameters<double, size_t> parms1;
parms1.wb_ = 2.0*M_PI*50.0;
parms1.wc_ = 31.41;
parms1.mp_ = 9.4e-5;
Expand All @@ -50,7 +50,7 @@ int main(int argc, char const *argv[])
parms1.rLc_ = 0.03;
parms1.Lc_ = 0.35e-3;

ModelLib::DistributedGeneratorParameters<double, size_t> parms2;
GridKit::DistributedGeneratorParameters<double, size_t> parms2;
//Parameters from MATLAB Microgrid code for first DG
parms2.wb_ = 2.0*M_PI*50.0;
parms2.wc_ = 31.41;
Expand Down Expand Up @@ -103,7 +103,7 @@ int main(int argc, char const *argv[])
size_t indexv = 0;

//dg 1
ModelLib::DistributedGenerator<double, size_t> *dg1 = new ModelLib::DistributedGenerator<double, size_t>(0, parms1, true);
GridKit::DistributedGenerator<double, size_t> *dg1 = new GridKit::DistributedGenerator<double, size_t>(0, parms1, true);
//ref motor
dg1->setExternalConnectionNodes(0,vec_size_internals);
//outputs
Expand All @@ -121,7 +121,7 @@ int main(int argc, char const *argv[])
sysmodel->addComponent(dg1);

//dg 2
ModelLib::DistributedGenerator<double, size_t> *dg2 = new ModelLib::DistributedGenerator<double, size_t>(1, parms1, false);
GridKit::DistributedGenerator<double, size_t> *dg2 = new GridKit::DistributedGenerator<double, size_t>(1, parms1, false);
//ref motor
dg2->setExternalConnectionNodes(0,vec_size_internals);
//outputs
Expand All @@ -138,7 +138,7 @@ int main(int argc, char const *argv[])


//dg 3
ModelLib::DistributedGenerator<double, size_t> *dg3 = new ModelLib::DistributedGenerator<double, size_t>(2, parms2, false);
GridKit::DistributedGenerator<double, size_t> *dg3 = new GridKit::DistributedGenerator<double, size_t>(2, parms2, false);
//ref motor
dg3->setExternalConnectionNodes(0,vec_size_internals);
//outputs
Expand All @@ -155,7 +155,7 @@ int main(int argc, char const *argv[])


//dg 4
ModelLib::DistributedGenerator<double, size_t> *dg4 = new ModelLib::DistributedGenerator<double, size_t>(3, parms2, false);
GridKit::DistributedGenerator<double, size_t> *dg4 = new GridKit::DistributedGenerator<double, size_t>(3, parms2, false);
//ref motor
dg4->setExternalConnectionNodes(0,vec_size_internals);
//outputs
Expand All @@ -174,7 +174,7 @@ int main(int argc, char const *argv[])
// Lines

//line 1
ModelLib::MicrogridLine<double, size_t> *l1 = new ModelLib::MicrogridLine<double, size_t>(4, rline1, Lline1);
GridKit::MicrogridLine<double, size_t> *l1 = new GridKit::MicrogridLine<double, size_t>(4, rline1, Lline1);
//ref motor
l1->setExternalConnectionNodes(0,vec_size_internals);
//input connections
Expand All @@ -194,7 +194,7 @@ int main(int argc, char const *argv[])


//line 2
ModelLib::MicrogridLine<double, size_t> *l2 = new ModelLib::MicrogridLine<double, size_t>(5, rline2, Lline2);
GridKit::MicrogridLine<double, size_t> *l2 = new GridKit::MicrogridLine<double, size_t>(5, rline2, Lline2);
//ref motor
l2->setExternalConnectionNodes(0,vec_size_internals);
//input connections
Expand All @@ -213,7 +213,7 @@ int main(int argc, char const *argv[])
sysmodel->addComponent(l2);

//line 3
ModelLib::MicrogridLine<double, size_t> *l3 = new ModelLib::MicrogridLine<double, size_t>(6, rline3, Lline3);
GridKit::MicrogridLine<double, size_t> *l3 = new GridKit::MicrogridLine<double, size_t>(6, rline3, Lline3);
//ref motor
l3->setExternalConnectionNodes(0,vec_size_internals);
//input connections
Expand All @@ -234,7 +234,7 @@ int main(int argc, char const *argv[])
// loads

//load 1
ModelLib::MicrogridLoad<double, size_t> *load1 = new ModelLib::MicrogridLoad<double, size_t>(7, rload1, Lload1);
GridKit::MicrogridLoad<double, size_t> *load1 = new GridKit::MicrogridLoad<double, size_t>(7, rload1, Lload1);
//ref motor
load1->setExternalConnectionNodes(0,vec_size_internals);
//input connections
Expand All @@ -250,7 +250,7 @@ int main(int argc, char const *argv[])
sysmodel->addComponent(load1);

//load 2
ModelLib::MicrogridLoad<double, size_t> *load2 = new ModelLib::MicrogridLoad<double, size_t>(8, rload2, Lload2);
GridKit::MicrogridLoad<double, size_t> *load2 = new GridKit::MicrogridLoad<double, size_t>(8, rload2, Lload2);
//ref motor
load2->setExternalConnectionNodes(0,vec_size_internals);
//input connections
Expand All @@ -266,25 +266,25 @@ int main(int argc, char const *argv[])
sysmodel->addComponent(load2);

//Virtual PQ Buses
ModelLib::MicrogridBusDQ<double, size_t> *bus1 = new ModelLib::MicrogridBusDQ<double, size_t>(9, RN);
GridKit::MicrogridBusDQ<double, size_t> *bus1 = new GridKit::MicrogridBusDQ<double, size_t>(9, RN);

bus1->setExternalConnectionNodes(0,dqbus1);
bus1->setExternalConnectionNodes(1,dqbus1 + 1);
sysmodel->addComponent(bus1);

ModelLib::MicrogridBusDQ<double, size_t> *bus2 = new ModelLib::MicrogridBusDQ<double, size_t>(10, RN);
GridKit::MicrogridBusDQ<double, size_t> *bus2 = new GridKit::MicrogridBusDQ<double, size_t>(10, RN);

bus2->setExternalConnectionNodes(0,dqbus2);
bus2->setExternalConnectionNodes(1,dqbus2 + 1);
sysmodel->addComponent(bus2);

ModelLib::MicrogridBusDQ<double, size_t> *bus3 = new ModelLib::MicrogridBusDQ<double, size_t>(11, RN);
GridKit::MicrogridBusDQ<double, size_t> *bus3 = new GridKit::MicrogridBusDQ<double, size_t>(11, RN);

bus3->setExternalConnectionNodes(0,dqbus3);
bus3->setExternalConnectionNodes(1,dqbus3 + 1);
sysmodel->addComponent(bus3);

ModelLib::MicrogridBusDQ<double, size_t> *bus4 = new ModelLib::MicrogridBusDQ<double, size_t>(12, RN);
GridKit::MicrogridBusDQ<double, size_t> *bus4 = new GridKit::MicrogridBusDQ<double, size_t>(12, RN);

bus4->setExternalConnectionNodes(0,dqbus4);
bus4->setExternalConnectionNodes(1,dqbus4 + 1);
Expand Down
2 changes: 1 addition & 1 deletion examples/ParameterEstimation/ParameterEstimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

int main()
{
using namespace ModelLib;
using namespace GridKit;
using namespace AnalysisManager::Sundials;
using namespace AnalysisManager;
using namespace GridKit::Testing;
Expand Down
8 changes: 4 additions & 4 deletions examples/RLCircuit/RLCircuit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int argc, char const *argv[])

//TODO:setup as named parameters
//Create circuit model
ModelLib::PowerElectronicsModel<double, size_t>* sysmodel = new ModelLib::PowerElectronicsModel<double, size_t>(reltol, abstol, usejac);
GridKit::PowerElectronicsModel<double, size_t>* sysmodel = new GridKit::PowerElectronicsModel<double, size_t>(reltol, abstol, usejac);

size_t idoff = 0;

Expand All @@ -35,7 +35,7 @@ int main(int argc, char const *argv[])


//inductor
ModelLib::Inductor<double, size_t>* induct = new ModelLib::Inductor(idoff,linit);
GridKit::Inductor<double, size_t>* induct = new GridKit::Inductor(idoff,linit);
//Form index to node uid realations
// input
induct->setExternalConnectionNodes(0,1);
Expand All @@ -49,7 +49,7 @@ int main(int argc, char const *argv[])

//resistor
idoff++;
ModelLib::Resistor<double, size_t>* resis = new ModelLib::Resistor(idoff, rinit);
GridKit::Resistor<double, size_t>* resis = new GridKit::Resistor(idoff, rinit);
//Form index to node uid realations
//input
resis->setExternalConnectionNodes(0,0);
Expand All @@ -60,7 +60,7 @@ int main(int argc, char const *argv[])

//voltage source
idoff++;
ModelLib::VoltageSource<double, size_t>* vsource = new ModelLib::VoltageSource(idoff, vinit);
GridKit::VoltageSource<double, size_t>* vsource = new GridKit::VoltageSource(idoff, vinit);
//Form index to node uid realations
//input
vsource->setExternalConnectionNodes(0,-1);
Expand Down
8 changes: 4 additions & 4 deletions examples/ScaleMicrogrid/ScaleMicrogrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(int argc, char const *argv[])
*/
int test(index_type Nsize, real_type error_tol, bool debug_output)
{
using namespace ModelLib;
using namespace GridKit;

bool usejac = true;

Expand Down Expand Up @@ -105,7 +105,7 @@ int test(index_type Nsize, real_type error_tol, bool debug_output)

// DG Params Vector
// All DGs have the same set of parameters except for the first two.
ModelLib::DistributedGeneratorParameters<real_type, index_type> DG_parms1;
GridKit::DistributedGeneratorParameters<real_type, index_type> DG_parms1;
DG_parms1.wb_ = 2.0*M_PI*50.0;
DG_parms1.wc_ = 31.41;
DG_parms1.mp_ = 9.4e-5;
Expand All @@ -122,7 +122,7 @@ int test(index_type Nsize, real_type error_tol, bool debug_output)
DG_parms1.rLc_ = 0.03;
DG_parms1.Lc_ = 0.35e-3;

ModelLib::DistributedGeneratorParameters<real_type, index_type> DG_parms2;
GridKit::DistributedGeneratorParameters<real_type, index_type> DG_parms2;
DG_parms2.wb_ = 2.0*M_PI*50.0;
DG_parms2.wc_ = 31.41;
DG_parms2.mp_ = 12.5e-5;
Expand All @@ -139,7 +139,7 @@ int test(index_type Nsize, real_type error_tol, bool debug_output)
DG_parms2.rLc_ = 0.03;
DG_parms2.Lc_ = 0.35e-3;

std::vector<ModelLib::DistributedGeneratorParameters<real_type, index_type>> DGParams_list(2*Nsize, DG_parms2);
std::vector<GridKit::DistributedGeneratorParameters<real_type, index_type>> DGParams_list(2*Nsize, DG_parms2);

DGParams_list[0] = DG_parms1;
DGParams_list[1] = DG_parms1;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/PhasorDynamics/Branch/Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

#include "Branch.hpp"

namespace ModelLib { // change to GridKit
namespace GridKit {
namespace PhasorDynamics {

/*!
Expand Down
4 changes: 2 additions & 2 deletions src/Model/PhasorDynamics/Branch/Branch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ namespace PowerSystemData
}
}

namespace ModelLib
namespace GridKit
{
namespace PhasorDynamics
{
template <class ScalarT, typename IdxT> class Bus;
}
}

namespace ModelLib
namespace GridKit
{
namespace PhasorDynamics
{
Expand Down
4 changes: 2 additions & 2 deletions src/Model/PhasorDynamics/Bus/Bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#include <PowerSystemData.hpp>
#include "Bus.hpp"

namespace ModelLib // change to GridKit
namespace GridKit
{
namespace PhasorDynamics
{
Expand Down Expand Up @@ -223,5 +223,5 @@ template class Bus<double, long int>;
template class Bus<double, size_t>;

} // namespace PhasorDynamic
} // namespace ModelLib
} // namespace GridKit

2 changes: 1 addition & 1 deletion src/Model/PhasorDynamics/Bus/Bus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace PowerSystemData
}
}

namespace ModelLib // change to GridKit
namespace GridKit
{
namespace PhasorDynamics
{
Expand Down
4 changes: 2 additions & 2 deletions src/Model/PowerElectronics/Capacitor/Capacitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <vector>
#include "Capacitor.hpp"

namespace ModelLib {
namespace GridKit {

/*!
* @brief Constructor for Capacitor
Expand Down Expand Up @@ -141,5 +141,5 @@ template class Capacitor<double, long int>;
template class Capacitor<double, size_t>;


} //namespace ModelLib
} //namespace GridKit

4 changes: 2 additions & 2 deletions src/Model/PowerElectronics/Capacitor/Capacitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#include <Model/PowerElectronics/CircuitComponent.hpp>


namespace ModelLib
namespace GridKit
{
template <class ScalarT, typename IdxT> class BaseBus;
}


namespace ModelLib
namespace GridKit
{
/*!
* @brief Declaration of a Capacitor class.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/PowerElectronics/CircuitComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <set>


namespace ModelLib
namespace GridKit
{
/*!
* @brief Declaration of a CircuitComponent class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <vector>
#include "DistributedGenerator.hpp"

namespace ModelLib {
namespace GridKit {


/*!
Expand Down Expand Up @@ -359,5 +359,5 @@ template class DistributedGenerator<double, long int>;
template class DistributedGenerator<double, size_t>;


} //namespace ModelLib
} //namespace GridKit

Loading