Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit e93583a

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
[FMI] Set nominal to 1.0 as a default
This improves scaling of non-linear solvers. Also set a default linear solver for non-linear systems. Belonging to [maintenance/v1.12]: - #1903
1 parent 30c6ba5 commit e93583a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Compiler/Template/CodegenFMU.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3058,7 +3058,7 @@ template ScalarVariableTypeFMU(String attrstr, String unit, String displayUnit,
30583058
<%attrstr%>.max = <%optInitValFMU(maxValue,"DBL_MAX")%>;
30593059
<%attrstr%>.fixed = <%if isFixed then 1 else 0%>;
30603060
<%attrstr%>.useNominal = <%if nominalValue then 1 else 0%>;
3061-
<%attrstr%>.nominal = <%optInitValFMU(nominalValue,"0.0")%>;
3061+
<%attrstr%>.nominal = <%optInitValFMU(nominalValue,"1.0")%>;
30623062
<%attrstr%>.start = <%optInitValFMU(startValue,"0.0")%>;
30633063
>>
30643064
case T_BOOL(__) then

SimulationRuntime/c/simulation/solver/model_help.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ void initializeDataStruc(DATA *data, threadData_t *threadData)
939939
#else
940940
data->simulationInfo->nlsMethod = NLS_HOMOTOPY;
941941
#endif
942+
data->simulationInfo->nlsLinearSolver = NLS_LS_LAPACK;
942943
data->simulationInfo->lsMethod = LS_LAPACK;
943944
data->simulationInfo->lssMethod = LS_UMFPACK;
944945
data->simulationInfo->mixedMethod = MIXED_SEARCH;

0 commit comments

Comments
 (0)