Free Software Development.

2. Chemical Database Management

 

 

Monica ŞTEFU1, Mihaela Ligia UNGUREŞAN2, Lorentz JÄNTSCHI2,*

 

1“Babeş-Bolyai” University Cluj-Napoca

2Technical University Cluj-Napoca

*corresponding author, http://lori.academicdirect.ro

 

 

Abstract

 

The present paper is focused on modeling of thermodynamic processes by using of thermodynamic functions with applications in field of material science and engineering. A new method of data processing is presented and applied on a set of substances with known thermodynamic parameters (temperature coefficients of molar caloric capacity, standard enthalpy and entropy).

The method allows identifying the possible reactions and evaluating of state transformation parameters (ΔG, ΔH, ΔS).

An algorithm for computing data was implemented in preprocessed hypertext language (PHP), a hypertext markup language interface for them was also realized and put onto vl.academicdirect.ro educational web server, and it is accessible via http protocol at the address:

http://vl.academicdirect.ro/molecular_dynamics/free_enthalpy/.

 

 

Keywords

 

Modeling, Analytical methods, Automat processing of data, Server side technologies.

 

1. Introduction

 

            In field of statistical data processing it exist a large set of software to compute and fit the regressions, but few are free.

Even for free software, another problem it appear, operating system license and portability of the software. As example, to use well known Microsoft Excel software, you must have Microsoft Windows and Microsoft Excel license and portability of Excel program is restricted to Windows platform. To import Excel files in another programs or platforms, conversion modules are needed, and conversion is not totally in most of the cases.

Platform independent and free software is a real alternative to this. First step to build totally free software is to install a free operating system. Unix-like operating systems are known to be free, but even here exist licensed software. In order to select a totally free Unix-like operating system, best offer come from BSD family.

The most secure and license check for installed software is NetBSD [[1]]. The NetBSD detect so called “license agreement” and do not permit to install a software if the software contain unacceptable license agreement (different form free) and software can be installed only if the acceptance is explicitly stipulated by the user in configuration files of the system. Another advantage of NetBSD operating system is his huge portability under various hardware platforms from i386 family to Sun and Macintosh machines.

By another hand, most full featured operating system of BSD family is FreeBSD [[2]]. One of the advantages of the FreeBSD operating system is his software portability. With adequate packages, under FreeBSD, can be executed DOS, Windows, Linux and Sun-OS programs. Another advantage of FreeBSD system comes from easiest to install and use it.

Once you have an operating system installed, the next step is to choose a proper programming language for software developing.

Here, some major questions must be answered. In terms of programming, portability of resulted program can be a problem. As example, if we are chose to implement the algorithm in Visual Basic, the execution of the program is restricted to Windows machines. If Perl is our choice, a Unix-based machine is necessary to run program.

Even if we chouse to implement the program in C language, we will have serious difficulties to compile the programs on machines running with different operating systems.

The complexity of program building is also a serious reason in language chousing. Is known that C based languages is poor in simplicity and necessity more time to expend for application building than other languages.

            Other questions require an answer: We want a server based application or client based application? We want a server side application or a client side application?

            As example, a client side application can have disadvantage of execution on client, and dependence of processing speed by power of client machine. If we prefer this variant, a java script or visual basic script is our programming language. A server side application requires a web server installed. The area of web servers is also a large set, but few have multiplatform capability. If we want a full featured web server, Apache is our solution [[3]].

            Under Apache, we have the possibility to execute programs already compiled in C, Fortran and Java, under Unix machines we can directly execute Perl programs, and, most important, under all operating system platforms we can execute PHP programs if we previously install php language and module binaries. [[4]]

            The advantage of PHP programs consist in his portability under most of operating system platforms and internal compilation feature that do not necessity the compilation “by hand” from the user. The disadvantage can be same internal compilation that consumes supplementary time in execution. But, this disadvantage can be partially eliminated through installing a PHP proxy, that store compiled programs and next execution of the unmodified program use this compiled binary [[5]].

