Implementing Newton-Raphson Method Algorithm in 6 Programming Languages’ Solution to Van Der Waals Equation of State

Authors

  • Abdulhalim Musa Abubakar1 Department of Chemical Engineering, Faculty of Engineering, Modibbo Adama University, Adamawa State
  • Eva Schieferstein Fraunhofer Institute UMSICHT
  • Volodymyr Kutarov Research Institute of Physics, I. I. Mechnikov National University
  • Muhammad Tayyab Bilal Computer Science Department, University of Agriculture Faisalabad Punjab
  • Chantawan Noisri Department of Mathematics and Statistics, Faculty of Science, Thaksin University, Phatthalung
  • Bello Iliyasu Department of Mathematics, Modibbo Adama University, Adamawa State

DOI:

https://doi.org/10.55927/fjcis.v2i1.3953

Keywords:

Van Der Waals Equation of State, Newton Method, Programming Language, Numerical Methods, Java

Abstract

Newton’s method can be implemented for the Van der Waals equation of state (VDW EOS) and its derivatives. Application of programming language in chemical engineering is not new but however limited in practice, as it is not included in the curriculum of students of tertiary institutions across the globe. Finding roots through iteration for the VDW EOS can be described as interesting and simple using C++, FORTRAN, R, MATLAB, Java and Python languages; even though a perfect programming language does not exist. In this work, the coding syntax in the six languages employed to solve parameters in VDW EOS differs in terms of simplicity and user-friendliness. Notwithstanding, all of them proves to be an adaptable software, capable of solving chemical engineering problems leading to nonlinear relations

Downloads

Download data is not yet available.

Author Biographies

Abdulhalim Musa Abubakar1, Department of Chemical Engineering, Faculty of Engineering, Modibbo Adama University, Adamawa State

 

 

Eva Schieferstein, Fraunhofer Institute UMSICHT

 

 

Volodymyr Kutarov, Research Institute of Physics, I. I. Mechnikov National University

 

 

Muhammad Tayyab Bilal, Computer Science Department, University of Agriculture Faisalabad Punjab

 

 

Chantawan Noisri, Department of Mathematics and Statistics, Faculty of Science, Thaksin University, Phatthalung

 

 

Bello Iliyasu, Department of Mathematics, Modibbo Adama University, Adamawa State

 

 

References

Abubakar, A. M., Elshahhat, A., Ndaba, S., Mobolaji, A. T., Thiagarajan, B., & Mansour, E. M. (2023). Chemical engineering numerical analysis with R: Peng–Robinson equation of state. Journal of Data Science and Intelligent Systems (JDSIS), 00(00), 1–20. https://doi.org/10.47852/bonviewJDSIS3202665

Abubakar, A. M., Francis, O. C., Sarkinbaka, Z. M., & Yahaya, M. S. (2021). Simplex C++ syntax for solving chemical engineering cost optimization problems. Research Inventy: International Journal of Engineering And Science, 11(7), 39–47. https://doi.org/10.5281/zenodo.5146856

Abubakar, A. M., & Mustapha, A. A. (2021). Newton’s method cubic equation of state C++ source code for iterative volume computation. SSRG International Journal of Recent Engineering Science, 8(3), 12–22. https://doi.org/10.14445/23497157/IJRES-V8I3P103

Adams, M. D. (2021). Lecture slides for programming in C++ [The C++ language, libraries, tools, and other topics] (p. 2887). Department of Electrical and Computer Engineering: University of Victoria. http://www.ece.uvic.ca/~mdadams/cppbook

Ahuja, P. (2019). Introduction to numerical methods in chemical engineering (2nd ed.). PHI Learning Private Limited (Delhi-110092)

Al-Malah, K. I. M. (2014). MATLAB-Numerical methods with chemical engineering applications. McGraw-Hill Education: Cenveo Publisher Services

Albrecht, J. (2021). Step into the digital age with Python (p. 47). American Institute of Chemical Engineers (AIChE). aiche.org/cep

Allen, M., & Vahid, F. (2020). Teaching Coral before C++ in a CS1 course. ASEE’S Virtual Conference (SEEVC)-Paper ID 29886, 1–15.

