Skip to content

Commit

Permalink
[C Runtime] Check DASSL step size (#11617)
Browse files Browse the repository at this point in the history
- Compared step size to order of magnitude of simulation duration
  • Loading branch information
AnHeuermann committed Nov 22, 2023
1 parent 24fa978 commit 0675b84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions OMCompiler/SimulationRuntime/c/simulation/solver/dassl.c
Expand Up @@ -600,10 +600,12 @@ int dassl_step(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo)
}

/* Check that tout is not less than timeValue
* else will dassl get in trouble. If that is the case we skip the current step. */
if (solverInfo->currentStepSize < DASSL_STEP_EPS)
* else will dassl get in trouble. If that is the case we skip the current step.
Also check if step size is smaller than DASSL_STEP_EPS or DASSL_STEP_EPS times simulation interval */
if ((solverInfo->currentStepSize < DASSL_STEP_EPS) ||
(solverInfo->currentStepSize < DASSL_STEP_EPS*(data->simulationInfo->stopTime - data->simulationInfo->startTime)) )
{
infoStreamPrint(LOG_DASSL, 0, "Desired step to small try next one");
infoStreamPrint(LOG_DASSL, 0, "Desired step size %e to small.", solverInfo->currentStepSize);
infoStreamPrint(LOG_DASSL, 0, "Interpolate linear");

/*euler step*/
Expand Down

0 comments on commit 0675b84

Please sign in to comment.