Equations Dialog
Applicability: Cranium, Synapse (core versions 0315+)

Physical property data and estimates are often fitted to equations for analysis and dissemination. These equations are stored in each section's equations table control. For example, some equations for calculating Bubble Point Temperatures are shown below.

Sections use the Equations Dialog to add and edit Equations. This dialog is activated by clicking the left mouse button on the section's equations table control or by selecting the Edit Values command from the section's equations table control commands menu.

Each equation entry displays the equation's name, form and parameters. The independent variable is denoted by the character "X". The dependent variable is not shown. (See below for additional documentation on equations.)

Dialog Controls

The Equations dialog provides controls for editing equations, sorting values, and calculating values.

1
Table Control: displays the current list of equations. Each row contains the equation's name, form, limits, and coefficients. Clicking the left mouse button on a table row selects that table row. Clicking and holding the left mouse button down and then dragging the mouse will select several table rows. Double-clicking the left mouse button on a row selects the row and edits the contents of that row.
2
Edit Button: activates the Equation dialog enabling you to enter the equation's name, form, limits, a parameters. See below for documentation.
3
Commands Button: pressing the dialog's Commands button or clicking the right mouse button on the table control displays the commands menu. This menu provides standard commands for copying, pasting, and clearing phase equilibria equations. See the documentation on Common Menu Commands for details.
4
Sort Button: the dialog's Sort button will be enabled if two or more rows are selected. Pressing the Sort button activates the Sort Attribute dialog. This dialog enables you to sort curve points in ascending or descending order by the selected attribute.
5
Add Rows Button: pressing the Add Rows button will add rows to the bottom of the table control.
6
Calculate Button: pressing the Calculate button activates the Equation Values dialog which enables you to calculate equation results for a series of inputs. See below for documentation.
Commands Menu

Clicking the right mouse button within the dialog's table control or pressing the dialog's Commands button displays the Equations Dialog's commands menu.

The menu's commands enable you to copy, cut and paste values to and from the table control. See Common Menu Commands for documentation on the commands commonly found on command menus.

Equations

In Cranium and Synapse, equations have four key parts: 1) a name; 2) a form, also called the right-hand-side; 3) applicability limits; 4) coefficient values. The following values shows these four key parts for a typical equation:

Jul 16, 2021 at 09:20:47
Key Part Value
Equation Name MKS035-P101
Equation Form A + B*X + C*X^3
Composition, minimum 2.0
Composition, maximum 99.0
Coefficient A 340.72±0.44
Coefficient B -0.0984±0.014
Coefficient C 1.839E-05±1.3E-06

The equation's right hand side must one or more 'X' varaibles, coefficients, and mathematical operators. Multiplication operations must be written explicitly, i.e., you must write "A*X" and not "AX".

You made enter equation terms in any order and include any spacing you wish. However, keeping equations in a consistent format will make it easier to find and reuse equations.

Equation Dialog

Clicking the left mouse button on a row in the table control or selecting a row and pressing the Edit button, activates the Equation Edit Dialog. The dialog enables you to enter the equation's name, form, limits, parameters, and supporting information.