Andika, R., & Putra, Z. A. (2022). Teaching programming to chemical engineering students. ASEAN Journal of Science and Engineering Education, 2(1), 51–60

Asadi, F. (2022). MATLAB programming. In Applied Numerical Analysis with MATLAB/Simulink (pp. 257–293). SLEST Book Series: Springer Nature Switzerland AG. https://doi.org/10.1007/978-3-031-19366-8_10

Ateeq, M., Habib, H., Umer, A., & Rehman, M. U. I. (2014). C++ or Python? Which one to begin with: A learner’s perspective. 2014 International Conference on Teaching and Learning in Computing and Engineering, 64–69. https://doi.org/10.1109/LaTiCE.2014.20

Bakari, H. R., Adegoke, T. M., & Yahya, A. M. (2016). Application of Newton Raphson method to non-linear models. International Journal of Mathematics and Statistics Studies, 4(4), 21–31. www.eajournals.org

Balaji, G. V, & Seader, J. D. (1995). Application of interval Newton’s method to chemical engineering problems. Reliable Computing, 1, 215–225. https://doi.org/10.1007/BF02385253

Bamdad, F. (2004). Solution of cubic equations by iteration methods on a pocket calculator. Journal of Chemical Education, 84(5), 758–761. https://doi.org/10.1021/ed081p758

Bandele, S. O., & Adekunle, A. S. (2015). Development of C++ application program for solving quadratic equation in elementary school in Nigeria. Journal of Education and Practice, 6(28), 70–77. www.iiste.org

Baptista, L. (2021). Using Python and Google Colab to teach physical chemistry during pandemic (pp. 1–11). Universidade do Estado do Rio de Janeiro

Bect, D. A. C., Carothers, J. M., Subramanian, V. R., & Pfaendtner, J. (2016). Data science: Accelerating innovation and discovery in chemical engineering. AlChE Journal, 62(5), 1402–1416. https://doi.org/10.1002/aic.15192

Bell, I. H., Deiters, U. K., & Leal, A. M. M. (2022). Implementing an equation of state without derivatives: teqp (T. Loew, P. Walker, J. Young, A. Jaeger, & D. Zhu (eds.); pp. 1–31)

Bergmann, S. D. (2021). Computer science principles with C++. Open Educational Resources, 26, 253. https://doi.org/10.31986/issn.2689-0690_rdw.oer.1025

Bishop, J., & Bishop, N. (2000). Object-orientation in Java for scientific programmers. ACM SIGCSE Bulletin, 1–7. https://doi.org/10.1145/330908.331885

Blagoev, I. (2018). Using R programming language for processing of large data sets. In R. D. Andreev (Ed.), International Conference on Big Data, Knowledge and Control Systems Engineering (BdKCSE’2018) (pp. 91–97). Institute of Information and Communication Technologies (IICT) of the Bulgarian Academy of Sciences

Blount, B., & Chatterjee, S. (1999). An evaluation of Java for numerical computing. Scientific Programming, 7, 97–110

Boisvert, R. F., Moreira, J., Philippsen, M., & Pozo, R. (2001). Java and numerical computing (pp. 1–11). www.mcours.com

Bose, S. K. (2019). Numerical methods of mathematics implemented in Fortran (P. V Subrahmanyam, Y. P. Chaubey, J. Cuellar, J

Matkowski, T. Parthasarathy, M. D. Sikiric, & B. D. Sharma (eds.)). Springer Nature Singapore Pte Ltd. https://doi.org/10.1007/978-981-13-7114-1

Boynton, W. P., & Bramley, A. (1922). A modification of van der Waals’ equation (Vol. 20, Issue 1)

Braun, W. J. (2021). A first course in statistical programming with R (2nd ed.). Cambridge University Press

Chan, B. K. C. (2018). Data analysis using R programming. In Biostatistics for Human Genetic Epidemiology (No. 1082; Advances in Experimental Medicine and Biology (AEMB)). Springer, Cham. https://doi.org/10.1007/978-3-319-93791-5_2

