Skip to content

Commit

Permalink
add relative tolerance to alg variables in daeMode
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Jun 23, 2016
1 parent a25d3fd commit e740f2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -3777,8 +3777,10 @@ template algebraicDAEVar(list<SimVar> algVars, String modelNamePrefix)
let nominalVars = (algVars |> var hasindex i fromindex 0 =>
(match var
case SIMVAR(__) then
'algebraicNominal[<%i%>] = <%crefAttributes(name)%>.nominal;
infoStreamPrint(LOG_SOLVER, 0, "%s -> %g", <%crefVarInfo(name)%>.name, algebraicNominal[<%i%>]);'
<<
algebraicNominal[<%i%>] = <%crefAttributes(name)%>.nominal * data->simulationInfo->tolerance;
infoStreamPrint(LOG_SOLVER, 0, "%s -> %g", <%crefVarInfo(name)%>.name, algebraicNominal[<%i%>]);
>>
end match)
;separator="\n")
Expand Down

0 comments on commit e740f2d

Please sign in to comment.