Skip to content

Commit

Permalink
[NB] Simplify unmatched string (#12144)
Browse files Browse the repository at this point in the history
  • Loading branch information
phannebohm committed Mar 26, 2024
1 parent b8b1009 commit 3c8d879
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,22 @@ protected
protected
String s1, s2, s3, s4;
algorithm
s1 := if listEmpty(unmatched_vars) then "Not underdetermined.\n" else "Stage " + intString(listLength(unmatched_vars)) + " underdetermined.\n";
s2 := if listEmpty(unmatched_eqns) then "Not overdetermined.\n" else "Stage " + intString(listLength(unmatched_eqns)) + " overdetermined.\n";
s3 := StringUtil.headline_4("(" + intString(listLength(unmatched_vars)) + ") Unmatched variables:")
+ Slice.lstToString(unmatched_vars, BVariable.pointerToString) + "\n";
s4 := "\n" + StringUtil.headline_4("(" + intString(listLength(unmatched_eqns)) + ") Unmatched equations:")
if listEmpty(unmatched_vars) then
s1 := StringUtil.headline_4("Not underdetermined.");
s3 := "";
else
s1 := "Stage " + intString(listLength(unmatched_vars)) + " underdetermined.\n";
s3 := "\n" + StringUtil.headline_4("(" + intString(listLength(unmatched_vars)) + ") Unmatched variables:")
+ Slice.lstToString(unmatched_vars, BVariable.pointerToString) + "\n";
end if;
if listEmpty(unmatched_eqns) then
s2 := StringUtil.headline_4("Not overdetermined.");
s4 := "";
else
s2 := "Stage " + intString(listLength(unmatched_eqns)) + " overdetermined.\n";
s4 := "\n" + StringUtil.headline_4("(" + intString(listLength(unmatched_eqns)) + ") Unmatched equations:")
+ Slice.lstToString(unmatched_eqns, function Equation.pointerToString(str = "")) + "\n";
end if;
str := s1 + s2 + s3 + s4;
end toStringUnmatched;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,20 @@ simulate(underdetermined_init); getErrorString();
//
// Stage 1 underdetermined.
// Not overdetermined.
// *********************
//
// (1) Unmatched variables:
// **************************
// [STAT] (1) Real y (start = 2.0)
// slice: {};
//
// (0) Unmatched equations:
// **************************
//
// Created Start Equations for balancing the Initialization (1):
// ***************************************************************
// [SCAL] (1) y = $START.y ($RES_SIM_6)
//
// Not underdetermined.
// **********************
// Not overdetermined.
// (0) Unmatched variables:
// **************************
//
//
// (0) Unmatched equations:
// **************************
//
// *********************
// record SimulationResult
// resultFile = "underdetermined_init_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-6, method = 'dassl', fileNamePrefix = 'underdetermined_init', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ simulate(hybridSys); getErrorString();
//
// Stage 10 underdetermined.
// Not overdetermined.
// *********************
//
// (10) Unmatched variables:
// ***************************
// [DISS] (1) Real x_Start (start = 0.0)
Expand All @@ -68,10 +70,6 @@ simulate(hybridSys); getErrorString();
// slice: {};
// [PRE-] (1) Boolean $PRE.phase_Start
// slice: {};
//
// (0) Unmatched equations:
// **************************
//
// Created Start Equations for balancing the Initialization (10):
// ****************************************************************
// [SCAL] (1) $PRE.phase_Start = $START.phase_Start ($RES_SIM_41)
Expand All @@ -86,14 +84,9 @@ simulate(hybridSys); getErrorString();
// [SCAL] (1) $PRE.x_Start = $START.x_Start ($RES_SIM_50)
//
// Not underdetermined.
// **********************
// Not overdetermined.
// (0) Unmatched variables:
// **************************
//
//
// (0) Unmatched equations:
// **************************
//
// *********************
// record SimulationResult
// resultFile = "hybridSys_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-6, method = 'dassl', fileNamePrefix = 'hybridSys', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
Expand Down

0 comments on commit 3c8d879

Please sign in to comment.