Menu

Main Inicio Главная

Calculator - Polynomial approximation of data based on fuzzy sets

Calculadora - Aproximación polinomial de datos basada en conjuntos difusos

Калькулятор - Полиномиальная аппроксимация данных на основе нечетких множеств



Calculator - Computing of matrices in fuzzy linear systems

Calculadora: cálculo de matrices en sistemas lineales difusos

Калькулятор - Вычисление матриц в нечетких линейных системах

 

Dementia and courage

Polynomial approximation of fuzzy data and

solution of fuzzy systems of linear equations

There are a large number of data processing tasks. These can be tasks of analysis, planning, forecasting. The solution to the problem is reduced to the formalization of the data flow into a functional dependence. The definition of functional dependence is reduced to the approximation of data by a mathematical function. Let's consider the main types of dependencies. Mathematical functions can describe linear, non-linear, and cyclical changes in data. What mathematical function can be flexible enough to write such a variety of input parameters. We suggest using polynomial functions. A polynomial of the first degree will characterize a linear dependence, polynomials of higher degrees can describe nonlinear and periodic dependences. How to build a polynomial function describing the data flow? We propose to use a least squares data fit. For example, using MS EXCEL, the approximation by a second degree polynomial is as follows.

For a stream of model data with the following parameters:

Let us define the roots of the polynomial. The determination of the roots of the polynomial is realized by the least squares method. By solving a system of linear equations written in matrix form.

Implementation of the solution in MS EXCEL is not difficult. So the matrix of values is defined as follows.

The vector of values is defined as follows.

Let us write the equation in algebraic form: .

Where

From this equation we find x. .

Where

is the inverse of A.

To determine the inverse matrix, you need to calculate the determinant of the original matrix. The original matrix does not have to be singular. In this case, the determinant of the matrix A is 124.585. The inverse matrix takes on the following values.

Thus:

 

Based on the calculation results, it is possible to form a polynomial function of the second degree , which is actually shown by MS EXCEL .

Let's continue our reasoning using fuzzy numbers. We have developed hardware and software systems for the formation of an approximation matrix and a vector of fuzzy numbers and for conducting fuzzy matrix calculations, solving fuzzy systems of linear equations.

Let's prepare the initial data from the beginning in the form of singletons of fuzzy sets.

It is convenient to prepare data using MS EXCEL, and then copy the data to MS NOTEPAD or to a software package.

0.75  ,        0.75  ,        0.75  ,        0.75  ;

1.5    ,        1.5    ,        1.5    ,        1.5    ;

2.25  ,        2.25  ,        2.25  ,        2.25  ;

3       ,        3       ,        3       ,        3       ;

3.75  ,        3.75  ,        3.75  ,        3.75  ;

 

2.5    ,        2.5    ,        2.5    ,        2.5    ;

1.2    ,        1.2    ,        1.2    ,        1.2    ;

1.12  ,        1.12  ,        1.12  ,        1.12  ;

2.25  ,        2.25  ,        2.25  ,        2.25  ;

4.28  ,        4.28  ,        4.28  ,        4.28  ;

General view of data entry into the software package.

Press the "Computing" button and get the result consisting of two files.

The matrix A vector in the form of singletones will take the form.

 

Let's use MS EXCEL as an editor, fill in the input parameters for fuzzy matrix calculations, based on the data obtained.

A             ={                                                                                                                                                                                                                                                                                                                                                                                    

                1=            5,5,5,5;    11.25,11.25,11.25,11.25; 30.9375,30.9375,30.9375,30.9375;

                2=            11.25,11.25,11.25,11.25; 30.9375,30.9375,30.9375,30.9375; 94.921875,94.921875,94.921875,94.921875;

                        3=                   30.9375,30.9375,30.9375,30.9375; 94.921875,94.921875,94.921875,94.921875; 309.7617188,309.7617188,309.7617188,309.7617188;

}              ;                                                                                                                                                                                                                                                                                                                                                                                                     

b              =              {                                                                                                                                                                                                                                                                                                                                                                                     

                1              =              11.35       ,              11.35       ,              11.35       ,              11.35       ;                                                                                                                                                                                                                                                       

                2              =              28.995     ,              28.995     ,              28.995     ,              28.995     ;                                                                                                                                                                                                                                                       

                3              =              90.21375 ,               90.21375 ,               90.21375 ,               90.21375 ;                                                                                                                                                                                                                                                        

}              ;

INV=INV(A);

x=MUL(INV,b);

Press the "Computing" button and get the result from the stack of all variables.

The result of calculating the roots of the polynomial in the form of a singleton is contained in the variable ӸԮ

We see correct results for singletones. The next step will be the operation of software and hardware systems with triangular fuzzy numbers. Let's set the deviation of fuzzy numbers by 10% up and down.

 

