How do I fix a computed expression that has errors and I can’t determine the cause?

There are several possible causes that you can test with the utility “get_comp”.

This utility lets you experimentally test and computed expression. If the expression has an error, it will return an “null” result. The “get_comp” utility is launch from the command line with 1 or 2 arguments. The 1st argument is the expression you want to test and must be enclosed in double quotes. The 2nd argument is an optional argument to define the output units. If the 2nd argument is not used, the result will be in default (SI) units.

get_comp “…expression…” u=

Example:
get_comp “Speed * Torque” u=hp

If Speed and Torque represent valid CyFlex variables of engine speed and engine torque, then the output will have units of power. The detault units of power are “watts”, but the above requests that the output be displayed in horsepower.

COMMON errors:

  1. One or more to the variables do not exist. An error message should describe the missing variable{s}. Or use the “gvar” command to examine each variable.
  2. A constant is used without the attached units. For example:
    get_comp “idle_spd + 200”
    The correct expression would be “idle_spd + 200[rpm}”
  3. A complex expression has mismatched parenthesis. For example:
    get_comp “if idle_spd > ( ctl_spd ) then engine_stopping )”
    There must be an equal number of left and right parenthesis. The above example has an easy to spot problem, but on many complex expressions that may not be the case.
  4. When adding or subtracting temperature values you may get unexpected results. This is a somewhat complicated topic and I will refer you to another FAS entitled, “The temperature math problem”.
  5. When all else fails and you can’t readily see where the problem lies, break the expression down into separate short sections and use get_comp to evaluate each of the short sections. These sections should be those normally enclosed by parenthesis in your original expression.