5 #ifndef ROADRUNNER_NLEQSOLVER_H
6 #define ROADRUNNER_NLEQSOLVER_H
8 #include "rrExporter.h"
19 using SteadyStateSolver::SteadyStateSolver;
34 void loadConfigSettings()
override;
39 void resetSettings()
override;
47 template<
class NLEQSolverType>
50 int size = mModel->getStateVector(
nullptr);
51 double* states =
new double[size];
52 for (
int i=0; i<size; i++)
54 mModel->getStateVector(states);
58 auto nleq = std::unique_ptr<NLEQSolverType>(
new NLEQSolverType(mModel));
59 rrLog(Logger::LOG_DEBUG) <<
"NLEQSolver::solve: " << std::endl;
60 nleq->allowPreSim =
getValue(
"allow_presimulation");
61 nleq->preSimMaximumSteps =
getValue(
"presimulation_maximum_steps");
62 nleq->preSimTime =
getValue(
"presimulation_time");
63 nleq->allowApprox =
getValue(
"allow_approx");
64 nleq->approxTolerance =
getValue(
"approx_tolerance");
65 nleq->approxMaximumSteps =
getValue(
"approx_maximum_steps");
66 nleq->approxTime =
getValue(
"approx_time");
67 nleq->relativeTolerance =
getValue(
"relative_tolerance");
68 nleq->maxIterations =
getValue(
"maximum_iterations");
69 nleq->minDamping =
getValue(
"minimum_damping");
70 nleq->broyden =
getValue(
"broyden_method");
71 nleq->linearity =
getValue(
"linearity");
73 double result = nleq->solve();
LLVM executable model interface.
Contains the base class for RoadRunner solvers.
Base class for all code generation systems; allows compiling and evaluating the model.
Definition: rrExecutableModel.h:118
Base class for NLEQ type steady state solvers.
Definition: NLEQSolver.h:17
double solveNLEQ()
main solver method.
Definition: NLEQSolver.h:48
SteadyStateSolver is an abstract base class that provides an interface to specific steady-state solve...
Definition: SteadyStateSolver.h:38
C_DECL_SPEC bool rrcCallConv getValue(RRHandle handle, const char *symbolId, double *value)
Get the value for a given symbol, use getAvailableTimeCourseSymbols(void) for a list of symbols.