@@ -140,6 +140,9 @@ using namespace AnalysisManager;
140140using namespace GridKit ::Testing;
141141using namespace GridKit ::PowerSystemData;
142142
143+ constexpr double theta2_ref = -4.87979 ; // [deg]
144+ constexpr double V2_ref = 1.08281 ; // [p.u.]
145+ constexpr double theta3_ref = 1.46241 ; // [deg]
143146
144147/* *
145148 * Testing the monlithic case via the class MiniGrid
@@ -170,17 +173,17 @@ int monolithic_case()
170173 double V2 = model->V2 ();
171174 double th3 = model->th3 () * 180.0 /M_PI;
172175 std::cout << " Solution:\n " ;
173- std::cout << " theta2 = " << th2 << " deg, expected = " << " -4.87979 deg\n " ;
174- std::cout << " V2 = " << V2 << " p.u., expected = " << " 1.08281 p.u.\n " ;
175- std::cout << " theta3 = " << th3 << " deg, expected = " << " 1.46241 deg\n\n " ;
176+ std::cout << " theta2 = " << th2 << " deg, expected = " << theta2_ref << " deg\n " ;
177+ std::cout << " V2 = " << V2 << " p.u., expected = " << V2_ref << " p.u.\n " ;
178+ std::cout << " theta3 = " << th3 << " deg, expected = " << theta3_ref << " deg\n\n " ;
176179
177180 // Print solver performance statistics
178181 kinsol->printFinalStats ();
179182
180183 int retval1 = 0 ;
181- retval1 += !isEqual (th2, - 4.87979 , 1e-4 );
182- retval1 += !isEqual (V2, 1.08281 , 1e-4 );
183- retval1 += !isEqual (th3, 1.46241 , 1e-4 );
184+ retval1 += !isEqual (th2, theta2_ref , 1e-4 );
185+ retval1 += !isEqual (V2, V2_ref , 1e-4 );
186+ retval1 += !isEqual (th3, theta3_ref , 1e-4 );
184187
185188 if (retval1 == 0 )
186189 std::cout << " \n Success!\n\n\n " ;
@@ -232,17 +235,17 @@ int parser_case()
232235
233236
234237 std::cout << " Solution:\n " ;
235- std::cout << " theta2 = " << th2 << " deg, expected = " << " -4.87979 deg\n " ;
236- std::cout << " V2 = " << V2 << " p.u., expected = " << " 1.08281 p.u.\n " ;
237- std::cout << " theta3 = " << th3 << " deg, expected = " << " 1.46241 deg\n\n " ;
238+ std::cout << " theta2 = " << th2 << " deg, expected = " << theta2_ref << " deg\n " ;
239+ std::cout << " V2 = " << V2 << " p.u., expected = " << V2_ref << " p.u.\n " ;
240+ std::cout << " theta3 = " << th3 << " deg, expected = " << theta3_ref << " deg\n\n " ;
238241
239242 // Print solver performance statistics
240243 kinsol->printFinalStats ();
241244
242245 int retval2 = 0 ;
243- retval2 += !isEqual (th2, - 4.87979 , 1e-4 );
244- retval2 += !isEqual (V2, 1.08281 , 1e-4 );
245- retval2 += !isEqual (th3, 1.46241 , 1e-4 );
246+ retval2 += !isEqual (th2, theta2_ref , 1e-4 );
247+ retval2 += !isEqual (V2, V2_ref , 1e-4 );
248+ retval2 += !isEqual (th3, theta3_ref , 1e-4 );
246249
247250 if (retval2 == 0 )
248251 std::cout << " \n Success!\n\n\n " ;
@@ -355,17 +358,17 @@ int hardwired_case()
355358
356359
357360 std::cout << " Solution:\n " ;
358- std::cout << " theta2 = " << th2 << " deg, expected = " << " -4.87979 deg\n " ;
359- std::cout << " V2 = " << V2 << " p.u., expected = " << " 1.08281 p.u.\n " ;
360- std::cout << " theta3 = " << th3 << " deg, expected = " << " 1.46241 deg\n\n " ;
361+ std::cout << " theta2 = " << th2 << " deg, expected = " << theta2_ref << " deg\n " ;
362+ std::cout << " V2 = " << V2 << " p.u., expected = " << V2_ref << " p.u.\n " ;
363+ std::cout << " theta3 = " << th3 << " deg, expected = " << theta3_ref << " deg\n\n " ;
361364
362365 // Print solver performance statistics
363366 kinsol->printFinalStats ();
364367
365368 int retval2 = 0 ;
366- retval2 += !isEqual (th2, - 4.87979 , 1e-4 );
367- retval2 += !isEqual (V2, 1.08281 , 1e-4 );
368- retval2 += !isEqual (th3, 1.46241 , 1e-4 );
369+ retval2 += !isEqual (th2, theta2_ref , 1e-4 );
370+ retval2 += !isEqual (V2, V2_ref , 1e-4 );
371+ retval2 += !isEqual (th3, theta3_ref , 1e-4 );
369372
370373 if (retval2 == 0 )
371374 std::cout << " \n Success!\n\n\n " ;
0 commit comments