Skip to content

Commit

Permalink
- workaround for pivoting, report no error message if the first pivot…
Browse files Browse the repository at this point in the history
…ing fails because of singulare jacobian, the default selection is used in this cases

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14800 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Jan 16, 2013
1 parent 73ccb09 commit 813a6e5
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,8 @@ static int symbolic_initialization(DATA *data)
storePreValues(data);
overwriteOldSimulationData(data);

/* do pivoting for dynamic state selection */
stateSelection(data);
/* do pivoting for dynamic state selection */
stateSelection(data,0);
functionInitialEquations(data);

updateDiscreteSystem(data);
Expand All @@ -669,15 +669,15 @@ static int symbolic_initialization(DATA *data)
storeRelations(data);
storePreValues(data);

/* do pivoting for dynamic state selection */
stateSelection(data);
/* do pivoting for dynamic state selection */
stateSelection(data,0);
functionInitialEquations(data);
/* do pivoting for dynamic state selection if selection changed try again an */
if(stateSelection(data) == 1)

/* do pivoting for dynamic state selection if selection changed try again an */
if(stateSelection(data,1) == 1)
{
functionInitialEquations(data);
if(stateSelection(data) == 1)
if(stateSelection(data,1) == 1)
{
/* report a warning about strange start values */
THROW("Error, cannot initialize unique the dynamic state selection. Use -lv LOG_DSS to see the switching state set.");
Expand Down Expand Up @@ -966,7 +966,7 @@ int initialization(DATA *data, const char* pInitMethod, const char* pOptiMethod,
retVal = symbolic_initialization(data);
else
THROW("unsupported option -iim");

INFO(LOG_SOTI, "### SOLUTION OF THE INITIALIZATION ###");
INDENT(LOG_SOTI);
printAllVars(data, 0, LOG_SOTI);
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/solver/solver_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ int solver_main(DATA* data, const char* init_initMethod,
/******** End event handling ********/

/******** check state selection ********/
if (stateSelection(data))
if (stateSelection(data,1))
{
/* if new set is calculated reinit the solver */
solverInfo.didEventStep = 1;
Expand Down

0 comments on commit 813a6e5

Please sign in to comment.