Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed IDA Interface Final Copy #37

Merged
merged 4 commits into from
Dec 18, 2024
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/ScaleMicrogrid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ target_link_libraries(scalemicrogrid GRIDKIT::powerelec_disgen
GRIDKIT::solvers_dyn
GRIDKIT::powerelec_mircobusdq)

#add_test(NAME ScaleMicrogrid COMMAND $<TARGET_FILE:scalemicrogrid>)
add_test(NAME ScaleMicrogrid COMMAND $<TARGET_FILE:scalemicrogrid>)
install(TARGETS scalemicrogrid RUNTIME DESTINATION bin)
19 changes: 9 additions & 10 deletions Examples/ScaleMicrogrid/ScaleMicrogrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using real_type = double;
#include "SolutionKeys.hpp"


static int test(index_type Nsize, real_type test_tolerance, bool error_tol = false, bool use_DAE_keys = false);
static int test(index_type Nsize, real_type test_tolerance, bool error_tol = false);

/**
* @brief Run Scale Microgrid test cases of N = (2,4,8) and check for correctness.
Expand All @@ -39,9 +39,9 @@ int main(int argc, char const *argv[])
bool debug_out = false;
real_type tol = SCALE_MICROGRID_ERROR_TOL;

retval += test(2, tol, debug_out, USE_DAE_KEYS);
retval += test(4, tol, debug_out, USE_DAE_KEYS);
retval += test(8, tol, debug_out, USE_DAE_KEYS);
retval += test(2, tol, debug_out);
retval += test(4, tol, debug_out);
retval += test(8, tol, debug_out);
if (retval > 0)
{
std::cout << "Some tests fail!!\n";
Expand All @@ -62,11 +62,10 @@ int main(int argc, char const *argv[])
* @param use_DAE_keys - Choice between using DAE or ODE keys
* @return int returns 0 if successful, >0 otherwise
*/
int test(index_type Nsize, real_type error_tol, bool debug_output, bool use_DAE_keys)
int test(index_type Nsize, real_type error_tol, bool debug_output)
{
using namespace ModelLib;

index_type max_step_number = 3000;
bool usejac = true;
pelesh marked this conversation as resolved.
Show resolved Hide resolved

real_type t_init = 0.0;
Expand All @@ -79,17 +78,17 @@ int test(index_type Nsize, real_type error_tol, bool debug_output, bool use_DAE_
auto* sysmodel = new PowerElectronicsModel<real_type, index_type>(reltol,
abstol,
usejac,
max_step_number);
SCALE_MICROGRID_MAX_STEPS);

pelesh marked this conversation as resolved.
Show resolved Hide resolved
const std::vector<real_type>* true_vec = use_DAE_keys ? &answer_key_N8_DAE : &answer_key_N8;
const std::vector<real_type>* true_vec = &answer_key_N8;

switch (Nsize)
{
case 2:
true_vec = use_DAE_keys ? &answer_key_N2_DAE : &answer_key_N2;
true_vec = &answer_key_N2;
break;
case 4:
true_vec = use_DAE_keys ? &answer_key_N4_DAE : &answer_key_N4;
true_vec = &answer_key_N4;
break;
case 8:
// true_vec = &answer_key_N8;
Expand Down
Loading