David, C. W. (2015). The van der Waals equation as a cubic. Chemistry Education Materials, 88, 1–7. https://opencommons.uconn.edu/chem_educ/88

de Sousa, V. M., de Moura, F. P., de Sousa, M. P., Lacerda, R. F., & Passos, F. G. O. (2021). Hidrouff density calculator: An open-source software for predicting density of complex mixtures using Peng-Robinson equation of state (PREOS). https://doi.org/10.5281/zenodo.5719756

Diaz-Bejarano, E., Francia, V., & Colletti, F. (2019). Data analysis for chemical engineers: Introduction to R. In Introduction to Software for Chemical Engineers (2nd ed., pp. 221–250). Institute of Mechanical, Process & Energy Engineering, School of Engineering & Physical Sciences. https://doi.org/10.1201/9780429451010-7

Djamila, H. (2017). Excel spreadsheet in teaching numerical methods. IOP Conference Series: Journal of Physics (ICoAIMS), 890(012093), 1–7. https://doi.org/10.1088/1742-6596/890/1/012093

Evans, R. (2014). R programming (pp. 1–82). Michaelmas2014. http://www.stats.ox.ac.uk/~evans/teaching.htm

Farrell, J. (2022). Java programming (10th ed.). Cengage

Finkel, D., Hooker, C., Salvidio, S., & Sullivan, M. (1994). Teaching C++ to high school students (pp. 286–289). Association of Computing Machinery (ACM)

Frank, W. F. X., & GroBmann, D. (2006). Remarks on van der Waals’ equation, the cohesion pressure of a gas, and the role of intermolecular forces (pp. 1–22)

Garces, J. (2015). Comments on the repulsive term of van der Waals equation of state (pp. 1–9)

Garcia-Rodriguez, M., Anel, J. A., Foujols, M.-A., & Rodeiro, J. (2016). FortranAnalyser: A software tool to assess Fortran code quality. IEEE Access, 4, 1–4. https://doi.org/10.1109/ACCESS.2017.DOI

Gor, G. (2021). CHE 490-HM2: Special topic-Python programming for chemical engineers. Chemical and Materials Engineering Syllabi, 161, 1–7. https://digitalcommons.njit.edu/cme-syllabi/161

Hart, W., & Laird, C. D. (2014). Rethinking the C++/Python boundary in modeling and optimization tools. Sandia National Laboratories

Hawick, K. A. (2011). Engineering domain-specific languages and automatic code generation for computational simulations of complex systems. https://doi.org/10.2316/p.2011.758-046

Hernandez, E. M., & Martin, M. (2019). Python for chemical engineering. In Introduction to Software for Chemical Engineers (2nd ed., pp. 185–220). CRC Press.

Hinsen, K. (2013). A glimpse of the future of scientific programming. In K. Hinsen & K. Laufer (Eds.), Computing in Science and Engineering (Vol. 15, Issue 1, pp. 84–88). IEEE CS and AIP. https://doi.org/10.1109/MCSE.2013.1

Hossain, E. (2022). Numerical methods in MATLAB. In MATLAB and Simulink Crash Course for Engineers (Vol. 1965, pp. 139–149). Springer. https://doi.org/10.1007/978-3-030-89762-8_7

Jarvinen, H.-M., & Ala-Mutka, K. (2004). Supporting students in C++ programming courses with automatic program style assessment. Journal of Information Technology Education, 3, 245–263

Johnson, S. R., Prokopenko, A., & Evans, K. J. (2019). Automated Fortran-C++ bindings for large-scale scientific applications

Johnston, D. C. (2014). Advances in thermodynamics of the van der Waals fluid. In IOP Concise Physics (p. 67). Morgan & Claypool Publishers. https://doi.org/10.88/978-1-627-05532-1ch1

Kadam, G. (2013). C++ programs for chemical engineering (p. 42). TKIET, Warananagar

Kamarudin, S., Punzalan, C., Derahman, M. N., Mohd, S. M., Jan, N. M., & Wahab, A. N. A. (2022). The student’s self perception on learning C++ programming via the cryptography project: A case study. International Journal of Academic Research in Progressive Education and Development, 11(2), 1534–1544. https://doi.org/10.6007/IJARPED/v11-i2/14031

