Real-Time Simulation of Alcohol Dehydration Process as a Virtual Laboratory Work Taras Chaikivskyi, Dmytro Shevchenko and Vitaliy Yakovyna Lviv Polytechnic National University, Bandera str. 12, Lviv, 79013, Ukraine Abstract An example of web-based students’ laboratory work of the Department of Organic Products Technology of the Lviv Polytechnic National University is given. By computer modeling written in JavaScript, students have the opportunity to conduct their own additional experiments of one of the main processes of organic synthesis, namely the alcohols dehydration reaction. Through setting their own process conditions, students receive simulated values. The obtained values can be used to plot the dependences of the process parameters on the conditions, giving the opportunity to further train themselves by interpreting the results obtained from the graphs. Two variants of modeling calculation of chemical process are given. Additional experimental values also make it possible to more accurately plot dependencies that will better reflect the process. Students will have the opportunity to improve their skills to formulate conclusions about the process and the conditions of chemical process. Keywords 1 Modeling, Chemical Technologies, Education, JavaScript, HTML5. 1. Introduction Teaching students at the Department of Organic Products Technology of the Lviv Polytechnic National University have been conducted since 1965. The teaching consists of two parts: the first part is the study of theoretical materials that teachers give in lectures, and the second part is the practical application of acquired knowledge when working at laboratory equipment. Each laboratory work at the department reproduces one of the main processes of basic organic synthesis, which has its own specifics. Carrying out experiments by students are aimed to understand the chemical process depending on the selected conditions (temperature or concentration of the reagent). Experiments in each laboratory work differ by performance and time. The algorithm of each laboratory work is approximately identical: 1. preparation of the equipment; 2. establishing the conditions of the process; 3. preparation of reagents; 4. carrying out chemical reaction; 5. recording experimental values of process; 6. calculation of the received results and drawing graphs; 7. formulation conclusions about the process and selected conditions. Depending on the laboratory work, several experimental values are obtained that reflect the general influence of one or another factor on the chemical process. To encourage students to be independent and to conduct additional experiments by setting their own conditions, it will be advisable to use modeling of chemical processes. In the laboratory it takes some time to create certain IT&I-2020 Information Technology and Interactions, December 02–03, 2020, KNU Taras Shevchenko, Kyiv, Ukraine EMAIL: taras.v.chaikivskyi@lpnu.ua (T. Chaikivskyi); demonlemon2013@gmail.com (D. Shevchenko); vitaliy.s.yakovyna@lpnu.ua (V. Yakovyna) ORCID: 0000-0002-1166-8749 (T. Chaikivskyi); 0000-0001-5119-4288 (D. Shevchenko); 0000-0003-0133-8591 (V. Yakovyna) ©️ 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 26 process conditions such as time to heat or cool a reactor, which is limited to obtaining more experimental values. Nowadays, computer modeling is widely used for educational purposes. For good reasons, it can be called the improvement of the educational process by additional method of presenting information [1] and the ability to obtain simulated experimental data in less time than in real conditions of experiments [2,3]. The use of interactive modeling in the study of natural sciences allows a better understanding of the theoretical material [4], in addition, a systematic approach to modeling can be a method of developing theoretical knowledge for the development of algorithms [5]. In general, the use of computers to solve such problems is an appropriate approach, as the such virtual laboratory allows you to easily obtain experimental data in situations where practical work requires expensive equipment or demonstration of life-threatening processes [6-8]. So, using such approach provides a positive experience for students [9]. For example, a program that simulates laboratory titration of solutions to determine pH has been developed by Papadopoulos, N. and Limniou, M [10]. To model the work, students have the opportunity to choose an acid, a base, their concentration and an indicator to display changes in the pH of the virtual solution, as well as to control the rate of acid droplets from the burette. The visual component of the program allows seeing the change in colour of the solution in the titration process, which occurs by calculating the program according to Behr's law. As noted by the authors, a deeper understanding of the process requires a large number of experiments, which may not be possible for the allotted time of laboratory work. The created program provides students additional titration experience than it would be possible in the laboratory. Sarabando, C. [11] described the simulation that helps students independently study the physical concepts of mass and weight. Such computer modeling allows to investigate and verify experimental data, which contributes to the further development of scientific ideas about the concept of physical content of weight and mass. In paper [12] computer modeling, as an alternative learning tool, facilitates students' understanding of speed and acceleration. Creating a modeling program, using web technologies, is a very promising implementation of the educational process [13]. Today every student has access to the Internet via smartphone and laptop. Thanks to web technology it is possible to carry out additional experiments with their own conditions using computer calculations. Thus, Handayani, M. [14] faced the problem of lack of funds for students in the food products laboratory of agro-industrial technology. The decision was to create a web-based laboratory work that reproduced the study of water content and ash content. Molohidis, A. and others [15] have developed three virtual physics laboratory works - optical, heating and electrical. Based on Java applets, they run in real time on the client side, but currently most browsers do not support Java applets. Erich Stark and others [16] have solved the problem of cross-platform nature of several virtual works written in different computer languages by using JavaScript to execute code on the client side and Node.js on the server side. Another example is the SimuLab program [17], with which you can develop an understanding of inorganic chemistry and contributes to the formation of hypotheses in the simulation of laboratory work to determine unknown substances in solution by analytical methods. As authors noted, students rated the program positively and emphasized the appropriateness of virtual work use as it can be done at home. Sometimes the creation of simulation programs for laboratory work can be caused by a lack of proper equipment. However, if there is access to a computer with a browser installed and Internet access, you can work around this limitation and teach students through digital labs. The creation and implementation of such web-based laboratory work at the university level is a large-scale task that includes various nuances in the development of the program. Thus, in India, a laboratory project of virtual biotechnology Sakshat Amrita was created [18], which provides an opportunity to replace the course of physiology in the classroom. The authors note that the study of material on cutting the brain of rats in a real laboratory takes up to 3 weeks, while in virtual work you can teach a student in 6-10 hours. Our created web-based laboratory work simulation has been implemented by using JavaScript. The interpretation of the code in this programming language occurs during its execution and ensures the simulation in real time on the client side [19]. 27 2. Real laboratory work The developed virtual laboratory work is based on the laboratory equipment where the alcohol dehydration reaction is investigated. The point of this chemical reaction is the cleavage of the water molecule from the alcohol molecule to obtain the corresponding alkene in the gas phase and water: CH3-CH2-OH ⇄ CH2=CH2↑ + H2O The reaction is equilibrium i.e. the formed alkene can interact with the water molecule and form alcohol back. By changing temperature of the process and alcohol feed rate into the reactor, it regulates the rate of product formation and the equilibrium of the reaction. Controlling these parameters, at the same time intervals, different experimental values of the amount formed gas are obtained. Research equipment is presented in Figure 1. The gas meter is provided to determine the amount of formed gas (Figure 1, a). It accumulates the formed gas after the reaction. The volume is measured by displacing the filled water from the gas meter. Alcohol feed rate is regulated by the dispenser device (Figure 1, b). The process itself takes place in the reactor (Figure 1, c), in which temperature is regulated. During the experiment, students record the volume of formed gas in the gas meter at regular intervals. Experiments at the lab equipment are carried out three times at a constant temperature and different feed rates and twice at the same alcohol feed rate and different temperatures. Modeling program is based on the equipment block diagram (Figure 2). The input parameters are the alcohol feed rate and the temperature in the reactor. The reaction products begin to depart from the reactor:  water, which condenses with the help of a condenser and flows into the flask;  gas that enters the gas meter, where it displaces water from it, thereby changing the volume. a b c Figure 1: Laboratory equipment for alcohol dehydration reaction: a – gas meter; b – dispenser; c – reactor consists of a heat-resistant glass tube filled with a heterogeneous catalyst, electric heating device, thermal steam, thermal insulation. The aim of the students' work is to explore the dependence of the dehydration reaction on different temperatures and alcohol feed rate. As a result, different volume values are obtained. And according to the obtained experimental data, the values of alcohol conversion and the formed gas yield are 28 calculated. After calculations, graphs of dependences of conversions and yields on temperature and alcohol feed rates are drawn (Figure 3). Figure 2: Equipment block diagram of the process. 90 90 K,Y % K,Y % 80 80 Y Y 70 70 60 60 50 50 40 40 K K 30 30 20 20 10 10 0 0 300 320 340 360 380 400 0 1 2 3 4 5 T, C W, ml/min Figure 3: Graphs of dependences of conversions and product yields on temperature T and feed rates W received from experiments in laboratory. 3. Modeling The real results obtained by students during laboratory work for the last three years were used to create a mathematical model. This made it possible to collect a database for various organic alcohols in a wide temperature range with different process parameters. The main factors influencing the alcohol dehydration process have been selected: residence time in the reactor and the reaction temperature. We used a first-order kinetic reaction model for a plug-flow reactor operating in continuous mode and a material balance equation to calculate the parameters displayed on the screen. The block diagram of the program is shown in Figure 4. 29 Figure 4: The block diagram of the program Kinetic model. The kinetic model of the reaction is the functional dependence of the reaction rate of substances on the process conditions (temperature, pressure, concentration of reagents). The kinetic model for first-order equilibrium reaction is as follows: A⇄B 𝑟𝐵 = 𝑘1 𝐶𝐴0 (1 − 𝑥𝐴 ) − 𝑘2 𝐶𝐴0 𝑥𝐴 (1) where k – sped reaction constant: k1 for direct reaction, k2 for reverse reaction, xA.is conversion of reagent A, CAo – initial concentration of reagent A. 𝐸1 𝑘1 = 𝐾01 𝑒 − 𝑅𝑇 (2) 𝐸2 𝑘2 = 𝐾02 𝑒 − 𝑅𝑇 (3) where K0i – pre-exponent, Ei – reaction activation energy, R=8,314 – universal gas constant, T – temperature, From the kinetic model the reaction rate is a function of temperature and degree of conversion: 𝑟𝐴 = 𝑓(𝑥𝐴 , 𝑇) (4) 30 In equilibrium reactions, the change in temperature affects the reaction rate regardless of the thermal effect. Then for equilibrium reactions, the effect of temperature change on the rate is determined by whether the reaction is endothermic or exothermic. The sign of the thermal effect of the reaction, in turn, is determined by the ratio of the activation energies of the forward E1 and the reverse reaction E2. In the equilibrium state the condition is fulfilled: 𝑟𝐵 = 𝑘1 𝐶𝐴0 (1 − 𝑥𝐴 ) − 𝑘2 𝐶𝐴0 𝑥𝐴 = 0 (5) Hence, we can find conversion of the reagent A 1 1 𝑥𝐴 = 𝑘 = 𝐸1 −𝐸2 (6) 1+ 1 𝐾0 2 1+ 𝑒 𝑅𝑇 𝑘2 𝐾𝑜 1 This equation shows that each temperature corresponds to a certain value of reagent conversion xA. Material balance. The ideal displacement reactor is characterized that any element of the volume of the reacting medium moves along the height (or length) of the reactor parallel to the other elements, without interfering with the previous and subsequent volume elements. The material balance of such reactor at G0 = 0 is written in as follows: 𝐺𝑐𝑜𝑚𝑖𝑛𝑔 = 𝐺𝑙𝑒𝑎𝑣𝑖𝑛𝑔 + 𝐺𝑐.𝑟. (7) where Gcoming - the amount of substance entering the elementary volume per unit time; Goutlay - the amount of substance leaving the elemental volume in unit of time; Gc.r. - the amount of substance that is consumpted as a result chemical reaction proceeding in an elementary volume. The amount of substance is calculated as follows: 𝐺𝑐𝑜𝑚𝑖𝑛𝑔 = 𝐶𝐴 𝑉(1 − 𝑥𝐴 ) (8) 𝐺𝑙𝑒𝑎𝑣𝑖𝑛𝑔 = 𝐶𝐴 𝑉(1 − 𝑥𝐴 − 𝑑𝑥𝐴 ) (9) where V - the volume reaction feed rate of the mixture. In Appendix is a fragment of the program responsible for real-time data output (simple version without kinetic model, JavaSscript). 4. Virtual laboratory work The program for process modeling of alcohols dehydration reaction is developed using JavaScript and designed with HTML and CSS using free software Visual Studio Code (Figures 5, 6). Both real and virtual lab work takes place in real time without any pauses. The student must keep track of time and record experimental values, so to simulate such conditions there will be only one button to start the virtual process. To conduct the process, the student must first choose the alcohol in the title of the laboratory work that he plans to use (Figure 7). Then, for easier perception, the blocks on the left display (Figure 8) the parameters to be set, and by default they are already set. On the right display (Figure 9) are a stopwatch with a START button to start the program and a block to display intermediate gas formation results as the process progresses. Thus, choosing different input parameters, different gas volumes will be formed during the same time intervals (Figure 10). The simulation takes place in real time as well as real laboratory work. Therefore, it will not be possible to pause the process and the student must follow the process more closely as when working on the installation. The created program will allow not only to receive results on installation, but also to receive additional by simulation. Thus, obtained simulated experimental values are processed to calculate the reagent conversion values (in our case it is alcohol that we are researching) and product yields values (alkene in the form of gas). Based on these calculated values two graphs of dependences are plotted: 1) the of the conversion of alcohol on the temperature and alcohol rate and 2) the dependence of the yield of alkene on the temperature and alcohol rate. 31 Figure 5: HTML and CSS in Visual Studio Code. Figure 6: Program interface. Figure 7: Choosing an alcohol. The graphs dependences are quite informative because they encode information about the kinetics of the reaction. Using these data of the reaction, students can use the formulas of the reaction rate constant and the Arrhenius equation to calculate reaction parameters such as the activation energy of the reaction and the reaction rate constant itself. 32 So, it is possible now to calculate more conversions and product yields values after the experiments and use for plotting graphs dependencies as the student's ability to create and interpret graphs is one of the key learning skills that will allow the study to form a more detailed view of the impact of conditions. Figure 8: Set parameters of process. Figure 9: Blocks for a stopwatch and gas formation results. 5. Conclusions A web-based computer simulation of laboratory work for students at the Department of Organic Product Technology of the Lviv Polytechnic National University has been created. Computer simulation, which is performed using written JavaScript code, expands the possibility of laboratory work. Thus, students can carry out additional experiments to explore the effects of conditions on the chemical reaction, setting their own process parameters. To acquaint students with the equipment in the laboratory and the passage of the chemical reaction, first put real experiments on the laboratory installation. 33 Then, with the help of a computer simulation, students can continue to explore the effects of temperature and rate of alcohol on the process at home using a computer, as the program will be hosted on a server. At the same time, more research can be done, which will give more results for processing and, accordingly, more accurately reflect the effects of temperature and feed rate on the graphs of dependencies. Thus, students will be able to additionally acquire skills of interpretation of useful data from graphs based on the results obtained by the program. And the opportunity to form a deeper understanding of the dehydration reaction of alcohols and more clearly formulate conclusions about the factors influencing the conditions of the process. Figure 10: Simulation of ethanol dehydration reaction. We plan to supplement the database of kinetic parameters of the process of dehydration with experimental data obtained by students in the implementation of real laboratory works. This will allow us to enter additional factors influencing the process into the model. The operating time of the catalyst is especially important, because during its operation part of the specific surface area can be coked and, accordingly, the activity decreases with time, which affects the reaction rate and conversion of alcohol. This virtual laboratory work can be taken as a basis for modeling other processes of organic synthesis (oxidation, esterification, polymerization, chlorination and pyrolysis) studied by students in laboratory practice. 6. Acknowledgements We truly thank Vitaly Savchuk for conducting free training with Front-End Developer (Basic Course) and prof. Victor Reutskyi for providing technological advice on the process of dehydrogenation of alcohols. 34 7. References [1] Limniou, M., Papadopoulos, N., & Whitehead, C. (2009). Integration of simulation into pre- laboratory chemical course: Computer cluster versus WebCT. Computers & Education, 52(1), 45–52. doi:10.1016/j.compedu.2008.06.006 [2] Kumar, D. D., & Sherwood, R. D. (2007). Effect of a Problem Based Simulation on the Conceptual Understanding of Undergraduate Science Education Students. Journal of Science Education and Technology, 16(3), 239–246. doi:10.1007/s10956-007-9049-3 [3] Hennessy, S., Deaney, R., & Ruthven, K. (2006). Situated Expertise in Integrating Use of Multimedia Simulation into Secondary Science Teaching. International Journal of Science Education, 28(7), 701–732. doi:10.1080/09500690500404656 [4] Plass, J. L., Milne, C., Homer, B. D., Schwartz, R. N., Hayward, E. O., Jordan, T. Barrientos, J. (2012). Investigating the effectiveness of computer simulations for chemistry learning. Journal of Research in Science Teaching, 49(3), 394–419. doi:10.1002/tea.21008 [5] Hubalovsky, S. (2015). System Approach, Modeling, Simulation as Educational Technologies in Algorithm Development and Programming. Procedia - Social and Behavioral Sciences, 191, 2226–2230. doi:10.1016/j.sbspro.2015.04.267 [6] Zacharia, Z. C., Olympiou, G., &Papaevripidou, M. (2008). Effects of experimenting with physical and virtual manipulatives on students’ conceptual understanding in heat and temperature. Journal of Research in Science Teaching, 45(9), 1021–1035. doi:10.1002/tea.20260 [7] Climent-Bellido, M. S., Martínez-Jiménez, P., Pontes-Pedrajas, A., & Polo, J. (2003). Learning in Chemistry with Virtual Laboratories. Journal of Chemical Education, 80(3), 346. doi:10.1021/ed080p346 [8] Bhargava, Peeyush & Cunningham, Christine & Tolomeo, Michael & Zehnder, Alan. (2003). Virtual Labs, Real Data for Statics and Mechanics of Materials. [9] Chaikivskyi, T., Bauzha, O., Sus, B. B., Tmienova, N., & Zagorodnyuk, S. (2019). 3D simulation of virtual laboratory on electron microscopy. Paper presented at the CEUR Workshop Proceedings, , 2533 282-291. [10] Papadopoulos, N., & Limniou, M. (2003). pH Titration Simulator. Journal of Chemical Education, 80(6), 709. doi:10.1021/ed080p709.2 [11] Sarabando, C., Cravino, J. P., & Soares, A. A. (2014). Contribution of a Computer Simulation to Students’ Learning of the Physics Concepts of Weight and Mass. Procedia Technology, 13, 112– 121. doi:10.1016/j.protcy.2014.02.015 [12] Jimoyiannis, A., & Komis, V. (2001). Computer simulations in physics teaching and learning: a case study on students’ understanding of trajectory motion. Computers & Education, 36(2), 183– 204. doi:10.1016/s0360-1315(00)00059-2 [13] Achuthan, K., Sreelatha, K. S., Surendran, S., Diwakar, S., Nedungadi, P., Humphreys, S., … Mahesh, S. (2011). The VALUE @ Amrita Virtual Labs Project: Using Web Technology to Provide Virtual Laboratory Access to Students. 2011 IEEE Global Humanitarian Technology Conference. doi:10.1109/ghtc.2011.79 [14] Handayani, M. N., Khoerunnisa, I., & Sugiarti, Y. (2018). Web-Based Virtual Laboratory for Food Analysis Course. IOP Conference Series: Materials Science and Engineering, 306, 012083. doi:10.1088/1757-899x/306/1/012083 [15] Molohidis, A.; Lefkos, I.; Taramopoulos, A.; Hatzikraniotis, E. and Psillos, D. (2015). Web- based Virtual Labs - A Cosmos – Evidence – Ideas as a Design Framework Leading to Good Practice. In Proceedings of the 7th International Conference on Computer Supported Education - Volume 1: CSEDU, ISBN 978-989-758-107-6, 418-423. doi: 10.5220/0005477204180423 [16] Stark, E., Bistak, P., Kozak, S., & Kucera, E. (2017). Virtual laboratory based on Node.js technology. 2017 21st International Conference on Process Control (PC). doi:10.1109/pc.2017.7976245 35 [17] Josephsen, J., & Kristensen, A. K. (2006). Simulation of laboratory assignments to support students’ learning of introductory inorganic chemistry. Chem. Educ. Res. Pract., 7(4), 266–279. doi:10.1039/b6rp90013e [18] Diwakar, S., Achuthan, K., & Nedungadi, P. (2010). Biotechnology Virtual Labs - Integrating Wet-lab Techniques and Theoretical Learning for Enhanced Learning at Universities. 2010 International Conference on Data Storage and Data Engineering. doi:10.1109/dsde.2010.22 [19] Theisen, K.J. Programming languages in chemistry: a review of HTML5/JavaScript. J Cheminform 11, 11 (2019). doi:10.1186/s13321-019-0331-1 8. Appendix //Created by Shevchenko and Chaikivskyi "use strict"; let M = null; let Ro = null; let K = null; let Vol = null; function timerVol(from, to) { let spirt = document.getElementById('substance').value; // alkohol data switch (spirt) { case "etanol": M = 46.07; Ro = 0.789; K = 0.9; break; case "propanol": M = 60.1; Ro = 0.803; K = 0.8; break; case "izopropanol": M = 60.1; Ro = 0.786; K = 0.85; break; } let current = from; // matherial balance let timerId = setInterval(function () { document.getElementById("MyTimer").innerHTML=current; Vol = document.getElementById("speed").value*Ro/M*current*K*22.4/60; document.getElementById("volume").innerHTML = Vol.toFixed(1); if (current == to) { clearInterval(timerId); } current++; }, 1000); 36