Skip to content

Commit 37c1fa5

Browse files
committed
Fix rebasing issues.
1 parent 8ecb853 commit 37c1fa5

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

examples/Gen2Example/Example/example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include "Model/PhasorDynamics/BusFault/BusFault.hpp"
2020
#include "Model/PhasorDynamics/Load/Load.cpp"
2121
#include "Model/PhasorDynamics/Load/Load.hpp"
22-
#include "Model/PhasorDynamics/SynchronousMachine/ClassicalGenerator/ClassicalGen.cpp"
23-
#include "Model/PhasorDynamics/SynchronousMachine/ClassicalGenerator/ClassicalGen.hpp"
22+
#include "Model/PhasorDynamics/SynchronousMachine/GenClassicalerator/GenClassical.cpp"
23+
#include "Model/PhasorDynamics/SynchronousMachine/GenClassicalerator/GenClassical.hpp"
2424
#include "Model/PhasorDynamics/SystemModel.hpp"
2525
#include "Solver/Dynamic/Ida.cpp"
2626
#include "Solver/Dynamic/Ida.hpp"
@@ -38,7 +38,7 @@ int main()
3838
Bus<double, size_t> bus1(0.9949877346411762, 0.09999703952427966);
3939
BusInfinite<double, size_t> bus2(1.0, 0.0);
4040
Branch<double, size_t> branch(&bus1, &bus2, 0.0, 0.1, 0, 0);
41-
ClassicalGen<double, size_t> gen(&bus1, 1, 1, 0.05013, 3.0, 0.0, 0.0, 0.2);
41+
GenClassical<double, size_t> gen(&bus1, 1, 1, 0.05013, 3.0, 0.0, 0.0, 0.2);
4242

4343
/* Connect everything together */
4444
sys.addBus(&bus1);
@@ -101,4 +101,4 @@ int main()
101101
fclose(f);
102102

103103
return 0;
104-
}
104+
}

examples/PhasorDynamics/Gen2Example/example.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ int main(int argc, char* argv[])
5454

5555

5656

57-
std::stringstream buffer;
57+
// std::stringstream buffer;
5858

59-
/* Set up simulation */
59+
/* Set up simulation */
6060
Ida<double, size_t> ida(&sys);
6161
ida.configureSimulation();
6262

6363
/* Run simulation */
6464
double start = static_cast<double>(clock());
65-
// ida.printOutputF(0, 0, buffer);
6665
ida.initializeSimulation(0.0, false);
67-
ida.runSimulationFixed(0.0, dt, 1.0, buffer);
66+
size_t nout = 200;
67+
ida.runSimulation(1.0, nout);
6868

6969
if(argc >= 1)
7070
{
@@ -85,20 +85,20 @@ int main(int argc, char* argv[])
8585
int i = 1;
8686
double data;
8787
int size = 2 * sys.size() + 2;
88-
while (buffer >> data)
89-
{
90-
91-
if (i % (size) == 0)
92-
{
93-
outfile << data << "\n";
94-
}
95-
else
96-
{
97-
outfile << data << ",";
98-
}
99-
100-
i++;
101-
}
88+
// while (buffer >> data)
89+
// {
90+
91+
// if (i % (size) == 0)
92+
// {
93+
// outfile << data << "\n";
94+
// }
95+
// else
96+
// {
97+
// outfile << data << ",";
98+
// }
99+
100+
// i++;
101+
// }
102102
outfile.close();
103103
}
104104

src/Model/PhasorDynamics/SynchronousMachine/GenClassical/GenClassical.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*/
88

9-
#include "ClassicalGen.hpp"
9+
#include "GenClassical.hpp"
1010