X

0.675

,

0.75

,

0.75

,

0.825

;

 

1.35

,

1.5

,

1.5

,

1.65

;

 

2.025

,

2.25

,

2.25

,

2.475

;

 

2.7

,

3

,

3

,

3.3

;

 

3.375

,

3.75

,

3.75

,

4.125

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

y

2.25

,

2.5

,

2.5

,

2.75

;

 

1.08

,

1.2

,

1.2

,

1.32

;

 

1.008

,

1.12

,

1.12

,

1.232

;

 

2.025

,

2.25

,

2.25

,

2.475

;

 

3.852

,

4.28

,

4.28

,

4.708

;

Let's carry out calculations using the Zade expansion principle.

 

We will collect the received data into commands.

A                    =                     {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

                        1                     =                     5,5,5,5; 10.125,11.25,11.25,12.375; 25.059375,30.9375,30.9375,37.434375;

                        2                     =                     10.125,11.25,11.25,12.375; 25.059375,30.9375,30.9375,37.434375; 69.19804688,94.921875,94.921875,126.3410156;

                                               3                                           =                                           25.059375,30.9375,30.9375,37.434375; 69.19804688,94.921875,94.921875,126.3410156; 203.2346637,309.7617188,309.7617188,453.5221324;

}                      ;                                                                                                                                                                                                                                                                                        

b                     =                     {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

                        1                     =                     10.215                                 ,                       11.35             ,                       11.35             ,                       12.485                                  ;                                                                                                                                                                                                                                                                                                                                                                                                             

                        2                     =                     23.48595                             ,                      28.995          ,                       28.995          ,                      35.08395                             ;                                                                                                                                                                                                                                                                                                                                                                                      

                        3                     =                     65.76582375                     ,                       90.21375     ,                       90.21375     ,                       120.0745013                     ;                                                                                                                                                                                                                                                                                                                                                                                      

}                      ;

 

Checked the determinant of the matrix. The determinant of the matrix A is not equal to zero.

Found the roots of the system of equations.

We are using the received data. Let's write the polynomials and set the parameters ӘԮ

 

 

Let's carry out calculations using ordered fuzzy numbers.

 

 

Checked the determinant of the matrix. The determinant of the matrix A is not equal to zero.

Found the roots of the system of equations.

We are using this data. Let's write the polynomials and set the parameters ӘԮ

 

 

The resulting analysis showed the expected results. Calculations using the Zadeh extension show an exhaustive scatter of values, which guarantees that the parameters do not go beyond the defined values. Calculations with ordered fuzzy numbers characterize quantities that support the possibility of rigorous use in further analytical studies. The combined use of these two approaches will contribute to a more efficient solution of applied problems.

The factory produces products of three types: Products 1, Products 2 and Products 3. For their production, three types of raw materials are used: Raw materials 1, Raw materials 2, Raw materials 3. The consumption rates of each of them for one product and the volume of raw materials consumption for one day are set in the table:

Type of raw materials

Rates of consumption of raw materials per unit of production, conv. units

Daily consumption of raw materials, conv. units

Products 1

Products 2

Products 3

Raw materials 1

1.6, 1.6, 1.6, 1.6;

0.3, 0.3, 0.3, 0.3;

0.8, 0.8, 0.8, 0.8;

216, 216, 216, 216;

Raw materials 2

2.7, 2.7, 2.7, 2.7;

0.2, 0.2, 0.2, 0.2;

0.6, 0.6, 0.6, 0.6;

232, 232, 232, 232;

Raw materials 3

0.6, 0.6, 0.6, 0.6;

0.1, 0.1, 0.1, 0.1;

0.4, 0.4, 0.4, 0.4;

88, 88, 88, 88;

Find optimal production volumes.

If you operate with real numbers, then you can use Cramer's method to solve this problem.

Let's move from a clear solution to fuzzy numbers. Let's use MS EXCEL and write the input data describing the singletons of fuzzy sets.

 

A

=

{

1

=

1.6

,

1.6

,

1.6

,

1.6

;

0.3

,

0.3

,

0.3

,

0.3

;

0.8

,

0.8

,

0.8

,

0.8

;

2

=

2.7

,

2.7

,

2.7

,

2.7

;

0.2

,

0.2

,

0.2

,

0.2

;

0.6

,

0.6

,

0.6

,

0.6

;

3

=

0.6

,

0.6

,

0.6

,

0.6

;

0.1

,

0.1

,

0.1

,

0.1

;

0.4

,

0.4

,

0.4

,

0.4

;

}

;

b

=

{

1

=

216

,

216

,

216

,

216

;

2

=

232

,

232

,

232

,

232

;

3

=

88

,

88

,

88

,

88

;

}

;