Kapuno, R. R. A. (2008). Programming for chemical engineers using C, C++, and MATLAB (1st ed.). Jones & Bartlett Learning, LLC

Kedward, L., Aradi, B., Certik, O., Curcic, M., Ehlert, S., Engel, P., Goswami, R., Hirsch, M., Lozada-Blanco, A., Magnin, V., Markus, A., Pagome, E., Pribee, I., Richardson, B., Snyder, H., Urban, J., & Vandenplas, J. (2022). The state of Fortran. In K. Hinsen (Ed.), Computing in Science and Engineering (pp. 1–11). IEEE Computer Society. https://doi.org/10.1109/MCSE.2022.3159862

Kiusalaas, J. (2013). Numerical methods in engineering with Python3. Cambridge University Press: The Pennsylvania State University. www.cambridge.org/9781107033856

Kontogeorgis, G., Privat, R., & Jaubert, J.-N. (2019). Taking another look at the van der Waals equation of state-Almost 150 years later. Journal of Chemical and Engineering Data, 64, 4619–4637. https://doi.org/10.1021/acs.jced.9b00264

Kutarov, V., & Schieferstein, E. (2020). Van der Waals equation for the description of monolayer formation on arbitrary surfaces. Colloids and Interfaces, 4(1), 1–10. https://doi.org/10.3390/colloids4010001

Lee, P. A., & Phillips, C. (1998). An assessment of C++ as an introductory teaching language (pp. 1–14). School of Computing Science: University of Newcastle upon Tyne

Li, H. (2022). Introduction to numerical methods in Java. In Numerical Methods Using Java (Vol. 1291, pp. 1–69). Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6797-4_1

Mailud, T. (2022). Introduction to R programming. In Beginning Data Science in R 4 (pp. 1–50). Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-8155-0_1

Mak, L., & Taheri, P. (2022). An automated tool for upgrading Fortran codes. Software, 1(3), 299–315. https://doi.org/10.3390/software1030014

Marie, van S. (2022). Integrating Python into a physical chemistry lab. Journal of Chemical Education, 99(7), 2604–2609. https://doi.org/10.1021/acs.jchemed.2c00193

Mehtre, V. V, & Pal, A. (2019). MATLAB basics: Commands, functions and operations. International Journal of Research in Engineering, Science and Management (IJRESM), 2(11), 708–710. www.ijresm.com

Mejia, A., Müller, E. A., & Maldonado, G. C. (2021). SGTPy: A Python code for calculating the interfacial properties of fluids based on the Square Gradient Theory using the SAFT-VR Mie equation of state. Universidad de Concepción. https://github.com/gustavochm/SGTPy

Meltzer, R. (2021). A helpful guide for beginners: Python vs C++. Course Report. coursereport.com

Moreira, J. E., Midkiff, S. P., Gupta, M., Artigas, P. V, Snir, M., & Lawrence, R. D. (2000). Java programming for high-performance numerical computing. IBM Systems Journal, 39(1), 21–56

Nasri, Z., & Binous, H. (2009). Applications of the Peng-Robinson equation of state using MATLAB. Chemical Engineering Education, 43(2), 115–124

Nguyen, H. (2019). Exploring Python as a replacement for C++ in imperative programming for computing science at Radboud University (P. Achten & E. Barendsen (eds.)). Radboud University

Nyhoff, L. (2012). Programming in C++ for engineering science (1st ed.). Routledge, CRC Press: Taylor and Francis Group. http://cs.calvin.edu/books/c++/engr-sci

Ott, J., Pritchard, M., Best, N., Linstead, E., Curcic, M., & Baldi, P. (2020). A Fortran-Keras deep learning bridge for scientific computing. Scientific Programming, 8888811, 1–13. https://doi.org/10.1155/2020/8888811

Ozgur, C., Colliau, T., & Rogers, G. (2017). Matlab vs. Python vs. R. Journal of Data Science, 15, 355–372

