Numerical Calculation Errors
Under certain circumstances, numerical problems may occur for which there are special solutions. How to deal with the Steam turbine component after error message 8327 is described in the linked article. Possible solutions for temperature calculation problems are shown below.
For larger and more complex TOP-Energy models with the material models MM_Water considering temperatures or MM_Air and MM_Type_of_Fuel considering composition numerical problems can arise. These manifest themselves in the calculation of unrealistically low temperatures (of several hundred degrees below the freezing point) or unrealistically high values.
These simulation errors with physically implausible, too high or too low values are indicated by error message 8325:
Error while calculating the block . . .
Occurred at simulation time . . . , step no. . . .
A value outside the valid range has been calculated for a variable.
The incorrect (temperature) values are usually the result of numerical inaccuracy and have no influence on the optimization of the energy distribution in the system. In these cases, the affected component is switched off at the error time step. The component takes no energy from the system and does not add any energy to it.
The error message can also occur when the system is in operation. Then there is no numerical problem, but a modeling problem, which urgently needs to be solved otherwise!
The error message 8325 can also occur in cases without a temperature problem.
Check for Numeric Errors
There are several ways to check whether the negative temperature values only occur when the component is switched off.
Simulator Window
Checking the values in the Simulator window is the fastest method. By clicking on the time step, the simulator displays the corresponding date.
The following illustrations were created with an earlier version of TOP-Energy, so there are slight differences in the graphical program interface, but the functionality is the same. The first figure of the following series of pictures shows error message 8325 with the link to the faulty block at the error time.
On the second image of the slider, the error time step is displayed as Current time step in the simulator window after clicking on the blue link in the error message.
The third figure shows how the mass flow can be checked under the Variables tab in the Simulator window, for example. The mass flow is 0 at the error time in the example.
In the right part of the Simulator window, under the Variables tab, you can enter additional variables whose values are displayed at the same time. It is recommended to enter mass flows such as \( \dot{m}\). If you see that the mass flow is 0 at this time (i.e., no mass flows into the component) the value of the temperature is energetically irrelevant at this time.
Time Series
The second method to determine whether the negative temperature values only occur when the component is switched off is the time series preview.
To do this, activate the
Pin forms in the Home ribbon in the group Forms and look at the output time series in the corresponding form of the component (e.g., water_out of the Hot_Water_Boiler).
The first figure of the following slider shows how to call up the view for the forms.
The second figure shows that the numerical outliers for the negative temperatures only occur at times when the system is switched off (the mass flow is 0).
Causal Equation of the Energy Balance
If a component is not in operation and no energy is supplied or removed, the energy balances and equations of state are nevertheless solved. The reason for the error described above can be found in the following equation, which describes the thermal enthalpy flow:
\( \dot{H}_{therm} = \dot{m} \cdot c_p \cdot \Delta T \) (1)
When the system is switched off, neither an enthalpy nor a mass flow enters or exits. Therefore the equation:
\( 0 [kW] = 0\, [\frac{kg}{s}] \cdot c_p \cdot \Delta T \) (2)
The temperature can take practically any value and the equation remains valid in any case.
In fact, the physical question arises as to which temperature is the “right” one. If the system is switched off, no temperature can be clearly defined. The faulty temperatures do not represent energetically any errors, because they do not influence the energetic evaluation and the operating mode optimization at all.
When the system is switched off, the solver normally sets the undeterminable temperature (in the example shown: inlet temperature of Compression_Refrigeration_System server cooling) to the next previous temperature in the flow diagram (here: outlet temperature of heat exchanger server cooling).
However, small numerical inaccuracies in the thousandth range can cause different results.
Debugging
The previous section described why this “error” is of no energetic importance and can also be ignored for an economic evaluation or scheduling. Nevertheless, correct solving may be necessary, e.g., for an evaluation of the temperature views.
Four possibilities eliminating the problem are proposed below. Unfortunately, this numerical problem is project-specific and largely dependent on the complexity and size of the simulation. Therefore, these approaches only offer ideas and no guarantee can be given for their success.
Hide Error Message
The easiest way is to hide the annoying error message. The number of the message 8325 is entered in the Simulator window under Settings → Messages → Ignore the following (see following figure). This error message will no longer be displayed in the next simulation.
Simulator/Numeric Settings
Under certain circumstances, changes in the solver settings can contribute to solving the problem. In the Simulation form, the Advanced solution search can be enabled. You can also set the Gap for termination of the solver to 0 in the Simulation ribbon in the group Optimization.
For more information about gap values, see the (always same) explanations for error messages 8361, 8366 or 8371.
Limit Maximum Capacity (Big M value)
In systems of equations for mixed-integer optimization problems, so-called Big M method is often used. In simplified terms, inequalities are formulated in such a way that a binary variable is linked to a large limit value. However, it is advisable to select these limits as low as possible, since large size differences in the target function contributions of the optimization are always numerically unfavorable. The default values in the component templates are very large so that a physical barrier does not actually become effective. In practice, these values can be found as limit values in the following components, among others:
The maximum power output is several megawatts as standard and can be reduced in most applications without any problems.
The appropriate limitation of the Big M values also has a positive effect on the required computing time in many cases. Therefore, these measures are generally recommended!
The following figure shows how the Maximum cooling transfer can be limited in the Technical input data.
Model Changes (for advanced users)
Experience has shown that intervening in the system of equations by making minor changes to the model is often successful. However, such changes should only be made if it is actually not possible to ignore the error message. In some cases a thorough understanding of modeling is required.
In addition to the (general) equation (1) for the enthalpy calculation mentioned above, the MILP formulation is described in more detail here. The actual capacities of the energy-converting components (in the current example: the Compression_Refrigeration_System) are within the limits of minimum and maximum capacity or assume the value 0 (corresponds to “system switched off”). The binary variable bIsOn can assume the value 1 (system is in operation) or 0 (system is switched off). The Minimum and Maximum (cooling) capacity are taken from the Input data.
\( l\dot{Q}_{cool} \le bIsOn \cdot \dot{Q}_{cool,min} \) (3)
\( l\dot{Q}_{cool} \ge bIsOn \cdot \dot{Q}_{cool,max} \) (4)
The negative sign of cooling capacity \( l\dot{Q}_{cool}\) results from the convention to regard heat as positive and cold as negative capacity.
Input Data: Minimum Part Loads
If no Minimum part load is specified in the component, the equation is for the lower bound:
\( l\dot{Q}_{cool} \le bIsOn \cdot 0\, [kW] \) (5)
Numerically, this is unfavorable. Here is only considered the case the plant is switched off, therefore the equation:
\( 0\, [kW] \le bIsOn \cdot 0\, [kW] \) (6)
If the optimization variables are not calculated exactly equal to 0, but assume a very small value close to 0 (see the previous figure), the error extends up to the energy balances. In most cases, the problem can be solved if a Minimum part load (e.g., of 1 %) is specified in the component.
Force Supposed Operation (set bIsOn == 1)
If no Minimum part load can be specified, the solution of equation (5) can also be numerically simplified in another way: The Operational side condition Forced operation can be used to force the operation. Enter 1 in the Operation on/off input field. This sets the binary variable bIsOn to 1. The equation to force plant operation is:
\( bIsOn == 1 \) (7).
If no partial load is present, this does not represent a real restriction for operation either. The system can theoretically run at any desired low capacity, i.e., also at a capacity of 0. In this case, the system can practically not perform, although the corresponding binary variable is “in operation” (bIsOn = 1).








