Skip to content

Commit

Permalink
fix initial guess of irksco on first step
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Feb 4, 2017
1 parent 79d3e32 commit cafab43
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions SimulationRuntime/c/simulation/solver/irksco.c
Expand Up @@ -213,9 +213,19 @@ int rk_imp_step(DATA* data, threadData_t* threadData, SOLVER_INFO* solverInfo, d
/* initial guess calculated via linear extrapolation */
for (i=0; i<userdata->ordersize; i++)
{
for (j=0; j<n; j++)
if (userdata->radauStepSizeOld > 1e-16)
{
solverData->x[i*n+j] = userdata->m[j] * (userdata->radauTimeOld + userdata->c[i] * userdata->radauStepSize )+ userdata->n[j] - userdata->y0[j];
for (j=0; j<n; j++)
{
solverData->x[i*n+j] = userdata->m[j] * (userdata->radauTimeOld + userdata->c[i] * userdata->radauStepSize )+ userdata->n[j] - userdata->y0[j];
}
}
else
{
for (j=0; j<n; j++)
{
solverData->x[i*n+j] = userdata->radauVars[i];
}
}
}

Expand Down

0 comments on commit cafab43

Please sign in to comment.