Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 The Application of Fuzzy Logic With the Mamdani Method to Determine the Risk Zone for The Spread of Covid-19 in North Sumatra Dwi Nursyachbaini Universitas Sumatera Utara Korespondensi penulis: 2nursyachbaini@gmail. Suyanto Universitas Sumatera Utara Abstract. The method fuzzy is one part of the fuzzy inference system that is useful for drawing conclusions or the best decision in uncertain problems. Currently, about 200 countriesin the world are experiencing the Covid-19 pandemic. Various policies were carried out to overcome this. In addition to the health protocols that are always implemented,the community must also know the conditions of the area where they live so that they can anticipate any activities carried out. The method is used fuzzy to determine the risk zone for the spread of Covid-19 in North Sumatra Province based on 3 variables,namely positive cases, suspected cases, and dead cases. The data used in this study isweekly Covid-19 data from March 2021 to July 2021 for 4 selected areas, namely Medan City. Pematang Siantar City. Simalungun Regency, and Central Tapanuli Regency. All variables are represented using triangular curves and their membership functions are determined. Then the implication function of the min is used to determinethe rules used. From the results of the implication function, the composition between all the rules obtained is carried out by taking the maximum rule then that value is usedto modify the fuzzy area so that a new membership function is obtained. The method isused centroid to obtain a crisp or the final result is the value of the risk zone. This research also utilizes the Matlab to calculate the results. The results from the use of the Mamdani method will be compared with the real risk zone data so as to produce a75% average percentage similarity for the data for 4 regions in North Sumatra so it can be concluded that the model made is good enough to determine the risk zone for the spread of Covid-19 in North Sumatra Province. Keywords: Covid-19. Risk Zone. Fuzzy Logic. Mamdani Method. Abstrak. Metode fuzzy Mamdani merupakan salah satu bagian dari fuzzy inference system yangberguna untuk penarikan kesimpulan atau suatu keputusan terbaik dalam permasalahan yang tidak pasti. Saat ini, sekitar 200 negara di dunia mengalami pandemi Covid-19. Berbagai kebijakan dilakukan untuk mengatasi hal tersebut. Selainprotokol kesehatan yang selalu dijalankan, masyarakat juga harus mengetahui kondisiwilayah tempat tinggalnya sehingga dapat mengantisipasi setiap kegiatan yang dilakukan. Keadaan inilah yang menjadi dasar dari penelitian ini, dimana digunakan metode fuzzy Mamdani untuk menentukan zona risiko penyebaran Covid-19 di Provinsi Sumatera Utara berdasarkan 3 variabel yaitu kasus positif, kasus suspek, dankasus meninggal. Data yang digunakan pada penelitian ini adalah data mingguan Covid-19 pada bulan Received Febuari 07, 2023. Revised Maret 2, 2023. April 01, 2023 * Dwi Nursyachbaini, 2nursyachbaini@gmail. Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 Maret 2021 sampai Juli 2021 untuk 4 wilayah terpilih yaitu KotaMedan. Kota Pematang Siantar. Kabupaten Simalungun, dan Kabupaten Tapanuli Tengah. Seluruh variabel direpresentasikan menggunakan kurva segitiga dan ditentukan fungsi keanggotaannya. Kemudian digunakan fungsi implikasi metode min untuk menentukan aturan yang Dari hasil fungsi implikasi dilakukan komposisi antar semua aturan yang diperoleh dengan cara mengambil nilai maximum aturan kemudian nilai tersebut digunakan untuk memodifikasi daerah fuzzy sehingga diperoleh fungsi keanggotaan yang Kemudian digunakan metode centroid untukmemperoleh solusi crisp atau hasil akhir berupa nilai zona risikonya. Penelitian ini juga memanfaatkan aplikasi matlab untuk menghitung hasilnya. Hasil dari penggunaan metode Mamdani akan dibandingkan dengan data real zona risiko sehingga menghasilkan 75% persentase kesamaan ratarata untuk data 4 wilayah di Sumatera Utara sehingga dapat disimpulkan bahwa model yang dibuat sudah cukup bagus untuk menentukan zona risiko penyebaran Covid-19 di Provinsi Sumatera Utara. Kata Kunci: Logika Fuzzy. Fuzzy Inference System. Metode Mamdani. Covid-19. Zona Risiko. INTRODUCTION Fuzzy logic was first introduced in 1965 by Professor Lotfi A. Zadeh. Fuzzy logic is based on the theory of fuzzy sets, the role of degree of membership in determining the presence of a set of elements in sets is very important. Value membership or degree of membership is a key feature of fuzzy logic reasoning (Susilo,2. Fuzzy logic is a logic that has a value of ambiguity between true or false. In fuzzy logic theory, values can be either true or false at the same time. However, depending on the strength of membership, the degree of truth and error varies (Kusumadewi,2. Fuzzy logic is a theory of fuzzy sets based on membership functions. The membership function in fuzzy set theory is expressed in terms of membership degrees. Membership degree has an important position in a set, so membership degree is a key feature of fuzzy logic reasoning. One of the fuzzy logic is Mamdani fuzzy method. The Mamdani fuzzy method uses linguistic methods in the process and there is a fuzzy algorithm that can be analyzed mathematically to facilitate understanding. The Mamdani fuzzy method also pays more attention to the conditions that will occur for each fuzzy area, so as to produce more accurate decision results. Previous research on the Mamdani fuzzy method was research by Sestri Novia Rizki on Fuzzy Logic Predicting Work Accident Rates at PT Galang Kapal in Batam City . (Rizki,2. This study uses Mamdani fuzzy logic to predict employee THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA safety which can help reduce the risk of accidents for shipyard employees using input variables consisting of safety devices, procedures, locations, and techniques. addition, there is research by (Nurhayati& Immanudin,2. which states that Mamdani fuzzy logic can be used to predict hospital home appliance purchases based on the number of devices available and the number of damaged devices with an accuracy of 81. 1% . In YanarAos research, (Tugce et al, 2. also showed that the Mamdani fuzzy inference system is a suitable approach to generate multi-hazard vulnerability mapping . The membership function is a curve representing the mapping between data input points and their membership values . egrees of membershi. ranging from 0 to 1. One way to derive membership value to take a functional approach (Kusumadewi & Purnomo,2. In the Mamdani fuzzy method, the membership functions that can be used are ascending and descending linear membership functions, triangular membership functions and trapezoidal membership functions. In this research using Triangle Curve Representation. Figure 1. Representation of an triangle curve Membership function: ( )= atau Ou O O O O In 2020, as many as 200 countries in the world experienced a pandemic due to a disease called Coronavirus Disease 19 (Covid-. Covid-19 is an infectious disease caused by Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-. This disease first appeared in Wuhan. China as the cause of the outbreak of respiratory tract infections and then spread to other countries. Indonesia reported its first case of Covid19 on March 2, 2020 and the number is still growing today (Decree of the Minister of JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 Health of the Republic of Indonesia No. 434 of 2. Through the official website about Covid-19 in Indonesia . it was recorded that until April 2021, in Indonesia there were around 1,000,000 more cases of Covid-19. The Indonesian government has issued several policies to overcome the Covid19 pandemic. The policies are the policy of eliminating teaching and learning activities at schools and universities, doing work from home, performing worship from home, issue calls for physical and social distancing, and implement large-scale social restrictions (PSBB). In implementing these policies, the government must also pay attention to the situation and conditions of each region. Task Force or National Task Force to Accelerate Control of Covid-19 detailed 4 levels of regional zone criteria based on color . Color zone is the division of the area into several colors to dynamically monitor situations and conditions and improve different actions as needed so as to release the area from constraints whenever possible (Shen & Bar-yam,2. This zoning is very important to determine the level of alertness of an area. The more aware the public is when they are in the red zone position, the more alert the public is to the activities being carried out. RESEARCH METHOD The data source used in this study comes from the North Sumatra Provincial Health Office which is located at Jl. Prof. Yamin. SH No 41-AA in 2021. The data used in this study are secondary data. The data obtained are data on the number of positive cases, the number of suspected cases, and the number of dead cases in March 2021 - July 2021 every week. The research method that will be used is research with the following Reference search At this stage, the author collects references from books and journals related to Fuzzy Logic Mamdani method and the problems to be discussed which come from libraries and the internet. Data collection Data collection is carried out by the author by collecting data on the number of patients with positive cases of Covid-19, the number of suspected cases, and the number of dead cases originating from the North Sumatra Provincial Health Office. THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA Data identification Data identification is carried out by the author to determine data variables and the universe of conversations carried out in data analysis and Data processing Data processing will be done in two ways, namely: Data processing using the Mamdani fuzzy method. The steps are as follows: C Formation of fuzzy sets At this stage, the creation of fuzzy variable intervals is carried out as the basis for the formation of fuzzy sets. There are 4 variables in decision making in determining the Risk Zone, namely 3 variables as input (Positive Cases. Suspect Cases and Died Case. and 1 variable as output, namely the Risk Zone. Then each variable is represented in the form of a triangular curve and its membership function is determined using equation . C Application of implication functions . In the Mamdani method, the implication function used is the min method and then the value of is sought using equation . for each rule. C Rule composition From the results of the application of the implication function of each rule, the max . method is used to compose between all rules using equation . The fuzzy set solution is obtained by taking the maximum value of the rule, then using this value to modify the fuzzy area so that the membership function is obtained. C Defuzzification Defuzzification on the composition of Mamdani rules using the centroid method. In the centroid method using equation . , the crisp solution is obtained by taking the center point . *) of the fuzzy region. Then first calculate the moment and area for each region. Data processing using matlab software assistance Data processing in this study also utilizes the matlab auxiliary program application to calculate the results. C Determination of results and discussion After defuzzification, the results are obtained based on Mamdani fuzzy. Furthermore, these results will be compared with the real data and the percentage of similarity will be calculated. JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 C Making conclusions and suggestions At this stage, the author makes conclusions and suggestions from the results of the research that has been researched by the author. RESULT AND DISCUSSION Before carrying out the fuzzy-Mamdani stage, the data collected in this study includes data on the number of positive cases, the number of suspected cases, and the number of Covid-19 deaths for 4 regions in North Sumatra in the period between March 2021 to July 2021 every week. Data were obtained from the North Sumatra Provincial Health Office. After the data is obtained, data processing is carried out using the Mamdani fuzzy method. Formattion of Fuzzy Sets The data that has been determined by the universe of conversation will be formed into a fuzzy set with 3 fuzzy variables to determine the domain, so that it is obtained as shown in Table 1 below: Table 1. Formattion of Fuzzy Sets Functions Variable Names Positive Case Input Suspect Case Death Case Output Risk Zone Fuzzy Set Names Low Medium Height Low Medium Height Few Medium Many Yellow Zone Orange Zone Red Zone Conversation Universe Domains 70-801-1601 45-255-510 15-225-450 3-5-7 THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA Next, the fuzzy set will be determined from each input and output variable. Positive Case Variable To represent the positive case variable, a tringular curve is used as shown in Figure 2 below: Figure 2. Fuzzy set on positive case variable From the data, it is known that the number of positive cases is 1. 419 people. So: Suspect Case Variable . = 0 1601 Oe 1419 182 = 0,23 = 0 To represent the suspect case variable, a tringular curve is used as shown in Figure 3 below: Figure 3. Fuzzy set on suspect case variable JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 From the data, it is known that the number of positive cases is 552 people. So: Death Case Variable . = 0 = 0 552 Oe 450 102 = 0,23 To represent the death case variable, a tringular curve is used as shown in Figure 4 below: Figure 4. Fuzzy set on death case variable From the data, it is known that the number of positive cases is 396 people. So: Risk Zone Variable . = . = 0 450 Oe 396 = 0,24 = 0 To represent the risk zone variable, a tringular curve is used as shown in Figure 5 below: Figure 5. Fuzzy set on risk zone variable THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA From figure 8 it can be seen that the membership function used is a tringular curve representation, then the membership function of each fuzzy set in the risk zone variable is formulated as follows: Application Function Implication 3Oe a Oe3 a a 2 a7 Oe a a 2 Oe7 Ou3 1 < < 3 3O O5 5O O7 Ou7 7 < < 9 Ou9 After determining the membership function of the variable, the next step is the formation of fuzzy logic rules to determine the criteria for the Covid-19 risk zone. Fuzzy logic rules in this study were formed by combining existing sets, then the author analyzed which rules might occur based on the field data that had been collected. Next, we will look for the y-predicate and the Z value for each rule: [R. if (Positive is Mediu. and (Suspect is Hig. and (Death is Mediu. then (Zone is Orang. ,23. 0,23. = 0,23 [R. if (Positive is Mediu. and (Suspect is Hig. and (Death is Mediu. then (Zone is Re. ,23. 0,23. = 0,23 JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 Composition of Rules From the results of the application of the implication function of each rule, the max . method is used to perform the composition between all the rules. The results are as in Figure 6 as follows: Figure 6. Composition Result Area To determine the value of z*, it is done by dividing the area into 5 parts with each area, namely A1. A2. A3. A4, and A5. Then get the value of t1 = 3. 46, t2 = 6. 54, and t3 = thus, the membership function obtained for the result of this composition is as Oe3 a a 0,23 a 7Oe a Oe7 a a a 0,23 Deffuzyfication 3O O 3,46 3,46 O O 6,54 6,54 O 7,46 O O 7,46 The confirmation method . used is the centroid method. The first step to be taken is to calculate the moment for each membership value, which is as Oe3 = 0. 0,23 = 3. 7Oe = 0. THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA Oe7 = 0. 0,23 = 2. Futhermore, the calculation for each area is carried out as follows: Oe . 0,23 = 0,06 Oe )0,23 = 0,71 . )0,23 = 0,06 ( Oe . 0,23 = 0,06 = . Oe )0,23 = 0,35 Then the center point can be obtained from the following calculations: 0,17 3,54 0,35 0,38 2,93 0,06 0,71 0,06 0,06 0,35 7,37 = 5,94 1,24 Based on the calculations using the Mamdani method, it was found that the risk zone value for the Medan City area on March 7, 2021 was 5. 94 with the Orange Zone Defuzzyfication can also be done with the help of Matlab software version R2016a Fuzzy Toolbox. Confirmation using Matlab R2016a can be seen in Figure 7. JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 Figure 7. Composition Between Rules Furthermore, using the MATLAB software, calculations are carried out to determine risk zones in 4 regions in North Sumatra Province. The results of the risk zone using the Mamdani method are then compared with the actual zone. Then the calculation is carried out to determine the percentage of similarity between the calculation of the Mamdani method and the real data. The percentage of similarity is carried out to measure the level of accuracy of the results that have been carried out using the Mamdani method. Good or bad results can be seen through the percentage of similarity. Based on the results of the calculations that have been carried out, the results of the analysis can be summarized as follows: THE APPLICATION OF FUZZY LOGIC WITH THE MAMDANI METHOD TO DETERMINE THE RISK ZONE FOR THE SPREAD OF COVID-19 IN NORTH SUMATRA Tabel 3. Percentage of Similarities Region Percentage Similarity Kota Medan Kota Pematang Siantar Kabupaten Simalungun Kabupaten Tapanuli Tengah Average CONCLUSIONS Based on the results of the analysis and discussion that has been carried out, the authors conclude that Mamdani fuzzy logic can be used to determine the risk zone for the spread of Covid-19 in North Sumatra Province based on input variables, namely weekly data from positive cases, suspected cases, and dead cases. Where, this risk zone is very important to determine the level of alertness of an area. The Mamdani method can also be used because it has measured the accuracy of real data with data from the Mamdani FIS for 4 regions in North Sumatra Province using a percentage similarity that produces an average of 75% so that it can be concluded that the model made is good enough to determine the risk zone for the spread of Covid-19 in North Sumatra Province. In this study, the authors only used 3 input variables, namely weekly data on positive cases, suspected cases, and Covid-19 death cases, as well as 1 output variable, namely risk zones, each of which has 3 linguistic values. In future research, it is hoped that it can be developed from existing research using even more input variables. Then further research is also advised to conduct deeper field studies related to Covid-19 so as to get better research results by paying more attention to existing regulation. JURRIMIPA - VOLUME 2. NO. APRIL 2023 Jurnal Riset Rumpun Matematika dan Ilmu Pengetahuan Alam (JURRIMIPA) Vol. No. 1 April 2023 e-ISSN: 2828-9390. p-ISSN: 2828-9382. Hal 124-137 REFERENCES