Teaching Programming to Chemical Engineering Students

© 2021 Universitas Pendidikan Indonesia Andika and Putra, Teaching Programming to Chemical Engineering Students | 52 Open DOI: http://dx.doi.org/10. 17509/xxxxt.vxix pISSN 2775-6793 eISSN 2775-6815


Teaching Programming to Chemical Engineering Students
A B S T R A C T S A R T I C L E I N F O Programming (including coding, data science, and artificial intelligence) is one of the important top skills for chemical engineering undergraduate students, especially in the current era of Industrial Revolution 4.0 (IR 4.0). Despite its importance, there is almost no dedicated course for programming in the traditional chemical engineering curriculum in many universities. In this article, a future chemical engineering curriculum that includes a programming course is discussed and its integration into traditional courses is also proposed. This study proposes to use three software i.e., Microsoft Excel, GAMS, and Python to make students comfortable to programming so they can learn further by themselves. A representative case of classic logistics problem is presented as a case study. It is expected that this teaching strategy and the proposed example will improve students' cognition in programming.

INTRODUCTION
Programming skill is essential in the current era of Industrial Revolution 4.0 (IR 4.0). A study by Kamaruzaman et al. (2019) concludes that programming is one of the skill gaps between engineering and skills needed in the IR 4.0. This is an important matter because graduates from higher education institutions may not have this necessary skill required by the industry. At the same time, this matter can propagate the skill gaps and unemployment issues among engineering graduates.
In the recent years, the application of programming skill in many fields including engineering is shifted towards data science and Artificial Intelligence (AI). Several higher education institutions start to teach data science and AI to their students. One of them is TU Delft in the Netherlands that plans to educate all their students on AI.
Currently, open-source programming languages such as Python, Julia, and R are popular among academia, mainly for research and industry. Although they are widely used, these programming languages have a steep learning curve, especially for students who never work with Matlab or VBA (Visual Basic for Applications).
This article discusses the integration of programming and/or data science to the current chemical engineering undergraduate curriculum. As an example, one problem is presented and solved using Microsoft Excel, GAMS, and Python in this paper. This example can be broadly applied to any chemical engineering course such as numerical computation, chemical process simulation, or chemical engineering modelling. The discussion in this article is expected to be a useful contribution to restructuring the future chemical engineering undergraduate curriculum and the integration of programming into the traditional curriculum.

PROGRAMMING AND CHEMICAL ENGINEERING CURRICULUM
A study by the World Chemical Engineering Council on digitalization in chemical engineering education, particularly in the Asia-Pacific region, concluded that the future engineering undergraduate program curriculum should cover today's chemical engineering content accompanied by a graduate course on digital subjects such as mathematical modelling, programming tools and software, digital twins, algorithms and data structures, control systems and advanced sensors, data analytics and predictive maintenance, cyber security, and digital business models (Feise & Schaer, 2021).
The aforementioned study is supported by another study by Feise & Schaer (2021). They concluded that higher education institutions should regularly develop their teaching methodologies and content to meet changes in the materials and energy transformation industries. According to their study, numerical methods and AI are getting more and more important. Future engineers will not only need to be comfortable with commercial codes but also able to develop new ones.
A study by dos Santos et al. (2018) proposes a curriculum as depicted in Figure 1 where "Advanced Programming for Chemical Process" course is implemented with two basic characteristics which are taught at the end of the undergraduate year and as elective course. The same proposal was also expressed that "Data Science for Engineers" course is taught at the end of the undergraduate year as an elective course (Figure 2).
If the current curriculum does not have a dedicated programming or data science course and it cannot be restructured, we propose an easy integration to teach programming inserted into the existing courses.  Usually, programming is part of Process Systems Engineering (PSE) courses in the graduate program. Therefore, it is easier to integrate programming in PSE courses. For example, in chemical engineering modelling or optimization courses, students are taught linear programming in one session using Microsoft Excel, GAMS, and Python. As familiarity with a particular programming language takes time, students can begin to introduce themselves with the logical reasoning by using different program.
Microsoft Excel is proposed as the first software to use because it is intuitive software that it only takes relatively short time for students to be able to use it adequately. Thus, it does not take a long time to teach the software. Microsoft Excel can be used to solve simple to medium level numerical computation problems. Secondly, GAMS is selected because it is a high-level modelling system for mathematical programming and optimization. It means that the syntax is simple and easy to understand. Lastly, Python is chosen because it is one of the most popular and widely used programs. Although it is the hardest among the three programs, it can be used further to deal with data science. In the next chapter, we will use a modified classic problem and show how to solve a simple case study using these three programs.

PROBLEM
The problem was modified from a classic logistics problem taken from posted in the GAMS website (https://www.gams.com/). The original problem was solved. The classic problem was modified to give a clear picture of the problem to Indonesian students. The modified problem is as follows.
An operation director for company P wants to minimize the cost of transporting goods from two factories in Tegal and Tasikmalaya to three markets in Jakarta, Kebumen, and Bandung (Figure 3). The transportation cost per item per kilometer (f) is IDR 2,000. Information on distance, market demand, and inventory at the three factories is summarized in Table 1. Solutions to find the minimum transportation cost are presented as follows.

SOLUTIONS 4.1. Microsoft Excel
The problem can be solved using Microsoft Excel by employing a similar method as carried out by Mohamad et al. (2021). First, students need to make a problem definition such as decision variable, constraint, and objective function as depicted in Figures 4a and 4b. After that, the students can use a solver to solve the problem using one of three available solvers, Simplex LP, because it is a linear programming problem. This step is depicted in Figure 5.

GAMS
In GAMS, a model is a collection of statements delivered in the GAMS Language. Typically, a model needs to have sets, data, variables, equations, and model and solution statements. Different from Microsoft Excel, GAMS can solve complex problems such as renewable energy system by using a wide range of available solvers (Andika et al., 2019). By writing in GAMS, students are expected to be more comfortable with programming. The code to build GAMS model is shown as follows.  cost.. z =e= sum((i,j), c(i,j)*x(i,j)); supply(i).. sum(j, x(i,j)) =l= a(i); demand(j).. sum(i, x(i,j)) =g= b(j); Model transport / all /; Solve transport using lp minimizing z; Display x.l, x.m ;

Python
To solve the problem by using Python, the students need to install Pyomo (Pyomo, 2021). Pyomo is a Python-based package that supports a diverse set of optimization capabilities for formulating, solving, and analyzing optimization models. The code to build the Python model and its comparison with GAMS are shown as follows.

Results
The results of all simulations are the same because the problem is meant to be solved with simple linear programming. The minimum value of the objective function obtained is IDR 341,500,000. The value of decision variables is shown in Table 2.

CONCLUSION
A profound comprehension of programming is essential for chemical engineering undergraduate students in the IR 4.0 era. This paper is intended to highlight the integration of programming in the chemical engineering curriculum. A classic logistics problem was taken as an example. This example is expected to facilitate students' understanding of the nature of programming and its underlying mathematical models and logic along with the means to solve them.

AUTHORS' NOTE
The authors declare that there is no conflict of interest regarding the publication of this article. The authors have confirmed that the paper is free of plagiarism.