In terms of program developing PHP is easy to use, the language borrow syntax from C, Pascal, Basic and Perl, but do not borrow the complex declaration syntax from them. The pointer mechanism is absolute. Thus, a variable used as a string, can be exploited as an integer or real if the value represent a number such that. Class constructing is also available and PHP posses a strong library of database connectivity. Modular programming, recursivity and graphics are at home! Module loading of compiled programs in other languages and execution of binary programs is also available. System services such as mail service are easy to exploit in PHP scripts [[6]].

A very easy mechanism to link PHP scripts to HTML scripts make PHP language to be one of the best. Shell executing commands make PHP a useful platform for system administration (PhpSysInfo, WebAdmin, PhpMyAdmin, PhpPgAdmin) [[7]]. As a conclusion, PHP is our choice [[8]]!

            PHP programs are putted on a web server data folder and executed by them using PHP module. The output of the PHP program is in HTML style and can be viewed by any web client (Microsoft Internet Explorer, Mozzilla, Opera, Netscape, Konkueror).

 

 

                        2. Theoretical Considerations

 

            The enthalpy (H) is a function of two independent state variables; if we chouse p and T independent variables, then H = H(p,T) and:

 

                        dH = ∙dp + ∙dT = ∙dp + Cp∙dT                                     (1)

 

where Cp is caloric capacity at constant pressure.

            The modeling of CP = CP(T) are described in literature through one of the equations:

 

,                                                            (2)

 

depending on type of substance [[9]].

The coefficients a, b, c and c' are experimentally obtained.

 

Fig. 1. Caloric isobar capacity dependency of temperature

 

            For a chemical reaction (see fig. 1) if we consider two different temperatures, the transformation functions can be expressed at one temperature depending on the other temperature through equation:

                        ΔrH(T1) = ΔrH(T0) +                                                                   (3)

 

where ΔrH is variation of enthalpy function and ΔrCp is variation of caloric isobar capacity in reaction.

            For a given substance, the expression for H function (see fig. 1) is:

 

H(T) = H(0) +  +  + +  + (4)

 

where Cp(s), Cp(l), Cp(g) are caloric isobar capacities in solid, liquid and gaseous phase.

Based on similar considerations, the equation for S dependence of temperature is:

 

S(T) = S(0) +  +  + + (5)

 

            The free enthalpy, enthalpy and entropy are related through equation:

 

                        G = H – T∙S                                                                                                     (6)

 

            For a process at constant pressure and temperature:

 

                        ΔG = ΔH – T∙ΔS                                                                                             (7)

 

            The mentioned above formulas are used to compute the transformation functions.[10]

 

 

3. Implementation and Results

 

            A graphical interface was built in PHP with a SELECT and OPTION for input data and an INPUT SUBMIT button for submitting data to the server. The server is a Free BSD Unix based server (5.0 DP1 software version) with an Apache web server (1.3.26 software version) running on. The server is hosted in educational network of Technical University of Cluj-Napoca with address 193.226.7.200 and name vl.academicdirect.ro. The PHP language was compiled with GDI (graphical device interface) and MySQL (database server) support and the PHP software version is 4.2.3. The MySQL database server is also installed and running on and his software version is 3.23.52.

            A database called reactii was putted onto a MySQL database server. The database contains two tables, one called substante and the other called ecuatii. The table substante contain formula of substance, the standard enthalpy and entropy, temperature coefficients of caloric isobar capacity and the maximum and minimum values of temperatures for validity of dependency of CP by temperature. The table ecuatii contain the coefficients of all possible reactions between substances from table substante and the equations of reactions [[11]].

            The database was filled using PhpMyAdmin program.

The input interface is presented in fig. 2:

 

Fig. 2. The output of index.php

 

The index.php program submits data to the vl.academicdirect.ro server and these select reaction products and put the coefficients of reaction and submit them to the client. Next step is to select a wanted temperature and submit to the server (see fig. 3).

 


2Na + 2HCl -> 2NaCl + H2

Reaction temperature:  

 

 

Fig.3. The output of ecuatie.php

 

            The ecuatie.php program submits data to the vl.academicdirect.ro server and these compute transformation state functions, as in fig. 4.

            Based on these calculations, can be obtained some important results:

