Analytica 4.3 beta Release Notes/Changes in 4.3.0.22
This page lists changes in build 4.3.0.22 since build 4.3.0.19
Dates and Times
As described in What's new in Analytica 4.3?, date/time numbers are distinguished in Analytica 4.3 from real-value numbers. This allows both to be displayed in the same table using different formats (e.g., date format for dates, Suffix format for numbers). Several adjustments in this build, listed below, are focused on making the number format settings more intuitive.
- The Number Format Dialog has several refinements.
- Selecting Date (and adjusting the date settings) does not cause numbers in the view to be displayed as dates. Only date/time values are impacted by those changes.
- Instead, there is a new checkbox, Display numbers as dates, which is unchecked by default. You have to check this checkbox for real-numbers to be displayed as dates.
- When you've selected Date (and not checked Display numbers as dates), the format used for numbers is distinguished in an italics font.
- When you bring up the Number Format dialog, it will open with Date selected if your table contains all dates, or if a selected region starts with a date.
- When you enter something that can be interpreted (in full) as a date, time, or date and time, it will be parsed as a date/time number. Formerly this behavior only occurred when the number format was set to Date. Thus, if you enter:
- 2-10-2011
- into a definition, it will be parsed as 20-Feb-2011 (or with non-US regional settings, as 2-Oct-2011) rather than as two consecutive subtractions. In contrast, the definition:
- (2-10-2011)
- which includes parentheses is interpreted as the subtraction expression that evaluates to -2019. If you really want to suppress this "parse as date if possible" functionality, then check Display dates as numbers in the number format dialog.
- Note: You might consider setting Display dates as numbers on extremely long edit table that receive OLE-linked data or pasted data from an external source. The algorithm for testing whether the cell can be interpreted as a date does take some time, so if you are linking in million-cell tables, turning this setting off can speed up the parsing slightly.
- SpreadsheetRange and SpreadsheetCell read in date-valued cells as date-numbers in Analytica, and also adjust the value to match the actual date origin settings being used by both Excel and Analytica. Thus, dates and time read in correctly even if you haven't set the Use Excel Date Origin preference setting, or if you've changed the Excel-side preference to use the standard Analytica 1904 date-origin.
- SpreadsheetSetRange and SpreadsheetSetCell write date-values to Excel as date cells, again adjusting for the date origins used by both Analytica and Excel to ensure that a consistent date value is transferred.
, SpreadsheetSetRange and SpreadsheetSetCell read/write values as date-numbers when they are dates. For example, if Excel
- Sequence(date1,date2) produces date-numbers even when the «dateUnit» parameter is omitted.
Expressions
- You can now use multi-stage cascaded inequality expressions where a logical expression is expected. For example:
- This is equivalent to writing:
- The use of parentheses changes the interpretation. For example:
- tests that the boolean value,
p<=1, is greater than 0. The effect here is to test just thatp<=1.- This syntax does not create any backward compatibility issues, since a cascaded comparison syntax was rejected in Analytica 4.2.
Built-in Functions
- A problem was fixed with SpreadsheetRange when howToIndex:8 is used to automatically read the column headers. The column headers were previously offset by an amount related to the position of range in the original spreadsheet.
Optimization
- The processing of structured constraint expressions has been dramatically generalized in build 22. Formerly, constraints has to consist of an equality or inequality expression at the top level of the expression. With the new processing, the inequality can occur inside If-Then-Else expressions, Table cells, User-Defined Functions, after Local Variables are declared, inside Dynamic, etc. The following demonstrate possible definitions of a Constraint object that would not be accepted:
- Inside sub-expressions:
- Inside table cells:
- User-Defined Function constraints:
- FlowEquality(x1,x2,x3)
- where
- Function FlowEquality( z : ... ) :=
Sum(z) = 0
- with Local Variables:
- Inside dynamic:
- Statically-conditional constraints are now supported. When a constraint is array-valued with intrinsic indexes, your optimization contains an array of scalar constraints, one scalar constraint for each cell of the array. It may be the case, however, that only a subset of those cells are meaningful. Consider:
- You can express a conditional constraint as shown here with If-Then and no else clause, or equivalently as:
- or with any expression that produces the value of Null for cells that should have no constriant.
- We say a conditional constraint is static when the if-part does not depend on the decision variables. The support here applies only to this class of conditional constraints.
- In general, non-static (varying) conditional constraints (where the If-part depends on decision variable) will cause the problem to be treated as an NLP. When conditional constraints are present, the NLP solver requires the structure to remain consistent throughout the solution process. For example, if cell1 in the constraint array begins with an inequality constraint, then it cannot later change to an equality constraint or to Null (a disabled constraint). If such a change occurs, the solve aborts with an error.
- Note: Non-static (varying conditional constraints) can be encompassed into a linear program by utilizing auxilliary binary decision variables. This topic is covered at Formulations that Preserve Linearity for Optimization.
- Support for range-constraints. The following is an example of a range constraint:
- 10 <= 3*x + 4*y <= 20
- This constraint is now passed to the Frontline LP, QP or QCP engines as a single constraint. Since the built-in Frontline engines included with Analytica Optimizer have a limit on the maximum number of constraints (e.g., 8000 for LP/Quadratic, 2000 for SOCP Barrier), this fact may help keep your problem under the maximum number of variables.
- For a constraint to be treated as a range-constraint, far-left and far-right differ by a constant amount.
- When the constraint is a non-quadratic function of the decision variables, it will generally not be treated as a range constraint. The double comparison will, nevertheless, be captured correctly by passing two constraints to the underlying Frontline engine.
- Cascaded constraints having more than two consecutive comparisons are fully supported. Internally these will usually result in multiple constraints.
- The shadow price of a dual, or multi-stage, constraint is the smallest difference between the left- and right-hand side of each comparison that appears. For example, if at the solution the comparison were:
10 <= 18 <= 20, then the shadow price would be 2.
- The result table for Constraint Nodes now displays using a comparision syntax. The comparison syntax displays the value of both the left-hand and right-hand side of the constraint. So, instead of seeing just 0 and 1 (or False and True), you will see table cells such as:
{!}3 >= 1and5 <= 7. Cells where the constraint is violated are visually distinguished with preceding{!}characters.
- When you set the number format to Boolean, then it will display True and False instead of using the constraint syntax.
- If you use the value of a constraint object in the definition of another node, your expression "sees" values of 0 and 1 (for constraint violated or constraint satisfied).
Comments
Enable comment auto-refresher