Skip to content

Commit 9492f9e

Browse files
lochelOpenModelica-Hudson
authored andcommitted
Fix homotopy debug dump
1 parent a7b3828 commit 9492f9e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

SimulationRuntime/c/simulation/solver/nonlinearSystem.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,9 @@ int solve_nonlinear_system(DATA *data, threadData_t *threadData, int sysNumber)
822822
sprintf(buffer, "%s_homotopy_nls_%d.csv", data->modelData->modelFilePrefix, sysNumber);
823823
infoStreamPrint(LOG_INIT, 0, "The homotopy path of system %d will be exported to %s.", sysNumber, buffer);
824824
pFile = fopen(buffer, "wt");
825-
fprintf(pFile, "\"sep=,\"\n%s,", "lambda");
825+
fprintf(pFile, "\"sep=,\"\n%s", "lambda");
826826
for(j=0; j<nonlinsys->size; ++j)
827-
fprintf(pFile, "%s,", modelInfoGetEquation(&data->modelData->modelDataXml, nonlinsys->equationIndex).vars[j]);
827+
fprintf(pFile, ",%s", modelInfoGetEquation(&data->modelData->modelDataXml, nonlinsys->equationIndex).vars[j]);
828828
fprintf(pFile, "\n");
829829
}
830830
#endif
@@ -839,9 +839,9 @@ int solve_nonlinear_system(DATA *data, threadData_t *threadData, int sysNumber)
839839
if(ACTIVE_STREAM(LOG_INIT))
840840
{
841841
infoStreamPrint(LOG_INIT, 0, "[system %d] homotopy parameter lambda = %g done\n---------------------------", sysNumber, data->simulationInfo->lambda);
842-
fprintf(pFile, "%.16g,", data->simulationInfo->lambda);
842+
fprintf(pFile, "%.16g", data->simulationInfo->lambda);
843843
for(j=0; j<nonlinsys->size; ++j)
844-
fprintf(pFile, "%.16g,", nonlinsys->nlsx[j]);
844+
fprintf(pFile, ",%.16g", nonlinsys->nlsx[j]);
845845
fprintf(pFile, "\n");
846846
}
847847
#endif
@@ -855,9 +855,9 @@ int solve_nonlinear_system(DATA *data, threadData_t *threadData, int sysNumber)
855855
if(lambda_steps > 1 && ACTIVE_STREAM(LOG_INIT))
856856
{
857857
infoStreamPrint(LOG_INIT, 0, "[system %d] homotopy parameter lambda = %g done\n---------------------------", sysNumber, data->simulationInfo->lambda);
858-
fprintf(pFile, "%.16g,", data->simulationInfo->lambda);
858+
fprintf(pFile, "%.16g", data->simulationInfo->lambda);
859859
for(j=0; j<nonlinsys->size; ++j)
860-
fprintf(pFile, "%.16g,", nonlinsys->nlsx[j]);
860+
fprintf(pFile, ",%.16g", nonlinsys->nlsx[j]);
861861
fprintf(pFile, "\n");
862862
fclose(pFile);
863863
}

0 commit comments

Comments
 (0)