·        the dependence of enthalpy from temperature for an given substance;

·        the dependence of entropy from temperature for an given substance;

·        the interval of temperature for which a given reaction is spontaneously;

·        the temperature point when a spontaneous reaction become a forced reaction;

H(Na, 316.25 K, 1 atm.) = 507.47349797813 kJ/mol

S(Na, 316.25 K, 1 atm.) = 53.073192700215 J/mol*K

H(HCl, 316.25 K, 1 atm.) = 438.76832126635 kJ/mol

S(HCl, 316.25 K, 1 atm.) = 188.43019937988 J/mol*K

H(NaCl, 316.25 K, 1 atm.) = 518.9519321 kJ/mol

S(NaCl, 316.25 K, 1 atm.) = 75.38930503336 J/mol*K

H(H2, 316.25 K, 1 atm.) = 525.85395428912 kJ/mol

S(H2, 316.25 K, 1 atm.) = 132.31319666725 J/mol*K

ΔH(2Na + 2HCl -> 2NaCl + H2) = 2*H(NaCl) + 1*H(H2) - 2*H(Na) - 2*H(HCl)

ΔS(2Na + 2HCl -> 2NaCl + H2) = 2*S(NaCl) + 1*S(H2) - 2*S(Na) - 2*S(HCl)

ΔG = ΔH - T*ΔS

ΔH(2Na + 2HCl -> 2NaCl + H2) = -328.72581999982 kJ/mol

ΔS(2Na + 2HCl -> 2NaCl + H2) = -199.91497742623 J/mol*K

ΔG(2Na + 2HCl -> 2NaCl + H2) = -265.50270838878 kJ/mol

 
 

 

 

 

 

 

 

 

 

 

 


Fig. 4. The output of calcule.php

 

 

4. Conclusions

 

Considering the advantages of implemented software technology (machine and operating system portability, graphical interface and database connectivity features, easiest of programs developing, free type license agreement, http capability) the programming language and the program itself is the one of the best choice now available.

The program is successfully used for student practice in field of physical chemistry. The program permits to observe more efficient the process of reaction on different temperatures in real time.

Improvements of the program can be make considering that the equation can be obtain directly from substances formula and coefficients, and also the coefficients can be obtained directly from stoechiometry.

 

 

5. Acknowledgments

 

            Authors are grateful to the rector of Technical University of Cluj-Napoca, Prof. Ph. D. Eng. Gheorghe LAZEA for his policy on promoting information technology and to the university staff for support related to the internet connection of comp web server. Useful support was also benefit from Romanian Ministry of Education for finance funding of MEC/CNCSIS contract 468/"A"/2002 and 281/"A"/2002.

 

 

References

 



[[1]] http://www.NetBSD.org

[[2]] http://www.FreeBSD.org

[[3]] http://www.apache.org

[[4]] Lorentz Jäntschi, Real Time Property Investigation in Sets of Alloys, International Conference on Advanced Materials and Structures AMS 2002, September 19-21 2002, Timisoara, Romania, volume "SIC on AMS", p. 189-194.

[[5]] http://www.zend.com

[[6]] Lorentz Jäntschi, Automat Server Side Processing of Statistical Data, UNITECH'02 International Scientific Conference, November 21-22 2002, Gabrovo, Bulgaria, volume "ISC UNITECH'02 GABROVO Proceedings", p. 185-189.

[[7]] http://www.phpmyadmin.net

[[8]] Lorentz Jäntschi, Property Investigations with an Automat Correlation Routine and Applications for a Set of Alloys, Acta Technica Napocensis, Section Machine Constructions, Materials, Vol. 45(2002), part 1, p. 296-301.

[[9]] Holm Jan Lutzow, Enthalpy Cycles in Inorganic Chemistry, J. Chem. Educ., 51, 460, 1974.

[[10]] Lorentz Jäntschi, Mihaela Unguresan, Physical Chemistry. Molecular Kinetic and Dynamic (in Romanian), Mediamira, Cluj-Napoca, 2001, 159 p.

[[11]] Rock P. A., Chemical Thermodynamics, University Science Books, Mill Valley, 1983.