9 #include "Teuchos_UnitTestHarness.hpp"
10 #include "Teuchos_XMLParameterListHelpers.hpp"
11 #include "Teuchos_TimeMonitor.hpp"
13 #include "Thyra_VectorStdOps.hpp"
15 #include "Tempus_IntegratorBasic.hpp"
16 #include "Tempus_StepperDIRK.hpp"
18 #include "../TestModels/SinCosModel.hpp"
19 #include "../TestModels/VanDerPolModel.hpp"
20 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
25 namespace Tempus_Test {
29 using Teuchos::rcp_const_cast;
30 using Teuchos::ParameterList;
31 using Teuchos::parameterList;
32 using Teuchos::sublist;
33 using Teuchos::getParametersFromXmlFile;
40 #define TEST_PARAMETERLIST
41 #define TEST_CONSTRUCTING_FROM_DEFAULTS
43 #define TEST_VANDERPOL
44 #define TEST_EMBEDDED_DIRK
47 #ifdef TEST_PARAMETERLIST
52 std::vector<std::string> RKMethods;
53 RKMethods.push_back(
"RK Backward Euler");
54 RKMethods.push_back(
"IRK 1 Stage Theta Method");
55 RKMethods.push_back(
"Implicit Midpoint");
56 RKMethods.push_back(
"SDIRK 1 Stage 1st order");
57 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
58 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
59 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
60 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
61 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
62 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
63 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
64 RKMethods.push_back(
"SDIRK 2(1) Pair");
66 for(std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
68 std::string RKMethod = RKMethods[m];
71 RCP<ParameterList> pList =
72 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
75 RCP<ParameterList> scm_pl = sublist(pList,
"SinCosModel",
true);
78 RCP<ParameterList> tempusPL = sublist(pList,
"Tempus",
true);
79 tempusPL->sublist(
"Default Stepper").set(
"Stepper Type", RKMethods[m]);
81 if (RKMethods[m] ==
"IRK 1 Stage Theta Method" ||
82 RKMethods[m] ==
"Implicit Midpoint" ||
83 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
85 RCP<ParameterList> stepperPL = sublist(tempusPL,
"Default Stepper",
true);
86 RCP<ParameterList> solverPL = parameterList();
87 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
88 tempusPL->sublist(
"Default Stepper").remove(
"Default Solver");
89 tempusPL->sublist(
"Default Stepper")
90 .set<
double>(
"theta", 0.5);
91 tempusPL->sublist(
"Default Stepper").remove(
"Zero Initial Guess");
92 tempusPL->sublist(
"Default Stepper").set<
bool>(
"Zero Initial Guess", 0);
93 tempusPL->sublist(
"Default Stepper").set(
"Default Solver", *solverPL);
94 }
else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
96 RCP<ParameterList> stepperPL = sublist(tempusPL,
"Default Stepper",
true);
97 RCP<ParameterList> solverPL = parameterList();
98 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
99 tempusPL->sublist(
"Default Stepper").remove(
"Default Solver");
100 tempusPL->sublist(
"Default Stepper")
101 .set<
double>(
"gamma", 0.2928932188134524);
102 tempusPL->sublist(
"Default Stepper").remove(
"Zero Initial Guess");
103 tempusPL->sublist(
"Default Stepper").set<
bool>(
"Zero Initial Guess", 0);
104 tempusPL->sublist(
"Default Stepper").set(
"Default Solver", *solverPL);
105 }
else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
107 RCP<ParameterList> stepperPL = sublist(tempusPL,
"Default Stepper",
true);
108 RCP<ParameterList> solverPL = parameterList();
109 *solverPL = *(sublist(stepperPL,
"Default Solver",
true));
110 tempusPL->sublist(
"Default Stepper").remove(
"Default Solver");
111 tempusPL->sublist(
"Default Stepper").set(
"3rd Order A-stable",
true);
112 tempusPL->sublist(
"Default Stepper").set(
"2nd Order L-stable",
false);
113 tempusPL->sublist(
"Default Stepper")
114 .set<
double>(
"gamma", 0.7886751345948128);
115 tempusPL->sublist(
"Default Stepper").remove(
"Zero Initial Guess");
116 tempusPL->sublist(
"Default Stepper").set<
bool>(
"Zero Initial Guess", 0);
117 tempusPL->sublist(
"Default Stepper").set(
"Default Solver", *solverPL);
122 RCP<Tempus::IntegratorBasic<double> > integrator =
123 Tempus::integratorBasic<double>(tempusPL, model);
125 RCP<ParameterList> stepperPL = sublist(tempusPL,
"Default Stepper",
true);
126 RCP<ParameterList> defaultPL =
127 integrator->getStepper()->getDefaultParameters();
128 defaultPL->remove(
"Description");
131 if ( RKMethods[m] ==
"Implicit Midpoint" ) {
132 defaultPL->set(
"Stepper Type",
"Implicit Midpoint");
135 bool pass = haveSameValues(*stepperPL, *defaultPL,
true);
137 std::cout << std::endl;
138 std::cout <<
"stepperPL -------------- \n" << *stepperPL << std::endl;
139 std::cout <<
"defaultPL -------------- \n" << *defaultPL << std::endl;
146 RCP<Tempus::IntegratorBasic<double> > integrator =
147 Tempus::integratorBasic<double>(model, RKMethods[m]);
149 RCP<ParameterList> stepperPL = sublist(tempusPL,
"Default Stepper",
true);
150 RCP<ParameterList> defaultPL =
151 integrator->getStepper()->getDefaultParameters();
152 defaultPL->remove(
"Description");
155 if ( RKMethods[m] ==
"Implicit Midpoint" ) {
156 defaultPL->set(
"Stepper Type",
"Implicit Midpoint");
159 bool pass = haveSameValues(*stepperPL, *defaultPL,
true);
161 std::cout << std::endl;
162 std::cout <<
"stepperPL -------------- \n" << *stepperPL << std::endl;
163 std::cout <<
"defaultPL -------------- \n" << *defaultPL << std::endl;
169 #endif // TEST_PARAMETERLIST
172 #ifdef TEST_CONSTRUCTING_FROM_DEFAULTS
180 RCP<ParameterList> pList =
181 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
182 RCP<ParameterList> pl = sublist(pList,
"Tempus",
true);
185 RCP<ParameterList> scm_pl = sublist(pList,
"SinCosModel",
true);
191 stepper->setModel(model);
192 stepper->initialize();
196 ParameterList tscPL = pl->sublist(
"Default Integrator")
197 .sublist(
"Time Step Control");
198 timeStepControl->setStepType (tscPL.get<std::string>(
"Integrator Step Type"));
199 timeStepControl->setInitIndex(tscPL.get<
int> (
"Initial Time Index"));
200 timeStepControl->setInitTime (tscPL.get<
double>(
"Initial Time"));
201 timeStepControl->setFinalTime(tscPL.get<
double>(
"Final Time"));
202 timeStepControl->setInitTimeStep(dt);
203 timeStepControl->initialize();
206 Thyra::ModelEvaluatorBase::InArgs<double> inArgsIC =
207 stepper->getModel()->getNominalValues();
208 auto icSolution = rcp_const_cast<Thyra::VectorBase<double> > (inArgsIC.get_x());
210 icState->setTime (timeStepControl->getInitTime());
211 icState->setIndex (timeStepControl->getInitIndex());
212 icState->setTimeStep(0.0);
213 icState->setOrder (stepper->getOrder());
224 RCP<Tempus::IntegratorBasic<double> > integrator =
225 Tempus::integratorBasic<double>();
226 integrator->setStepperWStepper(stepper);
227 integrator->setTimeStepControl(timeStepControl);
230 integrator->initialize();
234 bool integratorStatus = integrator->advanceTime();
235 TEST_ASSERT(integratorStatus)
239 double time = integrator->getTime();
240 double timeFinal =pl->sublist(
"Default Integrator")
241 .sublist(
"Time Step Control").get<
double>(
"Final Time");
242 TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
245 RCP<Thyra::VectorBase<double> > x = integrator->getX();
246 RCP<const Thyra::VectorBase<double> > x_exact =
247 model->getExactSolution(time).get_x();
250 RCP<Thyra::VectorBase<double> > xdiff = x->clone_v();
251 Thyra::V_StVpStV(xdiff.ptr(), 1.0, *x_exact, -1.0, *(x));
254 std::cout <<
" Stepper = SDIRK 2 Stage 2nd order" << std::endl;
255 std::cout <<
" =========================" << std::endl;
256 std::cout <<
" Exact solution : " << get_ele(*(x_exact), 0) <<
" "
257 << get_ele(*(x_exact), 1) << std::endl;
258 std::cout <<
" Computed solution: " << get_ele(*(x ), 0) <<
" "
259 << get_ele(*(x ), 1) << std::endl;
260 std::cout <<
" Difference : " << get_ele(*(xdiff ), 0) <<
" "
261 << get_ele(*(xdiff ), 1) << std::endl;
262 std::cout <<
" =========================" << std::endl;
263 TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841470, 1.0e-4 );
264 TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.540304, 1.0e-4 );
266 #endif // TEST_CONSTRUCTING_FROM_DEFAULTS
274 std::vector<std::string> RKMethods;
275 RKMethods.push_back(
"RK Backward Euler");
276 RKMethods.push_back(
"IRK 1 Stage Theta Method");
277 RKMethods.push_back(
"Implicit Midpoint");
278 RKMethods.push_back(
"SDIRK 1 Stage 1st order");
279 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
280 RKMethods.push_back(
"SDIRK 2 Stage 3rd order");
281 RKMethods.push_back(
"EDIRK 2 Stage 3rd order");
282 RKMethods.push_back(
"EDIRK 2 Stage Theta Method");
283 RKMethods.push_back(
"SDIRK 3 Stage 4th order");
284 RKMethods.push_back(
"SDIRK 5 Stage 4th order");
285 RKMethods.push_back(
"SDIRK 5 Stage 5th order");
286 RKMethods.push_back(
"SDIRK 2(1) Pair");
288 std::vector<double> RKMethodErrors;
289 RKMethodErrors.push_back(0.0124201);
290 RKMethodErrors.push_back(5.20785e-05);
291 RKMethodErrors.push_back(5.20785e-05);
292 RKMethodErrors.push_back(0.0124201);
293 RKMethodErrors.push_back(2.52738e-05);
294 RKMethodErrors.push_back(1.40223e-06);
295 RKMethodErrors.push_back(2.17004e-07);
296 RKMethodErrors.push_back(5.20785e-05);
297 RKMethodErrors.push_back(6.41463e-08);
298 RKMethodErrors.push_back(3.30631e-10);
299 RKMethodErrors.push_back(1.35728e-11);
300 RKMethodErrors.push_back(0.0001041);
302 for(std::vector<std::string>::size_type m = 0; m != RKMethods.size(); m++) {
304 std::string RKMethod = RKMethods[m];
305 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
306 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
308 RCP<Tempus::IntegratorBasic<double> > integrator;
309 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
310 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
311 std::vector<double> StepSize;
312 std::vector<double> xErrorNorm;
313 std::vector<double> xDotErrorNorm;
315 const int nTimeStepSizes = 2;
318 for (
int n=0; n<nTimeStepSizes; n++) {
321 RCP<ParameterList> pList =
322 getParametersFromXmlFile(
"Tempus_DIRK_SinCos.xml");
325 RCP<ParameterList> scm_pl = sublist(pList,
"SinCosModel",
true);
329 RCP<ParameterList> pl = sublist(pList,
"Tempus",
true);
330 pl->sublist(
"Default Stepper").set(
"Stepper Type", RKMethods[m]);
331 if (RKMethods[m] ==
"IRK 1 Stage Theta Method" ||
332 RKMethods[m] ==
"Implicit Midpoint" ||
333 RKMethods[m] ==
"EDIRK 2 Stage Theta Method") {
334 pl->sublist(
"Default Stepper").set<
double>(
"theta", 0.5);
335 }
else if (RKMethods[m] ==
"SDIRK 2 Stage 2nd order") {
336 pl->sublist(
"Default Stepper").set(
"gamma", 0.2928932188134524);
337 }
else if (RKMethods[m] ==
"SDIRK 2 Stage 3rd order") {
338 pl->sublist(
"Default Stepper").set(
"3rd Order A-stable",
true);
339 pl->sublist(
"Default Stepper").set(
"2nd Order L-stable",
false);
340 pl->sublist(
"Default Stepper").set(
"gamma", 0.7886751345948128);
346 pl->sublist(
"Default Integrator")
347 .sublist(
"Time Step Control").set(
"Initial Time Step", dt);
348 integrator = Tempus::integratorBasic<double>(pl, model);
354 RCP<Thyra::VectorBase<double> > x0 =
355 model->getNominalValues().get_x()->clone_v();
356 integrator->initializeSolutionHistory(0.0, x0);
359 bool integratorStatus = integrator->advanceTime();
360 TEST_ASSERT(integratorStatus)
363 time = integrator->getTime();
364 double timeFinal = pl->sublist(
"Default Integrator")
365 .sublist(
"Time Step Control").get<
double>(
"Final Time");
366 double tol = 100.0 * std::numeric_limits<double>::epsilon();
367 TEST_FLOATING_EQUALITY(time, timeFinal, tol);
372 integrator->getSolutionHistory();
373 writeSolution(
"Tempus_"+RKMethod+
"_SinCos.dat", solutionHistory);
376 for (
int i=0; i<solutionHistory->getNumStates(); i++) {
377 double time_i = (*solutionHistory)[i]->getTime();
379 model->getExactSolution(time_i).get_x(),
380 model->getExactSolution(time_i).get_x_dot()));
381 state->setTime((*solutionHistory)[i]->getTime());
382 solnHistExact->addState(state);
384 writeSolution(
"Tempus_"+RKMethod+
"_SinCos-Ref.dat", solnHistExact);
388 StepSize.push_back(dt);
389 auto solution = Thyra::createMember(model->get_x_space());
390 Thyra::copy(*(integrator->getX()),solution.ptr());
391 solutions.push_back(solution);
392 auto solutionDot = Thyra::createMember(model->get_x_space());
393 Thyra::copy(*(integrator->getXdot()),solutionDot.ptr());
394 solutionsDot.push_back(solutionDot);
395 if (n == nTimeStepSizes-1) {
396 StepSize.push_back(0.0);
397 auto solutionExact = Thyra::createMember(model->get_x_space());
398 Thyra::copy(*(model->getExactSolution(time).get_x()),solutionExact.ptr());
399 solutions.push_back(solutionExact);
400 auto solutionDotExact = Thyra::createMember(model->get_x_space());
401 Thyra::copy(*(model->getExactSolution(time).get_x_dot()),
402 solutionDotExact.ptr());
403 solutionsDot.push_back(solutionDotExact);
409 double xDotSlope = 0.0;
410 RCP<Tempus::Stepper<double> > stepper = integrator->getStepper();
411 double order = stepper->getOrder();
414 solutions, xErrorNorm, xSlope,
415 solutionsDot, xDotErrorNorm, xDotSlope);
417 TEST_FLOATING_EQUALITY( xSlope, order, 0.01 );
418 TEST_FLOATING_EQUALITY( xErrorNorm[0], RKMethodErrors[m], 5.0e-4 );
425 #endif // TEST_SINCOS
428 #ifdef TEST_VANDERPOL
433 std::vector<std::string> RKMethods;
434 RKMethods.push_back(
"SDIRK 2 Stage 2nd order");
436 std::string RKMethod = RKMethods[0];
437 std::replace(RKMethod.begin(), RKMethod.end(),
' ',
'_');
438 std::replace(RKMethod.begin(), RKMethod.end(),
'/',
'.');
440 RCP<Tempus::IntegratorBasic<double> > integrator;
441 std::vector<RCP<Thyra::VectorBase<double>>> solutions;
442 std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
443 std::vector<double> StepSize;
444 std::vector<double> xErrorNorm;
445 std::vector<double> xDotErrorNorm;
447 const int nTimeStepSizes = 3;
450 for (
int n=0; n<nTimeStepSizes; n++) {
453 RCP<ParameterList> pList =
454 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
457 RCP<ParameterList> vdpm_pl = sublist(pList,
"VanDerPolModel",
true);
461 RCP<ParameterList> pl = sublist(pList,
"Tempus",
true);
462 pl->sublist(
"Default Stepper").set(
"Stepper Type", RKMethods[0]);
463 pl->sublist(
"Default Stepper").set(
"gamma", 0.2928932188134524);
467 if (n == nTimeStepSizes-1) dt /= 10.0;
470 pl->sublist(
"Default Integrator")
471 .sublist(
"Time Step Control").set(
"Initial Time Step", dt);
472 integrator = Tempus::integratorBasic<double>(pl, model);
475 bool integratorStatus = integrator->advanceTime();
476 TEST_ASSERT(integratorStatus)
479 time = integrator->getTime();
480 double timeFinal =pl->sublist(
"Default Integrator")
481 .sublist(
"Time Step Control").get<
double>(
"Final Time");
482 double tol = 100.0 * std::numeric_limits<double>::epsilon();
483 TEST_FLOATING_EQUALITY(time, timeFinal, tol);
486 StepSize.push_back(dt);
487 auto solution = Thyra::createMember(model->get_x_space());
488 Thyra::copy(*(integrator->getX()),solution.ptr());
489 solutions.push_back(solution);
490 auto solutionDot = Thyra::createMember(model->get_x_space());
491 Thyra::copy(*(integrator->getXdot()),solutionDot.ptr());
492 solutionsDot.push_back(solutionDot);
496 if ((n == 0) or (n == nTimeStepSizes-1)) {
497 std::string fname =
"Tempus_"+RKMethod+
"_VanDerPol-Ref.dat";
498 if (n == 0) fname =
"Tempus_"+RKMethod+
"_VanDerPol.dat";
500 integrator->getSolutionHistory();
507 double xDotSlope = 0.0;
508 RCP<Tempus::Stepper<double> > stepper = integrator->getStepper();
509 double order = stepper->getOrder();
512 solutions, xErrorNorm, xSlope,
513 solutionsDot, xDotErrorNorm, xDotSlope);
515 TEST_FLOATING_EQUALITY( xSlope, order, 0.06 );
516 TEST_FLOATING_EQUALITY( xErrorNorm[0], 1.07525e-05, 1.0e-4 );
521 Teuchos::TimeMonitor::summarize();
523 #endif // TEST_VANDERPOL
526 #ifdef TEST_EMBEDDED_DIRK
532 std::vector<std::string> IntegratorList;
533 IntegratorList.push_back(
"Embedded_Integrator_PID");
534 IntegratorList.push_back(
"Embedded_Integrator");
537 const int refIstep = 217;
539 for(
auto integratorChoice : IntegratorList){
541 std::cout <<
"Using Integrator: " << integratorChoice <<
" !!!" << std::endl;
544 RCP<ParameterList> pList =
545 getParametersFromXmlFile(
"Tempus_DIRK_VanDerPol.xml");
549 RCP<ParameterList> vdpm_pl = sublist(pList,
"VanDerPolModel",
true);
553 RCP<ParameterList> pl = sublist(pList,
"Tempus",
true);
554 pl->set(
"Integrator Name", integratorChoice);
557 RCP<Tempus::IntegratorBasic<double> > integrator =
558 Tempus::integratorBasic<double>(pl, model);
560 const std::string RKMethod_ =
561 pl->sublist(integratorChoice).get<std::string>(
"Stepper Name");
564 bool integratorStatus = integrator->advanceTime();
565 TEST_ASSERT(integratorStatus);
568 double time = integrator->getTime();
569 double timeFinal = pl->sublist(integratorChoice)
570 .sublist(
"Time Step Control").get<
double>(
"Final Time");
571 TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
575 RCP<Thyra::VectorBase<double> > x = integrator->getX();
576 RCP<Thyra::VectorBase<double> > xref = x->clone_v();
577 Thyra::set_ele(0, -1.5484458614405929, xref.ptr());
578 Thyra::set_ele(1, 1.0181127316101317, xref.ptr());
581 RCP<Thyra::VectorBase<double> > xdiff = x->clone_v();
582 Thyra::V_StVpStV(xdiff.ptr(), 1.0, *xref, -1.0, *(x));
583 const double L2norm = Thyra::norm_2(*xdiff);
586 if (integratorChoice ==
"Embedded_Integrator_PID"){
587 const double absTol = pl->sublist(integratorChoice).
588 sublist(
"Time Step Control").get<
double>(
"Maximum Absolute Error");
589 const double relTol = pl->sublist(integratorChoice).
590 sublist(
"Time Step Control").get<
double>(
"Maximum Relative Error");
596 const int iStep = integrator->getSolutionHistory()->
597 getCurrentState()->getIndex();
602 TEST_FLOATING_EQUALITY(std::log10(L2norm),std::log10(absTol), 0.3 );
603 TEST_FLOATING_EQUALITY(std::log10(L2norm),std::log10(relTol), 0.3 );
605 TEST_COMPARE(iStep, <=, refIstep);
609 std::ofstream ftmp(
"Tempus_"+integratorChoice+RKMethod_+
"_VDP_Example.dat");
611 integrator->getSolutionHistory();
612 int nStates = solutionHistory->getNumStates();
614 for (
int i=0; i<nStates; i++) {
615 RCP<const SolutionState<double> > solutionState = (*solutionHistory)[i];
616 double time_i = solutionState->getTime();
617 RCP<const Thyra::VectorBase<double> > x_plot = solutionState->getX();
619 ftmp << time_i <<
" "
620 << Thyra::get_ele(*(x_plot), 0) <<
" "
621 << Thyra::get_ele(*(x_plot), 1) <<
" " << std::endl;
626 Teuchos::TimeMonitor::summarize();
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
void writeSolution(const std::string filename, Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > solutionHistory)
Diagonally Implicit Runge-Kutta (DIRK) time stepper.
void writeOrderError(const std::string filename, Teuchos::RCP< Tempus::Stepper< Scalar > > stepper, std::vector< Scalar > &StepSize, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutions, std::vector< Scalar > &xErrorNorm, Scalar &xSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDot, std::vector< Scalar > &xDotErrorNorm, Scalar &xDotSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDotDot, std::vector< Scalar > &xDotDotErrorNorm, Scalar &xDotDotSlope)
TEUCHOS_UNIT_TEST(BackwardEuler, SinCos_ASA)
TimeStepControl manages the time step size. There several mechanicisms that effect the time step size...
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Keep a fix number of states.
van der Pol model problem for nonlinear electrical circuit.
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...