Virtual Instrument for Determining Rate Constant of Second-Order Reaction by Based on LabVIEW 8.0
The virtual instrument system based on LabVIEW 8.0 for ion analyzer which can measure and analyze ion concentrations in solution is developed and comprises homemade conditioning circuit, data acquiring board, and computer. It can calibrate slope, temperature, and positioning automatically. When applied to determine the reaction rate constant by , it achieved live acquiring, real-time displaying, automatical processing of testing data, generating the report of results; and other functions. This method simplifies the experimental operation greatly, avoids complicated procedures of manual processing data and personal error, and improves veracity and repeatability of the experiment results.
LabVIEW is the abbreviation of Laboratory Virtual Instrument Engineering Workbench, which is the innovative software product of National Instruments (NIs) in United States. It is the preferred platform when people exploit virtual instrument as the most functional graphic software at present [1–5].
Ion analyzer is one of the most widely used analysis instruments in scientific research and practice. It is widely applied in biomedical, chemical, environmental protection, and other fields. Manual reading and processing data with traditional ion analyzer is not only cumbersome in operation process but also difficult to avoid personal error. The research about ion analyzer connected to computer has been reported in recent years ; however, the quantity is small, and the software is mostly developed in text-based programming language (e.g., C, Turbo Pascal, VB, and so on). The disadvantage of the text-based language is long developing periods, difficult maintenance, and expandedness. The VI of ion analyzer based on LabVIEW has not been reported yet. The VI of ion analyzer developed by authors is developed in graphical programming language—LabVIEW 8.0. It not only has friendly interface, easy operation, and expandability, but also can realize automatic slope, temperature, and positioning calibrations. The system has been applied to determine the rate constant of ethyl acetate saponification reaction when the LabVIEW program for determining the reaction rate constant by is embedded into the system. The authors have obtained satisfactory results.
2. System Principles and Configuration
Actually, Ion analyzer, as a high input impedance millivoltmeter, is widely used in measuring the EMF of the battery which is composed by ion selective electrode, reference electrode, and solution. The concentration of the unknown solution is acquired through measuring the EMF margin between standard solution and tested solution under the same electrode system. By the Nernst equation the authors have inferred where is the potential, and is the value of tested solution.
It is obvious that the relation between and is linear. is theoretic slope of the electrode system; however, the actual electrode slope is also influenced by temperature, ion valence, manufacturing process, surface structure, activation state of the electrode, and other factors. Although the electrodes are of the same type, the values of the electrodes may be different. It is why ion analyzer must be proofreaded by standard solution before being used. Traditional ion analyzer needs transform switches and rheostats to complete positioning, ion valence, polarity, electrode slope, and temperature calibrations for proofreading the instrument. In this condition, operators must read and process the data artificially during measurements. The virtual instrument system based on LabVIEW 8.0 for ion analyzer brings the advantage of virtual instrument that “software is instrument” into full play. It achieves proofreading the instrument and data processing automatically by LabVIEW program, so the authors can easily get real-time and curve.
System structure of the virtual instrument is shown in Figure 1. Ion selecting electrode and reference electrode are immersed into the tested solution constituting electrode system. The potential signal enters into computer via the PCI-6014 Data Acquisition (DAQ) after impedance transformation and filtering by high input impedance conditioning circuit. Precise digital temperature thermoscope connects the computer by RS-232 serial port which makes the automatical temperature compensation easily.
The homemade conditioning circuit is shown in Figure 2. It is made up of one high input impedance voltage follower with CA3140 and second-order active low-pass filter with low drift OP07. Specially the CA3140 is used to accomplish impedance transformation of electrode system, then the low drift OP07 accomplishes the output signal filtering.
3. Design and Implementation of the Main LabVIEW Program for System
The system software consists of four main parts, including operation panel, data acquiring and real-time displaying, data storage, and data processing and result displaying. Thereinto, the former three parts of the system software are necessary, and the last one can be adjusted according to the purpose of users’ measurement.
3.1. Program for Operation Panel
Virtual instrument operation panel is shown in Figure 3. To enable users to adjust sampling interval and channels according to their needs, sampling interval knob and channels selecting controller are set on the left of the panel. Users can also decide whether to save the date synchronously by synchronous memory controller or not. In this LabVIEW program, Event Structure which comprises data acquiring, data saving, data processing, result printing, and exit five subevents is used. Each subevent corresponds with a control button on the panel. When clicking the control button, corresponding event will be called. Operation panel adopts Tab Control on the whole to achieve the switch between stall and stall and connects Tab Control with Selection Terminal of a Case Structure on block panel. Clicking the stall and stall button on top of the operation panel can complete the switch between stall and stall easily.
3.2. Program for Data Acquiring and Real-time Displaying
Program for data acquiring and real-time displaying of measurement is the key program of the system which can automatically complete temperature, slope, orientation, and ion valence correction. The program consists of a Stacked Sequence Structure, which includes seven frameworks. While the program is running the structure will gradually execute the framework program according to the order of selection for labels
Figure 4 shows the block program of the last framework. It executes real-time acquiring anddisplaysthe value of the solution under test and data provisional storage, which is mainly constituted by three While Structure. The upmost While Structure accomplishes the driving of data acquisition card and data acquiring continuously. Channels selecting controller select channel, AI Config function sets up the size of buffer, AI Read function sets up sampling rate, and Max & Min function controls the amount lagging to avoid data coverage. To enhance the stability and veracity of the result, 300 acquired data will be switched to value after averaged and then real-time displayed by the control Meter and transmitted to the downmost While Structure by native variable to save. At the same time the textboxes on the right of the operation panel display value, electrode slope, mV, ion concentration of , and other data. The While Structure in the middle real time acquires the temperature value of exact digital temperature thermoscope by the serial communication VI and then transmits it to the upmost While Structure by native variable to accomplish temperature compensation automatically. The temperature of solution is real-time displayed by the control Thermometer in the operation panel. The While Structure downmost writes the discrete value to file according to the sampling interval set by users and displays it in Express Graph. Because LabVIEW program adopts parallel operation mechanism, the three While Structure can run independently.
The program of mV stall is similar to this and simpler relatively; the only difference is real-time displays are potential time curve.
3.3. Program for Date Storage
Its block program is shown in Figure 5. First, open a file dialog box with the function File Open to offer the storage path for users. Then copy the data saved in provisional file to appointed file with the function Copy and superadd initial experiment conditions to the file which is saved for the use of data processing at the same time. If any failure during data storage, it will pop up invalid save and give error reasons to users, allowing users to save again until success.
4. Design and Implementation of Program for Data Progressing
4.1. Basic Principles of Determining Rate Constant by pX
The biggest advantage of virtual instrument is easy expandability, fully playing the powerful data processing function of computer to deal with the test data collected according to the programming needs of users. Basic principles of determining rate constant by are that the concentration of the participation in the reaction system changes over time with reaction proceeding, so tracking and recording a curve of with the change of time , and then by corresponding data processing under the principle of dynamics the corresponding parameters of dynamics can be determined.
For easy presentation, take a typical second-order reaction the reaction of ethyl acetate saponification as an example:
With reaction proceeding, gradually diminishes, and gradually increases in the system, so the value of the system gradually reduces. The information of reaction course is obtained by determining the value with the time. So the rate constant of this reaction can be determined by the method of .
For second-order reaction, data processing formulae are different for the equal and unequal initial concentration of reactants. In accordance with the principle of dynamics, according to [7–9], when the initialconcentrations of reactants are equal, setups of the initial concentration are both , then the dynamic formula for the reaction is where is the concentration of at the time ; is rate constant, for strong base , , when the concentration ?10-6?M. Integration yields: So we can educe the relationship formula between the pH value of the system and time as (5)
It shows that by plotting against , the slope of the line is rate constant, .
When the initial concentrations of reactants are unequal, setups are, respectively, the initial concentration of and , then the concentration of each component of the reaction system at different reaction time can be expressed as where are, respectively, the concentration of at the time of and , and is the concentration of product and at the time of .
When the dynamic formula for second-order reaction is Because , Set up are of the system at the time of and , then obtain Also because , (5) can be expressed with value as Set up , then
Equation (11) is the relationship formula between value and time, which shows that by plotting against a straight line is obtained, and after determining of the system at the time of and rate constant can be obtained from the slope of the line.
These methods do not require determining the accurate initial concentration of reactants, which simplifies the experimental operation. By Arrhenius equation , the activation energy can be obtained by the rate constant of different temperature.
4.2. Program for Data Processing and Results Displaying
The block program is shown in Figure 6. The corresponding program in the Sequence Structure on the far left firstly judges whether the initial concentration of reactant is equal, then chooses the corresponding data file which is waiting for processing. The program performs the corresponding subdiagram of Case Structure according to judging result. Data processing includes linear transforming of data, transforming the label of axis, straight line fitting, and correlation coefficient calculating, and so forth. A group of data read out from data file enters For Loop structure, by using the Loop Iteration; the automatically matching of data of axis and data of axis is achieved. The autoindex of For Loop makes the results to be an array. After this array enters subprogram for straight line fitting, the unqualified data is deleted and the line slope, intercept, and other data are obtained. A cluster array is produced by the function Build Array after the data “after deleted” and “the data after fitted” are, respectively, bundled by the function Bundle, and is displayed by the control Graph. At the same time, by using scale.NameLb1.Text and scale.NameLb1.Text in Property Node of graph and condition of initial concentration of reactant, the label of axis is automatically transformed with different beginning condition. Correlation coefficient of straight line fitting is obtained after the data enters subprogram for . The system will remind users whether or not to continue data processing after a set of data is processed. Another data file will be selected if the user continues to obtain rate constant at different temperature. The value at different temperature can be used to calculate apparent activation energy by the function Formula Node in Case Structure on the far right. The results and necessary parameters are added into array by the function Insert Into Array. Then each element of array is indexed and transformed into specified precise characters by function Number To Fractional String. The characters are concatenated into a string by function of Concatenate Strings, and at last the string is displayed by String Indicator.
5. Example of Application
This system is used to determine the rate constant of ethyl acetate saponification reaction at the temperature of 298?K and 308?K when the initial concentration of reactants is equal and unequal. In the measuring process the system automatically collects testing data and real-time displays curve, as shown in Figure 3. It also automatically processes testing data and generates the report of result. Figure 7 is the data processing panel under equal initial reactants concentration, and the two Graphs on each side, respectively, display testing data at the temperature of 298?K and 308?K. The underside of panel is a testing conditions and results showing box which can display reaction temperature, rate constant, correlation coefficient, and apparent activation energy together. Relevant data of test is shown in Table 1.
The virtual instrument system based on Labview8.0 for ion analyzer, which has advantages of easy operation and friendly interface, can determine , realize real-time displaying and drawing a curve of or mV with the change of time , process data, and generate result report automatically. The relative error of result is less than 3.5%. For any second-order reaction system, the virtual instrument system can track the concentration change of the corresponding ion and then determine its rate constant if appropriate ion-selective electrode is used. For other series of reactions, the system can also determine their rate constants by amending data-processing program under the principle of dynamics. With its easy expandability, the system can be used in autodetermination studies such as potential titration, potential analysis, and potential equilibrium constant measurement through embeding different data-processing programs of LabVIEW. What is more, the system provides users with great convenience for tracking and measuring or potential application research; the authors believe that it can be widely used in the production and environmental monitoring.
The authors are grateful to the important research item of Sichuan provincial Department of education [(2005) 198] for financial support.
J. Ballesteros, J. I. Fernández Palop, M. A. Hernández et al., “LabView virtual instrument for automatic plasma diagnostic,” Review of Scientific Instruments, vol. 75, no. 1, pp. 90–93, 2004.View at: Google Scholar
National Instruments Corporation, LabVIEW User Manual, 2007.
J.-Y. Li, Y.-W. Li, and D.-P. Guo, “The design and application of conductance rate virtual instrument based on LabVIEW 8.0 express,” Match, vol. 60, no. 2, pp. 325–331, 2008.View at: Google Scholar
K. Li and Y. Z. Ye, “The design of intelligent ion analyzer based on microcomputer and its application,” Journal of Fuzhou University, vol. 33, no. 1, pp. 54–57, 2005.View at: Google Scholar
S. Y. Shao, X. R. Liu, and L. X. Pang, “Measurement of rate constant for saponification reaction of ethyl acetate by acidometer,” Journal of Xi'an University of Science and Technology, vol. 24, no. 2, pp. 196–199, 2004.View at: Google Scholar
A. C. Feng, “Simple measurement of reaction rate constant of ethyl acetate,” Chemistry Online, vol. 9, pp. 36–37, 1983.View at: Google Scholar
S. X. Li, “pH measurement of the rate constant of ethyl acetate saponification,” Journal of Southwest Nationalities College, vol. 21, no. 2, pp. 232–234, 1995.View at: Google Scholar
Fudan University, Physical Chemistry Experiments, Higher Education Press, Beijing, China, 3rd edition, 2004.
L. Kuang and L. Wu, “Studying kinetics of saponification of ethyl acetate with computer,” University Chemistry, vol. 19, no. 4, pp. 39–42, 2004.View at: Google Scholar
J. X. Lu, W. J. Liu, and L. W. Chen, “The determining to kinetic data of saponification of ethyl acetate by ultraviolet spectrophotometry,” Chemistry Online, vol. 11, pp. 55–56, 1988.View at: Google Scholar