Introduction

The creation of a liquid metal with a predetermined chemical composition requires a proper selection of charge materials. The mass fraction of each element in the charge can be determined so that the cost of the charge is as low as possible. A classic mathematical model for a task of calculating the most cost-effective proportions of charge materials is defined by an objective function as follows (Ref 1, 2)

$$ \sum\limits_{j = 1}^{N} {c_{j} x_{j} } $$
(1)

and a system of constraints

$$ \left\{ \begin{array}{l} \sum\limits_{j = 1}^{N} {A_{ij} x_{j} \ge A_{i}^{\hbox{min} } m} \hfill \\ \sum\limits_{j = 1}^{N} {A_{ij} x_{j} \le A_{i}^{\hbox{max} } m} \hfill \\ \;\;x_{j} \ge x_{j}^{\hbox{min} } \ge 0 \hfill \\ \;\;x_{j} \le x_{j}^{\hbox{max} } \le m \hfill \\ \sum\limits_{j = 1}^{N} {x_{j} = m} \hfill \\ \;\;i = 1,2, \ldots ,M \hfill \\ \end{array} \right. $$
(2)

where N—number of charge materials, cj—unit price of the jth charge material, for example (€/kg), xj—mass fraction of the jth charge material (kg), Aij—content of ith element in the jth charge material (%), A min i , A max i —minimum and maximum value of ith element content in the calculated charge material (%), m—weight of the calculated charge (kg), x min j , x max j —minimum and maximum value of the jth material mass in the charge (kg), M—number of chemical elements.

As the equalities and inequalities (1) and (2) are linear functions, an optimization task should be solved by using methods of mathematical linear programming (Ref 3,4,5,6). One of the most popular tools for optimization is MATLAB by MathWorks (Ref 7).

The solution for tasks (1)-(2) is the vector

$$ {\mathbf{x}}^{{{\mathbf{opt}}}} = \left[ {\begin{array}{*{20}c} {x_{1}^{\text{opt}} } & {x_{2}^{\text{opt}} } & \ldots & {x_{N}^{\text{opt}} } \\ \end{array} } \right]. $$
(3)

Its individual elements are values of the share of each charge material taken into account for calculations. These values (3) may constitute starting settings for weighing and measuring devices for charge materials intended for a foundry furnace.

The charge materials used in the casting industry are characterized not only by their chemical composition and cost, but also by their dispersion properties, which can have a considerable impact on the deviation of the test portion of material j from its optimal value x opt j . Such deviations occur particularly when ferrous or nonferrous alloys are produced out of scrap metals of different grades (Ref 8,9,10). Deviations in the measured charge materials may result from the method they are gathered. In publications (Ref 9, 10), the presented results refer to weighed portions of different ferromagnetic charge materials gathered by using an electromagnetic grab attached to a crane rail. The results of the studies presented herein confirmed that, given the same lifting force settings on the electromagnetic grab, a quite wide range of weights of charge material was obtained. It was also observed that for the same electromagnet control settings, a broad range of masses of weighed ferromagnetic materials was achieved, dependent on the type of material, its amount, and the homogeneity of its pieces.

The occurrence of deviations in weighing of individual charge materials during a charge composition process will compel workers to make decisions on possible corrections of the weighed material or other materials in the charge. Correction of the amounts of a given material sometimes results in a slight delay in preparing the charge and, therefore, a drop in the efficiency of a melting plant. To prevent that occurrence, an algorithm has been developed which aims to define a maximum allowable change in values of a given component of the charge which will still guarantee a proper chemical composition of the charge.

Definition of the Algorithm

The algorithm for defining the maximum allowable mass range of a selected component in a charge material characterized by a diverse chemical composition is conducted in the following stages:

Stage I

A mathematical model for an optimization task with an objective function (1) and a system of constraints (2) is prepared for a list of charge materials planned. The task is to obtain the vector xopt for the share values of individual charge materials at the lowest possible cost.

Stage II

Based on the values of vector xopt and on the maximum mass of individual lumps of every component, a list of charge materials y is generated in such an order that the materials listed first are the ones with the highest probability of deviation from the accepted optimal values. This list of charge materials ends with components which may be weighed and proportioned with very high precision. The parameter K is generated. It indicates a number of materials for which in subsequent stages, the maximum allowable mass range of a given component will be defined.

Stage III

It is assumed that p = 1. An optimization task is defined in which the objective function is

$$ y_{1}^{L} \to \hbox{min} $$
(4)

for the system of constraints

$$ \left\{ \begin{array}{l} \sum\limits_{j = 1}^{N} {A_{ij} y_{j} \ge A_{i}^{\hbox{min} } m_{{}} } \hfill \\ \sum\limits_{j = 1}^{N} {A_{ij} y_{j} \le A_{i}^{\hbox{max} } m_{{}} } \hfill \\ \,\,y_{j} \ge y_{j}^{\hbox{min} } \ge 0 \hfill \\ \,\, y_{j} \le y_{j}^{\hbox{max} } \le m_{{}} \hfill \\ \sum\limits_{j = 1}^{N} {y_{j} = m_{{}} } \hfill \\ i = 1,2, \ldots ,M \hfill \\ \end{array} \right. $$
(5)

After the tasks are solved (4)-(5), a further objective function is defined

$$ y_{1}^{R} \to \hbox{max} $$
(6)

and the optimization task for the system of constraints is solved (5). The final effect of this stage is the establishment of a range of values:

$$ y_{1} \in \left[ {y_{1}^{L} ;y_{1}^{R} } \right] $$
(7)

Next, the first charge material is weighed to obtain a value y *1 . It is checked to see whether the value y *1 fits the relation (7). If so, we move on to Stage IV, and if not the value of y *1 is corrected by another weighing or proportioning of the first material.

Stage IV

It is assumed that p = p + 1. It is checked to see whether the condition p  K is met. If not, we move on to Stage V. If yes, two optimization tasks are generated in which the objective functions are

$$ y_{p}^{L} \to \hbox{min} $$
(8)

and

$$ y_{p}^{R} \to \hbox{max} , $$
(9)

while the system of constraints is

$$ \left\{ \begin{array}{l} \sum\limits_{j = 1}^{N} {A_{ij} y_{j} \ge A_{i}^{\hbox{min} } m_{{}} } \hfill \\ \sum\limits_{j = 1}^{N} {A_{ij} y_{j} \le A_{i}^{\hbox{max} } m_{{}} } \hfill \\ y_{j} \ge y_{j}^{\hbox{min} } \ge 0 \hfill \\ \,\,y_{j} \le y_{j}^{\hbox{max} } \le m_{{}} \hfill \\ \,\,y_{1} = y_{1}^{*} \hfill \\ \,\,\ldots \hfill \\ \,\,y_{p - 1} = y_{p - 1}^{*} \hfill \\ \sum\limits_{j = 1}^{N} {y_{j} = m_{{}} } \hfill \\ \,\,i = 1,2,\ldots,M \hfill \\ \end{array} \right. $$
(10)

In this way, a range of values is obtained

$$ y_{p} \in \left[ {y_{p}^{L} ;y_{p}^{R} } \right] $$
(11)

which, after the weighing of the p component and establishing of the value y *p , allows for checking whether the value is within the range of a given relation (11). If not, the p component is weighed again. Then, we return to the beginning of Stage IV.

Stage V

After the weighing and/or proportioning, operations of K charge materials have been concluded, and every subsequent component of the charge is weighed in accordance with the solution for the next optimization task, in which the system of constraints is extended by the equation resulting from the weighing of the previous charge material. These steps are carried out until all the components taken into account in the calculations of charge materials have been weighed, which ends the algorithm.

An Example of Proposed Algorithm

To simplify the calculations presented in this chapter, zero values of melting loss have been assumed.

Table 1 presents the chemical composition and the prices of the charge materials included in the calculations.

Table 1 Sample data on chemical composition and prices of charge materials

Table 2 contains the required chemical composition of liquid cast iron after melting.

Table 2 Required chemical composition of the charge

In all the calculations, the mass of the charge being set was equal m = 1000 kg.

Stage I

At this stage, charge burden of the lowest cost is calculated by solving an optimization task, which involves determining variable values x1, x2, …, x7, in such a way that the objective function (batch cost), according to (1) defined in form

$$ f = 270x_{1} + 180x_{2} + 210x_{3} + 340x_{4} + 1300x_{5} + 980x_{6} + 930x_{7} $$
(12)

has reached the minimum value while meeting the limitations set by dependence (2) in form

$$ \left\{ {\begin{array}{*{20}c} {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \ge 3.3 \cdot m} \hfill \\ {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \le 3.4 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \ge 1.85 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \le 1.95 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \ge 0.75 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \le 0.85 \cdot m} \hfill \\ {0.02x_{1} + 0.01x_{2} + 0.09x_{3} + 0.03x_{5} + 0.17x_{6} + 0.01x_{7} \le 0.08 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \ge 0.05 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \le 0.07 \cdot m} \hfill \\ {250 \le x_{1} \le 400} \hfill \\ {x_{2} \le 400} \hfill \\ {x_{3} \le 300} \hfill \\ {x_{1} + x_{2} + x_{3} + x_{4} + x_{5} + x_{6} + x_{7} = m} \hfill \\ {m = 1000} \hfill \\ \end{array} } \right. $$
(13)

The solution of the function minimization task (12) with the restrictions (13) offers the charge burden as shown in Table 3.

Table 3 Optimal charge burden for the optimization task (12)-(13)

Stage II

The charge materials and their shares as given in Table 3 are the vector xopt. Until the next stage of the algorithm’s operation, it is assumed that the first three charge materials, marked as x1, x2 i x3, may have been weighed imprecisely. Therefore, the vector y = [x1x2x3] and K = 3.

Stage III

It is assumed that p = 1 ≤ K. Must be designated in accordance with (4) minimum variable value

$$ y_{1}^{L} = x_{1} \to \hbox{min} $$
(14)

with restrictions (13), then next

$$ y_{1}^{R} = x_{1} \to \hbox{max} $$
(15)

for the same restrictions (13).

The results of Stage III calculations are included in Table 4.

x7 = 1.10

x7 = 1.14

Charge cost = 241.91 €

Charge cost = 254.51 €

C = 3.40%

C = 3.40%

Si = 1.95%

Si = 1.95%

Mn = 0.85%

Mn = 0.85%

P = 0.04%

P = 0.03%

S = 0.070%

S = 0.068%

Table 4 Charge burden designated in Stage III

As can be seen from Table 4, the required chemical composition of the charge can be obtained for the share of special pig iron (y1= x1) in the range from 259.05 to 400.00 kg. The price of 1000 kg of charge burden grows accordingly from 241.91 to 254.51 €.

Before starting the calculations in Stage IV, the weight of the special pig iron has been established y *1 = 290 kg.

Stage IV

We assume the value of p = 2. Because p ≤ K, two optimization tasks should be solved, one for the objective function

$$ y_{2}^{L} = x_{2} \to \hbox{min} $$
(16)

and the other one for the objective function in the form

$$ y_{2}^{R} = x_{2} \to \hbox{max} $$
(17)

with the same restrictions

$$ \left\{ {\begin{array}{*{20}c} {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \ge 3.3 \cdot m} \hfill \\ {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \le 3.4 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \ge 1.85 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \le 1.95 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \ge 0.75 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \le 0.85 \cdot m} \hfill \\ {0.02x_{1} + 0.01x_{2} + 0.09x_{3} + 0.03x_{5} + 0.17x_{6} + 0.01x_{7} \le 0.08 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \ge 0.05 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \le 0.07 \cdot m} \hfill \\ {250 \le x_{1} \le 400} \hfill \\ {\varvec{x}_{{\mathbf{1}}} = {\mathbf{290}}} \hfill \\ {x_{2} \le 400} \hfill \\ {x_{3} \le 300} \hfill \\ x_{1} + x_{2} + x_{3} + x_{4} + x_{5} + x_{6} + x_{7} = m \hfill \\ m = 1000 \hfill \\ \end{array} } \right. $$
(18)

The solutions for both optimization tasks are summarized in Table 5.

Table 5 Calculation results of optimization tasks (16)-(18) and (17)-(18)

From Table 5, it can be seen that in order to get charge with a required chemical composition, with the participation of material x1= 290 kg, the share of steel scrap x2 must be within the range from 370.15 to 400 kg. Next, we assume that, for example, the share of this scrap has been weighed y *2 = 385 kg.

We accept p = 3. Again, p ≤ K, and hence, two optimization tasks should be solved, the first one for the objective function

$$ y_{3}^{L} = x_{3} \to \hbox{min} $$
(19)

and the other one for the objective function in the form

$$ y_{3}^{R} = x_{3} \to \hbox{max} $$
(20)

with the same restrictions

$$ \left\{{\begin{array}{*{20}c} {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \ge 3.3 \cdot m} \hfill \\ {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \le 3.4 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \ge 1.85 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \le 1.95 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \ge 0.75 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \le 0.85 \cdot m} \hfill \\ {0.02x_{1} + 0.01x_{2} + 0.09x_{3} + 0.03x_{5} + 0.17x_{6} + 0.01x_{7} \le 0.08 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \ge 0.05 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \le 0.07 \cdot m} \hfill \\ {250 \le x_{1} \le 400} \hfill \\ {x_{1} = 290} \hfill \\ {x_{2} \le 400} \hfill \\ {\varvec{x}_{{\mathbf{2}}} = {\mathbf{385}}} \hfill \\ {x_{3} \le 300} \hfill \\ {x_{1} + x_{2} + x_{3} + x_{4} + x_{5} + x_{6} + x_{7} = m} \hfill \\ {m = 1000} \hfill \\ \end{array}} \right. $$
(21)

The solutions for both optimization tasks are shown in Table 6.

Table 6 Calculation results of optimization tasks (19)-(21) and (20)-(21)

As shown in Table 6, the share of scrap iron x3 must be between 284.18 and 288.56 kg, to ensure the required chemical composition of the charge. By accepting y *3 = 286 kg, we finish Stage IV and move on to Stage V.

Stage V

For the values of material shares x1, x2, and x3 as determined in the previous stages, we calculate the shares of other charge materials by solving a task of minimizing the objective function (12) with constraints in the form of

$$ \left\{ {\begin{array}{*{20}c} {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \ge 3.3 \cdot m} \hfill \\ {3.85x_{1} + 0.16x_{2} + 3.04x_{3} + 98x_{4} + 0.12x_{5} + 6.78x_{6} + 0.4x_{7} \le 3.4 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \ge 1.85 \cdot m} \hfill \\ {0.04x_{1} + 0.07x_{2} + 1.85x_{3} + 73.7x_{5} + 0.96x_{6} + 0.35x_{7} \le 1.95 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \ge 0.75 \cdot m} \hfill \\ {0.03x_{1} + 0.15x_{2} + 0.72x_{3} + 75x_{6} + 0.42x_{7} \le 0.85 \cdot m} \hfill \\ {0.02x_{1} + 0.01x_{2} + 0.09x_{3} + 0.03x_{5} + 0.17x_{6} + 0.01x_{7} \le 0.08 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \ge 0.05 \cdot m} \hfill \\ {0.01x_{1} + 0.01x_{2} + 0.06x_{3} + 0.1x_{4} + 0.01x_{5} + 0.003x_{6} + 40x_{7} \le 0.07 \cdot m} \hfill \\ {250 \le x_{1} \le 400} \hfill \\ {x_{1} = 290} \hfill \\ {x_{2} \le 400} \hfill \\ {x_{2} = 385} \hfill \\ {x_{3} \le 300} \hfill \\ {\varvec{x}_{3} = {\mathbf{286}}} \hfill \\ {x_{1} + x_{2} + x_{3} + x_{4} + x_{5} + x_{6} + x_{7} = m} \hfill \\ {m = 1000} \hfill \\ \end{array} } \right. $$
(22)

The final charge burden for the target function optimization task (12) with the constraints (22) is shown in Table 7.

Table 7 Calculation results of the objective function minimization task (12) with constraints (22)

At this place, the proposed algorithm ends.

IT Implementation of the Algorithm

The implementation of the algorithm presented in this article requires:

  • setting up a reliable database containing the necessary information characterizing input materials and produced casting alloys,

  • developing in the selected programming language a set of functions and procedures performing calculations in the particular stages of programming,

  • specifying the form of presentation the calculations results and the set of additional procedures for controlling the dosage equipment, and

  • programming procedures for monitoring and archiving subsystems in the charge preparation process for foundry furnaces.

In order to test the functioning of the algorithm designed for determining a charge materials range in multistage charge burden optimization for foundry furnaces, the authors developed a relational database (PostgreSQL) containing a chemical composition and a unit price of individual input materials and a chemical composition of casting alloys. The program including the procedures for handling the database and performing calculations according to the algorithm has been executed with RAD STUDIO compiler by Embarcadero company. The program additionally includes auxiliary procedures for presenting and verifying the results of the calculations obtained. Test calculations carried out for industrial data from various foundries (iron and nonferrous alloys) confirmed the applicability of the algorithm designed by the authors.

Conclusions

The algorithm as presented in the article succeeded to indicate the maximum allowable mass range of individual components in a charge material of diverse chemical composition which allows for a development of an IT system assisting in the control of the process of composing the charge material for foundry furnaces. The algorithm is intended to increase the effectiveness of the process of preparing a charge from materials which may not be weighed and proportioned precisely.

The use of the proposed algorithm requires not only implementation of standardized procedures of calculating the charge burden with the lowest cost, but also a set of procedures for the creation of further objective functions and systems of constraints in subsequent optimization calculations. Due to a large number of optimization calculations which may prove necessary, access to computers with high processing power should be anticipated.

The simulation studies that have been conducted by the authors of the article show that application of the described algorithm in advanced mechanized systems for the preparation of charge materials for foundry furnaces may significantly improve the economic and ecological indicators of the foundry industry.