JSCL simplify takes too long for some expressions, especially those which have rational expressions raised to a power greater than 3. For example, one expression encountered when running the omex round trip on published models consumes 240 seconds on a single expression simplification (sorry, I didn't save that expression).
JSCL simplification is now used during import/export and certain model transformations to cancel unit factors. There are currently some heuristics to skip this more expensive simplification for long expressions (fails over to Expression.flatten() when the infix string length of original expressions and intermediate expressions are longer than 100 characters.
Need to either understand how to limit the computation by one of the following:
altering the JSCL algorithm to introduce computational limits
or, make the simplification a process which is cancelable with a timeout
or, be more surgical in our use of this library.
see ExpressionUtils.simplifyUsingJSCL() and some unit tests in ExpressionUtilsJSCLFlattenTest for background.
JSCL simplify takes too long for some expressions, especially those which have rational expressions raised to a power greater than 3. For example, one expression encountered when running the omex round trip on published models consumes 240 seconds on a single expression simplification (sorry, I didn't save that expression).
JSCL simplification is now used during import/export and certain model transformations to cancel unit factors. There are currently some heuristics to skip this more expensive simplification for long expressions (fails over to Expression.flatten() when the infix string length of original expressions and intermediate expressions are longer than 100 characters.
Need to either understand how to limit the computation by one of the following:
see ExpressionUtils.simplifyUsingJSCL() and some unit tests in ExpressionUtilsJSCLFlattenTest for background.