Matrix operations commands:

DET = DET(A);

INV = INV(A);

x = MUL(INV,b);

The software package will return the result. And the actual parameters for us are the determinant of the matrix "A" and the values of the matrix "x". We see that the results obtained coincide with the values obtained by Cramer's method. Since we exploited singletons, it does not matter which method of calculation we used the Zade extension or ordered fuzzy numbers.

Let's continue our reasoning. Let's move from singletons to triangular numbers. Let's set the variation down to 10%. Let's prepare the data and use the methods of calculating the Zadeh extension or ordered fuzzy numbers.

A

=

{

 

1

=

1.44

,

1.6

,

1.6

,

1.76

;

0.27

,

0.3

,

0.3

,

0.33

;

0.72

,

0.8

,

0.8

,

0.88

;

2

=

2.43

,

2.7

,

2.7

,

2.97

;

0.18

,

0.2

,

0.2

,

0.22

;

0.54

,

0.6

,

0.6

,

0.66

;

3

=

0.54

,

0.6

,

0.6

,

0.66

;

0.09

,

0.1

,

0.1

,

0.11

;

0.36

,

0.4

,

0.4

,

0.44

;

}

;

b

=

{

1

=

194.4

,

216

,

216

,

237.6

;

2

=

208.8

,

232

,

232

,

255.2

;

3

=

79.2

,

88

,

88

,

96.8

;

}

;

 

The Zadeh extension method, as expected, gives a large scatter of the final values.

Using the same data, we will carry out the calculation for ordered fuzzy numbers.

Based on the properties of linear equations and a given deviation to the smaller / larger side of the same for the matrix “A” and the vector “b” gives a result similar to singleton.

To see the results represented by triangular numbers, let's define the matrix “A” as triangular numbers, and the vector “b” as a singleton. This will create some non-linearity that will affect the result.

A

=

{

1

=

1.44

,

1.6

,

1.6

,

1.76

;

0.27

,

0.3

,

0.3

,

0.33

;

0.72

,

0.8

,

0.8

,

0.88

;

2

=

2.43

,

2.7

,

2.7

,

2.97

;

0.18

,

0.2

,

0.2

,

0.22

;

0.54

,

0.6

,

0.6

,

0.66

;

3

=

0.54

,

0.6

,

0.6

,

0.66

;

0.09

,

0.1

,

0.1

,

0.11

;

0.36

,

0.4

,

0.4

,

0.44

;

}

;

 

b

=

{

1

=

216

,

216

,

216

,

216

;

2

=

232

,

232

,

232

,

232

;

3

=

88

,

88

,

88

,

88

;

}

;

In the considered examples, we deliberately limited the number of alpha levels in order to simplify the description of the processes. But for serious research, increasing them will give the calculations greater accuracy. For my research, I set the number of levels equal to 10. In general, the software and hardware systems presented have shown ample opportunities in the implementation of numerical fuzzy calculations in the framework of matrix systems and linear algebra problems.

PS

I completely forgot. I mentioned that first degree polynomials can work like linear functions.

Let's exploit this statement for data.

X

0.75  ,        0.75  ,        0.75  ,        0.75  ;

1.5    ,        1.5    ,        1.5    ,        1.5    ;

2.25  ,        2.25  ,        2.25  ,        2.25  ;

3       ,        3       ,        3       ,        3       ;

3.75  ,        3.75  ,        3.75  ,        3.75  ;

Y

2.5    ,        2.5    ,        2.5    ,        2.5    ;

1.2    ,        1.2    ,        1.2    ,        1.2    ;

1.12  ,        1.12  ,        1.12  ,        1.12  ;

2.25  ,        2.25  ,        2.25  ,        2.25  ;

4.28  ,        4.28  ,        4.28  ,        4.28  ;

The general configuration of the program will be as follows.

Let's prepare the data for matrix calculations.

A

=

{

1

=

5

,

5

,

5

,

5

;

11.25

,

11.25

,

11.25

,

11.25

;

 

2

=

11.25

,

11.25

,

11.25

,

11.25

;

30.9375

,

30.9375

,

30.9375

,

30.9375

;

 

}

;

 

 

 

b

=

{

 

1

=

11.35

,

11.35

,

11.35

,

11.35

;

 

2

=

28.995

,

28.995

,

28.995

,

28.995

;

 

}

;

 

DET = DET(A);

INV = INV(A);

x = MUL(INV,b);

Let's enter the above parameters into the software package.

The calculation result will look like.

The obtained parameters completely coincide with the linear function calculated by MS EXCEL for our model data.

  or  .

 

Moscow, Russia 12/12/2020 Zulfira Sadykova

 

Software development by Vladimir Abaev and Zulfira Sadykova

fuzzy.arithmetic.calculator@gmail.com