1111
#include <cmath>
1212
#include <iostream>
@@ -29,7 +29,7 @@ namespace GridKit
2929
* - Number of optimization parameters = 0
3030
*/
3131
template <class ScalarT, typename IdxT>
32-
ClassicalGen<ScalarT, IdxT>::ClassicalGen(bus_type* bus, int unit_id)
32+
GenClassical<ScalarT, IdxT>::GenClassical(bus_type* bus, int unit_id)
3333
: bus_(bus),
3434
busID_(0),
3535
unit_id_(unit_id),
@@ -58,7 +58,7 @@ namespace GridKit
5858
* - Number of optimization parameters = 0
5959
*/
6060
template <class ScalarT, typename IdxT>
61-
ClassicalGen<ScalarT, IdxT>::ClassicalGen(bus_type* bus,
61+
GenClassical<ScalarT, IdxT>::GenClassical(bus_type* bus,
6262
int unit_id,
6363
ScalarT p0,
6464
ScalarT q0,
@@ -85,7 +85,7 @@ namespace GridKit
8585
* @brief allocate method computes sparsity pattern of the Jacobian.
8686
*/
8787
template <class ScalarT, typename IdxT>
88-
int ClassicalGen<ScalarT, IdxT>::allocate()
88+
int GenClassical<ScalarT, IdxT>::allocate()
8989
{
9090
f_.resize(size_);
9191
y_.resize(size_);
@@ -136,7 +136,7 @@ namespace GridKit
136136
* \brief Identify differential variables.
137137
*/
138138
template <class ScalarT, typename IdxT>
139-
int ClassicalGen<ScalarT, IdxT>::tagDifferentiable()
139+
int GenClassical<ScalarT, IdxT>::tagDifferentiable()
140140
{
141141

142142
return 0;
@@ -148,9 +148,11 @@ namespace GridKit
148148
*
149149
*/
150150
template <class ScalarT, typename IdxT>
151-
int ClassicalGen<ScalarT, IdxT>::evaluateResidual()
151+
int GenClassical<ScalarT, IdxT>::evaluateResidual()
152152
{
153153
/* Read variables */
154+
ScalarT delta_dot = yp_[0];
155+
ScalarT omega_dot = yp_[1];
154156
ScalarT delta = y_[0];
155157
ScalarT omega = y_[1];
156158
ScalarT telec = y_[2];
@@ -169,8 +171,8 @@ namespace GridKit
169171
f_[3] = ir + G*Vr() - B * Vi() - ep*(G*cos(delta) -B*sin(delta));
170172
f_[4] = ii + B*Vr() + G * Vi() - ep*(B*cos(delta) + G*sin(delta));
171173

172-
/* 11 ClassicalGen algebraic equations */
173-
f_[2] = telec - (1.0 / (1.0 + omega)) * (g * ep * ep - ep * (cos(delta) * (g * Vr() - b * Vi()) + sin(delta) * (b * Vr() + g * Vi())));
174+
/* 11 GenClassical algebraic equations */
175+
f_[2] = telec - (1.0 / (1.0 + omega)) * (G * ep * ep - ep * (cos(delta) * (G * Vr() - B * Vi()) + sin(delta) * (B * Vr() + G * Vi())));
174176

175177
Ir() += - (G*Vr() - B * Vi() - ep*(G*cos(delta) - B*sin(delta)));
176178
Ii() += - (B*Vr() + G * Vi() - ep*(B*cos(delta) + G*sin(delta)));

src/Model/PhasorDynamics/SynchronousMachine/GenClassical/GenClassical.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace GridKit
2424
{
2525

2626
template <class ScalarT, typename IdxT>
27-
class ClassicalGen : public Component<ScalarT, IdxT>
27+
class GenClassical : public Component<ScalarT, IdxT>
2828
{
2929
using Component<ScalarT, IdxT>::alpha_;
3030
using Component<ScalarT, IdxT>::f_;
@@ -45,16 +45,16 @@ namespace GridKit
4545
using real_type = typename Component<ScalarT, IdxT>::real_type;
4646

4747
public:
48-
ClassicalGen(bus_type* bus, int unit_id);
49-
ClassicalGen(bus_type* bus,
48+
GenClassical(bus_type* bus, int unit_id);
49+
GenClassical(bus_type* bus,
5050
int unit_id,
5151
ScalarT p0,
5252
ScalarT q0,
5353
real_type H,
5454
real_type D,
5555
real_type Ra,
5656
real_type Xdp);
57-
~ClassicalGen() = default;
57+
~GenClassical() = default;
5858

5959
int allocate() override;
6060
int initialize() override;

0 commit comments

Comments
 (0)