1
Equation Name Control: enables you to a short text string for the equation's name. (See below for additional documentation about equation names.
2
Equation Form Control: enables you to enter the 'right-hand-side' of the equation. Note that the application will check the validity of the entered equation before saving the dialog's entries. (See above for additional documentation about equation forms.
3
List Button: activates the Equations Dialog which enables you to select the equation's name and form from a list of current equations. An initial menu enables you to choose from a list of standard equations or a list of all equations present in the current document. (See below for additional documentation on the Equations Dialog.
4
Temperature Limits Controls: enables you to enter the minimum and maximum temperatures between which the equation is valid.
5
Pressure Limits Controls: enables you to enter the minimum and maximum pressures between which the equation is valid.
6
Composition Limits Controls: enables you to enter the minimum and maximum compositions between which the equation is valid.
7
Coefficient Controls: enables you to enter values for each of eight coefficients, labeled A through H. A coefficient can be any valid real number.
8
Coefficient Accuracy Controls: enables you to enter the accuracy of each coefficient value.
9
Comments Control: the Comments control enables you to enter general information to better describe the entered equation. Very often comments document the date of entry, the name of the person who entered the value, the units of the x and y variables, and the source of the equation.
10
Date, Phrase, Set Buttons: these buttons provide standard operations to help you enter comments. Pressing the Date button inserts the current date and time into the comment control. Pressing the Phrase button inserts the stored 'common phrase' into the comment control. Pressing the Set button enables you to change the 'common phrase'. (See documentation on the Set Phrase dialog for details.
Lists of Equations

Cranium and Synapse compiles two lists of equations: a list of standard equations; a list of all equations. These lists are available within various regression and editing dialogs. Pressing the Equation Dialog's List button enables you to access each list.

Standard equations are provide by MKS and are always available for selection and use. Some of these standard equations are shown in the table below.

Eqn Name Equation Form (RHS)
MKS001 A + B*X
MKS002 A + B*X + C*X^2
MKS003 A + B*X + C*X^2 + D*X^3
MKS009 exp(A + B*X)
MKS010 exp(A + B*X + C*X^2)

If you select the All Equations menu command, the application compiles all equations used for the current physical property and adds these to the list of stanandard equations.

The compilation of standard equations or all equations is displayed in the Equations Dialog.

Equation Names

Standard equations all have names of the form 'MKSXXX' where each X represents a number from 0 to 9. Many of the regressed equations included in MKS knowledge bases use this form as the core of the name and then append a suffix, e.g., '-T298', that provides some additional information. For example, if the equation is the result of regressing data at 298K.

Calculating Equation Values

When using the Equations Dialog, selecting an equation and pressing the dialog's Calculate button activates the Equation Values Dialog. This dialog enables you to enter an x value and then have the equation calculated for this x value.

1
Comment Control: displays the comment associated with the current equation. The comment may contain important information about units and limits of applicability that could influence you selection of x values.
2
Table Control: displays the input x values and the calculated y values.
3
Edit Button: activates the X Value Edit Dialog which prompts you for an x input value and, if present, displays the calculated y value.
4
X Series Button: activates the Equation Calculations Series Dialog that enables you to enter a minimum and maximum x value which the application will use to generate and assign a range of x values. The Series button is enabled if two or more table rows are selected.
5
Calculate Button: instructs the application to use the current equation to calculate an output y value for each input x value. These output y values are then displayed in the table control's Y Value column.
6
Commands Button: pressing the dialog's Commands button or clicking the right mouse button on the table control displays the commands menu. This menu provides standard commands for copying, pasting, and clearing phase equilibria data. See the documentation on Common Menu Commands for details.
7
Sort Button: the dialog's Sort button will be enabled if two or more rows are selected. Pressing the Sort button activates the Sort Attribute dialog. This dialog enables you to sort x values or y values in ascending or descending order.
8
Add Rows Button: pressing the Add Rows button will add rows to the bottom of the table control.
Tip: Copy x and y values to the scratchpad dialog for further editing

The output values calculated for equations are very often used as curve points. (See documentation on a Curve Points Dialog such as Temperature Dependent Curves Dialog or Compsition/Temperature/Pressure Dependent Curves Dialog for additional discussion on curve points.) However, additional state variables may be needed to be added before these values can be pasted into MKS documents.

Pasting the x and y values calculated from an equation into the Scratch Pad Dialog can be very useful. The Scratch Pad Dialog gives you the ability to add constant columns, e.g., temperatures or pressure, and calculate columns, e.g., the composition of component 2 when given the composition of component 1.

Example: Calculating values for a new equation
  1. Open the MKS Sample Knowledge Base document. (Open a "working" document or create a copy of a document (see here) if you are just experimenting with this functionality.)
  2. Make sure the current units are: K for temperature, kPa for pressure and kg/m3 for liquid density. (See documentation on the Property Units Dialog for details on changing units.)
  3. Change to the Chemicals Chapter and navigate to Vinyl chloride. (See the Navigation Overview documentation for details on navigating chapters and pages.)
  4. Scroll down to the Temperature/Pressure Dependent Section.
  5. Click on the property control and select 'Density, Liquid - f(T,P)' as the property and 'Data Values' as the values type.
  6. Click the left mouse button on the section's table control. The application activates the Data Edit Dialog.
  7. Click and hold the left mouse button on the table control's first row and drag the mouse downward selecting all data having the same temperature, e.g., 318.4 K in this example.
  8. Press the dialog's Regress button. The application activates the Values Regression Dialog.
  9. Change the dialog's: 1) X Attribute to 'Pressure'; 2) A Variable to 'Constant'; 3) B Variable to 'X'. Then press the dialog's Regress button. The resulting dialog should resemble the image below.
    1
    X Atrribute: set to Pressure
    2
    A Variable: set to Constant.
    3
    B Variable: set to X.
    4
    Regression Coefficients Controls Group: this controls group shows the values of the regressed coefficients and their associated standard error and confidence limits. The results shown in this example indicate that the selected equation fits the data with high confidence.
    5
    R-Squared Statistic: the Regression Statistics table shows various summary statistics to help you determine the accuracy of the fitted equation. The R-Squared metric in this example is very close to 1 indicating a very good fit of the data.
  10. Press the dialog's Points button. The application activates the Equation Values Dailog. The Regression Graph shows the input values as blue squares and several calculated equation output results as green diamonds.
  11. Press the dialog's Add Equation button.
  12. The application activates the Equation Edit Dialog. This dialog shows the values automatically generated by the regression procedure. These values include pressure limits, coefficient values, and a comment detailing the property estimated and the units of measure.
  13. You must enter a name for the regression equation. Press the dialog's List button, located at the dialog's top-right. The application activates the Equations Dialog which lists all the equations in the current document, including standard equations, that match the form of the current equation. In this example, the equation we developed matches the standard equation MKS001.

    Click the left mouse button one the table controls matching row and press the OK button.

  14. The name of the selected equation will be entered into the Equation Edit Dialog's Equation Name control. Then press the dialog's OK button. The dialog will save this equation into the current document.
  15. Close all the open dialogs (press the Done or Cancel buttons as needed) and return to the Temperature and Pressure Dependent Section. Click the section's property control and select 'Density, Liquid - f(T,P)' as the property and Equations as the values type.
  16. The section displays the equations table control which shows our newly added equation.
  17. Click the left mouse button on the section's equations table control. The application activates the Equations Edit Dialog.
  18. Click the left mouse button on the MKS001 equation we just added and then press the dialog's Calculate button. The application activates the Equation Values Dialog.
  19. Click and hold the left mouse button on the table control's first row and drag the mouse downward to select several rows.
  20. Press the dialog's X Series button. The application activates the Series Dialog. Enter a minimum value of 1000 and a maximum value of 4000. Then press the dialog's OK button.
  21. The dialog will generate a series of x values and add them to the table control.
  22. Press the dialog's Calculate button. The dialog will use the selected equation to calculate a y value for each input x value. These values will be added to the dialog's table control.
  23. Use the left mouse button to select the table control's rows containing calculated values or press the dialog's Commands button and then click on the Select All command.
  24. Click the left mouse button on the table control or press the dialog's Commands button to display the commands menu. Select the Copy Values command from the menu.
  25. Press the dialog's Done button and the Edit dialog's Cancel button to return to the knowledge base document.
  26. Select the Scratchpad command from the application's menu bar. The application will activate the Scratchpad Dialog.
  27. Click the left mouse button on the grid control's cell in row one and column two and press the dialog's Paste button. The dialog will insert our previously copied x and y values.
  28. Click and hold the left mouse button in the top-left cell, the cell in row one and column one. Then drag the mouse downward to the row containing the last of our x and y values. This will select all the cells immediately to the left of our entered values.
  29. Press the dialog's Function button. The application activates the Cell Function dialog. Enter 318.4 into the function control and press the dialog's Calculate button. (Although 381.4 is a constant value and not a function, using the Cell Function dialog is a convenient method for adding values to the Scratchpad Dialog's grid control.)
  30. Use the left mouse button to select all the values in the grid control. Then press the Scratchpad dialog's Copy button and finally the dialog's Done button.
  31. Click on the Temperature/Pressure Dependent Section's property control and select 'Density, Liquid - f(T,P)' as the property and Curve Points as the values type.
  32. Click the right mouse button on the section's table control. The application will display the curve points control menu.
  33. Select the menu's Paste Values command. Our copies values will be pasted into the section's table control.
  34. Scrolling downward to display the section's graph field. Change the x axis to display pressure. (See here for documenation on the graph field.) The graph shows the curve points calculated from our newly entered equation as a straight line.
Related Documentation
Topic Description
Getting Started using Synapse provides a quick tour of Synapse's capabilities including examples of chemical product design.
Getting Started using Cranium provides a quick tour of Cranium's capabilities including a discussion of structure editing.
Estimating Chemical Properties a short video demonstrating how to estimate the physical properties of chemicals using either Synapse or Cranium.
Estimating Mixture Properties a short video demonstrating how to estimate the physical properties of mixtures using either Synapse or Cranium.