Pandey, Y. N., Rastogi, A., Kainkaryam, S., Bhattacharya, S., & Saputelli, L. (2020). Machine learning in the oil and gas industry-Including geosciences, reservoir engineering, and production engineering with Python (W. Spahr, C. S. John, J. Markham, & A. Mirashi (eds.)). https://doi.org/10.1007/978-1-4842-6094-4

Pao, Y. C. (2018). Engineering analysis: Interactive methods and programs with FORTRAN, QuickBASIC, MATLAB, and Mathematica. CRC Press: Taylor and Francis Group

Papari, M. M., Moghadashi, J., Hosseini, S. M., & Akbari, F. (2011). Modification of van der Waals family equations of state. Journal of Molecular Liquids, 1258, 57–60. https://doi.org/10.1016/j.molliq.2010.10.009

Passos, W. Dos. (2009). Numerical methods, algorithms and tools in C# (1st ed.). CRC Press. https://doi.org/10.1201/9781420007602

Peng, R. D. (2018). R programming for data science. Lean Publishing. http://leanpub.com/rprogramming

Pine, D. J. (2019). Introduction to Python for science and engineering. In Series in Computational Physics (pp. 1–23). CRC Press: Taylor and Francis Group. https://lccn.loc.gov/2018027880

Prodanov, E. M. (2022). Mathematical analysis of the van der Waals equation. Physica B: Physics of Condensed Matter, 640(414077), 1–6. https://doi.org/10.1016/j.physb.2022.414077

Rassokhin, D. (2020). The C++ programming language in cheminformatics and computational chemistry. Journal of Cheminformatics, 12(10), 1–16. https://doi.org/10.1186/s13321-020-0415-y

Rault, J. (2019). The modified van der Waals equation of state-Part IV: Crystalline materials. The European Physical Journal B, 92(22), 1–32. https://doi.org/10.1140/epjb/e2018-90452-6

Rose, G. K. (2017). Computational methods for nonlinear systems analysis with applications in mathematics and engineering (B. A. Newman, D. T. Nguyen, J. Z. Hao, & G. J. Hou (eds.)) [Old Dominion University]. https://doi.org/10.25777/m09c-zj95

Saggion, A., Faraldo, R., & Pierno, M. (2019). Thermodynamics: Fundamental principles and applications (M. Cini, A. Ferrari, S. Forte, G. Montagna, O. Nicrosini, L. Peliti, A. Rotondi, P. Biscari, N. Manini, & M. Hjorth-Jensen (eds.)). Springer Nature Switzerland AG. https://doi.org/10.1007/978-3-030-26976-0

Salamanca, A. V. (2020). Use of mathematical methods in the resolution of chemical engineering problems (J. J. P. Gonzalez & F. R. Baxarias (eds.)). Universitat Politechnica de Catalunya (UPC)

Salcedo-Diaz, R., Ruiz-Femenia, R., & Gomez-Rico, M. F. (2006). An interactive tool for chemical engineers students using easy Java simulations. University of Alicante, 1–12

Schauber, S. K. (2015). Introduction to the R programming language for statistical computing and graphics. UiO: Centre for Educational Measurement, Faculty of Educational Sciences. https://doi.org/10.13140/RG.2.1.2405.5768

Scheiber, E. (2007). Java in scientific computation: An educational approach. The 4th International Conference on Virtual Learning (ICVL 2009), 181–188

Scheinerman, E. (2006). C++ for mathematicians-An introduction for students and professionals (1st ed.). CRC Press

Schildt, H. (2022). Java-A beginner’s guide (L. McClain, P. Mon, E. Walters, D. Coward, & L. McCoy (eds.); 9th ed.). 978-1-260-46355-2

Shafeek, N., & Karunarathne, D. D. (2018). _toFlowchart: A prototype compiler to convert source-code to flowchart. 1st International Conference on Advacnces in ICT for Emerging Regions (ICTer), 157–167. https://doi.org/10.1109/ICTER.2018.8615581

Shrab, S. (2004). Modified van der Waals equation of state. WSEAS Transactions on Biology and Biomedicine, 1(4), 422–424

Shukla, S., & Singh, S. (2022). Equations of state in chemical engineering using Python. International Journal of Engineering Applied Sciences and Technology (IJEAST), 7(1), 278–286. http://www.ijeast.com

