Skip to content

Commit

Permalink
Fixed IDA Interface Final Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
reid-g committed Dec 17, 2024
1 parent 9cdd63e commit b194106
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Examples/ScaleMicrogrid/ScaleMicrogrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ int test(index_type Nsize, real_type error_tol, bool debug_output, bool use_DAE_
{
using namespace ModelLib;

index_type max_step_number = 3000;
bool usejac = true;

real_type t_init = 0.0;
Expand All @@ -79,7 +78,7 @@ 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);

const std::vector<real_type>* true_vec = use_DAE_keys ? &answer_key_N8_DAE : &answer_key_N8;

Expand Down
9 changes: 5 additions & 4 deletions Examples/ScaleMicrogrid/SolutionKeys.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
*
* ODE Keys gives similar results.
*/
constexpr real_type SCALE_MICROGRID_ERROR_TOL = 8.0e-5;
constexpr real_type SCALE_MICROGRID_REL_TOL = 1.0e-7;
constexpr real_type SCALE_MICROGRID_ABS_TOL = 1.0e-7;
const bool USE_DAE_KEYS = true;
constexpr real_type SCALE_MICROGRID_ERROR_TOL = 1.0e-6;
constexpr real_type SCALE_MICROGRID_REL_TOL = 1.0e-8;
constexpr real_type SCALE_MICROGRID_ABS_TOL = 1.0e-8;
constexpr index_type SCALE_MICROGRID_MAX_STEPS = 10000;
const bool USE_DAE_KEYS = false;


const std::vector<real_type> answer_key_N2 = {22975.4182636905,
Expand Down
5 changes: 5 additions & 0 deletions Solver/Dynamic/Ida.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ namespace Sundials
tout += dt;
}
}

model_->updateTime(tf, 0.0);
copyVec(yy_, model_->y());
copyVec(yp_, model_->yp());

//std::cout << "\n";
return retval;
}
Expand Down

0 comments on commit b194106

Please sign in to comment.