Siddiqui, S. A., & Ahmad, A. (2020). Implementation of Newton’s algorithm using FORTRAN. SN Computer Science, 1(348), 1–8. https://doi.org/10.1007/s42979-020-00360-3

Solofsson, Hebing, L., Niedenfuhr, S., Deisenroth, M. P., & Misener, R. (2019). GPdoemd: A Python package for design of experiments for model discrimination. Computer and Chemical Engineering, 125, 54–70. https://doi.org/10.1016/j.compchemeng.2019.03.010

Sudhaka, K. (2018). Python vs. R programming. International Journal of Management, IT and Engineering, 8(8), 70–79

Sun, L. Y., Zhai, C., & Zhang, H. (2011). Applications of the Soave-Redlich-Kwong equations of state using MATLAB. Advanced Materials Research, 225(226), 492–495. https://doi.org/10.4028/www.scientific.net/AMR.225-226.492

Tang, T., & Wang, J. (2019). Study of computer software applied in teaching of design of chemical engineering principles. Open Access Library Journal, 6(e5292), 1–4. https://doi.org/10.4236/oalib.1105295

Teles, M. dos S., Vianna Jr, A. S., & Le Roux, G. A. C. (2018). Programming skills in the industry 4.0: Are chemical engineering students able to face new problems? Education for Chemical Engineers, 22, 69–76. https://doi.org/10.1016/j.ece.2018.01.002

Terrel, A. R. (2011). From equations to code: Automated scientific computing. In Computer in Science and Engineering (Vol. 13, Issue 2, pp. 78–82). https://doi.org/10.1109/MCSE.2011.31

Tholl, S. (2010). Fortran programs for chemical process design analysis and simulation (A. K. Coker (ed.))

Tian, J., & Gui, Y. (2003). Modification of the van der Waals equation of state. Journal of Phase Equilibria, 24(6), 533–541

Tian, J. X., & Gui, Y. (2018). An extension of the van der Waals equation of state (pp. 1–11)

Vasudevan, S. K., Abhishek, S. N., Vignesh, K., Aswin, T. S., & Nair, P. R. (2019). An innovative application for code generation of mathematical equations and problem solving. Journal of Intelligent & Fuzzy Systems, 36(3), 2107–2116. https://doi.org/10.3233/JIFS-169922

Wang, J., & Dowling, A. W. (2022). Pyomo. DOE: An open-source package for model-based design of experiments in Python. American Institute of Chemical Engineers Journal, 17813, 1–24. https://doi.org/10.1002/aic.17813

Winkel, van J. C., & Bella, C. Di. (2018). Proposal for study group: C++ education (pp. 1–8)

Xiduo, W., Jialin, L., & Zhizhen, Z. (2020). Sustainable C++ education in general high school: From teaching programming skills to developing computational thinking. 2020 15th International Conference on Computer Science & Education (ICCSE), 35–38. https://doi.org/10.1109/ICCSE49874.2020.9201830

Yeo, Y. K. (2017). Chemical engineering computation with MATLAB (1st ed.). CRC Press: Informa UK Limited. https://doi.org/10.1201/9781315114880

Zehra, F., Darakhshan, Javed, M., & Pasha, M. (2020). Comparative analysis of C++ and Python in terms of memory and time (pp. 1–11). https://doi.org/10.20944/preprints202012.0516.v1

Zheng, L., Dong, Y., & Yang, F. (2019). Elementary C++ programming. In C++ Programming (pp. 25–78). Walter de Gruyter GmbH. https://doi.org/10.1515/9783110471977-002

Downloads

Published

2023-05-13

How to Cite

Abdulhalim Musa Abubakar1, Eva Schieferstein, Volodymyr Kutarov, Muhammad Tayyab Bilal, Chantawan Noisri, & Bello Iliyasu. (2023). Implementing Newton-Raphson Method Algorithm in 6 Programming Languages’ Solution to Van Der Waals Equation of State. Formosa Journal of Computer and Information Science, 2(1), 51–94. https://doi.org/10.55927/fjcis.v2i1.3953

Issue

Section

Articles