Curve fitting methods for complex and rank deficient chemical data 14th Iranian Workshop on Chemometrics Curve fitting methods for complex and rank deficient chemical data A. Naseri Faculty of Chemistry, University of Tabriz, Tabriz, IRAN
Model-based non-linear fitting A = C E + R based on beer-lambert law The task of model-based data fitting for a given matrix A, is to determine the best parameters defining matrix C, as well as the best pure responses collected in matrix E. A = C E + R based on beer-lambert law A C E R = +
The quality of the fit is represented by the matrix of residuals The quality of the fit is represented by the matrix of residuals. Assuming white noise, the sum of the squares, ssq, of all elements ri,j is statistically the best measure to be minimized ssq ssq = ΣΣ r2 I,j
Classical non-linear least squares fitting (traditional analysis) The residuals are a matrix R which is a function of all parameters, represented by the vector k: Target transform fitting
The difference between the two methods lies in the fact that TTF treats the residual vectors rE individually and thus is able to fit the parameters defining the rEs individually, independently of all the others.
Any optimization method can be used . fminsearch uses the Nelder-Mead simplex (direct search) method. fminsearch Multidimensional unconstrained nonlinear minimization (Nelder-Mead). X = fminsearch(FUN,X0) starts at X0 and attempts to find a local minimizer X of the function FUN. FUN is a function handle. FUN accepts input X and returns a scalar function value F evaluated at X. X0 can be a scalar, vector or matrix.
Rank deficiency in concentration profiles Rank deficiency and fitting Second order kinetics k A + B C Rank deficiency in concentration profiles [A] + [C] = [A]0 [B] + [C] = [B]0 a [A] - [B] + (a - 1) [C] = 0 [B]0 = a [A]0 Linear dependency [B] + [C] = a [A] + a [C]
A = C E + R [A]0 = 1 [B]0 = 1.5 k = 0.3 E = C \ A
Calculated pure spectra according to E = C \ A
Reconstructed data Measured data Residuals
Dimerization Equilibrium Dimerization equilibria can be seen in organic dyes solutions. Organic dyes are used in lasers, fluorescence spectroscopy , protein labeling, … .
Different geometrical coupling are seen in dimerization equilibria such as H-coupling and J coupling. Dimerization equilibria can be seen in concentration ranges 10-6- 10-3 M.
M + M D K D = [D] [M] 2 Mass balance roots function of MATLAB can be used to find roots of this polynomial equation. Negative and imaginary roots must be eleminated.
A function to calculate the concentration of monomer and dimer
Detecting the presence of dimerization Plotting Normalized spectra PCA analysis of data
Log(KD)=4 Singular values
Grid search for finding KD Noisy data Singular values
Resolved and real profiles
Dimerization of protonated form at constant pH 2 HM D M- + H+ K D = [D] [HM] 2 K a = M [H] [HM] Mass balance
Log(KD)=5, pKa=5, pH=5.4 Singular values Three component system with rank=2 ; rank deficient system
Conditional dimerization constant can be obtained by fitting on dimerization polynomial equation: Log(KD’)=3.90 𝐾 𝐷 = 𝐾 𝐷 ′ (1+ 𝐾 𝑎 [𝐻] ) 2
Dimerization of two forms, protonated and deprotonated, at constant pH 2 HM HD 2H+ + 2M- D K HD = [HD] [HM] 2 K D = [D] [M] 2 K a = M [H] [𝐻𝑀] Mass balance 2 𝐾 𝐷𝐻 𝐻 2 +2 𝐾 𝐷 𝐾 𝑎 2 [𝐻𝑀] 2 + 𝐻 2 + 𝐾 𝑎 𝐻𝑀 − 𝐻 2 𝐶 0 =0
Singular values Four components system with rank=2 ; rank deficient system 𝐻𝐷 =[𝐷]× 𝐾 𝐷𝐻 𝐾 𝐷 𝐾 𝑎 2 [𝐻] 2
Running experiment in other pH Singular values
Augmentation of two data sets pH=5.5 pH=9 Singular values
Fitting
Dimerization of protonated form at non-constant pH
Dimerization in the presence of Inert Impurity in solvent Impurity in solute Singular values Singular values
Dimerization and Trimerization Equilibrium M + M D M + M +M T K D = [D] [M] 2 K D = [T] [M] 3 Mass balance roots function of MATLAB can be used to find roots of this polynomial equation. Negative and imaginary roots must be eliminated.
Singular values
Obtaining of other thermodynamic parameters T=298K T=325K T=350K After analyzing KD can be obtained: Log(KD)=5.71 Log(KD)=5.24 Log(KD)=4.86
Van’t hoff Equation
Studying of dimerization equilibria by temperature changes Spectra of a solution in different temperatures Singular values
Grid search was used to find ΔH and ΔS.
Different views
Ssq surfaces for data in the absence of noise
Ssq surfaces for data in the presence of noise
Fminsearch function was used for fitting.
(fminsearch function) ΔH (kJ/mol) ΔS (J/mol.K) Real 60.0 90 Grid Search -59.89 -89.5 Nelder-Mead (fminsearch function) 59.95- 89.71- Residuals Concentration profiles; resolved and simulated Spectral profiles; resolved and simulated
Methylene Blue dye غلظت 5-10×2/5 مولار از متیلن بلو تهیه شد و طیف آن در دوازده دمای 9، 12، 16، 5/19، 23، 26، 8/30، 5/36، 41، 8/44، 49 و 56 درجه ثبت شد. نقطه ایزوبستیک مشاهده شد. به منظور جلوگیری از تداخل تعادل اسید باز pH محلول در2/00 تثبیت شد. طبف جذبی محلول 5-10×2/5 مولار متیلن بلو در دوازده دمای متفاوت طیف نرمالیزه متیلن بلو 5-10×5/2 مولار در دو دمای (a 9 و (b 56 درجه سانتی گراد
آنالیز رنگ نیل بلو و نوترال رد نمایش پنج مقدار منفرد اول برای سه رنگ متیلن بلو، نیل بلو و نوترال رد طیف جذبی محلول 5-10×2/75 مولار نیل بلو در یازده دمای متفاوت طیف نرمالیزه نیل بلو 5-10×2/75 مولار در دو دمای (a 15 و (b 65 درجه سانتی گراد طبف جذبی محلول 5-10×4/5 مولار نوترال رد در ده دمای متفاوت طیف نرمالیزه نوترال رد 5-10×4/5 مولار در دو دمای (a 7 و (b 52 درجه سانتی گراد
نمودار حاصل از جست و جوی شبکه ای برای سه رنگ متیلن بلو، نیل بلو و نوترال رد 5-10×2/5 مولار نوترال رد 5-10×4/5 مولار نیل بلو 5-10×2/75 مولار
نمودار log(ssq) بر حسب آنتالپی و آنتروپی های مینیمم شده برای سه رنگ متیلن بلو، نیل بلو و نوترال رد متیلن بلو 5-10×2/5 مولار نیل بلو5-10×2/75 مولار نوترال رد5-10×4/5 مولار
آنتالپی و آنتروپی بدست آمده به کمک دو روش بهینه سازی برای سه غلظت متفاوت از رنگ متیلن بلو، نیل بلو و نوترال رد متیلن بلو غلظت 5-10×2/75 5-10×3/5 5-10×4/5 نیلدر-مید 33/54∆H=- 42/38-∆S= 37/18∆H=- 57/76-∆S= 27/64∆H=- 21/00-∆S= جست وجوی شبکه ای 33/60∆H=- 42/60-∆S= 37/20∆H=- 57/89-∆S= 27/80∆H=- 21/60-∆S= نیل بلو نوترال رد غلظت 5-10×2/75 5-10×3/5 5-10×4/5 نیلدر-مید 35/62∆H=- 43/00-∆S= 39/54∆H=- 54/45-∆S= 33/11∆H=- 28/28-∆S= جست وجوی شبکه ای 35/70∆H=- 43/50-∆S= 39/50∆H=- 54/39-∆S= 32/80∆H=- 27/19-∆S= غلظت 5-10×2/5 5-10×3/5 5-10×4/5 نیلدر-مید 59/55∆H=- 122/00-∆S= 97/57∆H=- 247/00-∆S= 69/53∆H=- 158/81-∆S= جست وجوی شبکه ای 59/50∆H=- 122/10-∆S= 97/60∆H=- 247/30-∆S= 69/50∆H=- 158/90-∆S=
پرو فایل غلظتی مربوط به سه رنگ متیلن بلو، نیل بلو و نوترال رد حاصل از برازش (a مونومر (b دیمر متیلن بلو 5-10×2/5 مولار نیل بلو5-10×2/75 مولار نوترال رد5-10×4/5 مولار
پرو فایل غلظتی مربوط به سه رنگ متیلن بلو، نیل بلو و نوترال رد حاصل از برازش (a مونومر (b دیمر متیلن بلو 5-10×2/5 مولار نیل بلو5-10×2/75 مولار نوترال رد5-10×4/5 مولار
Dimerization in the presence of Inert Singular values Three component system with rank=2 ; rank deficient system
Results of fitting to Dimerization model without inert Real:* Resolved:__
Simulating oscillating chemical reactions using Microsoft Excel Macros Tutorial review: Simulating oscillating chemical reactions using Microsoft Excel Macros Abdolhossein Naseri*, Hossein Khalilzadeh and Saheleh Sheykhizadeh Analytical and Bioanalytical Chemistry Research, Accepted to publish
Oscillating reactions are one of the most interesting topics in chemistry and analytical chemistry. Fluctuations in concentrations of one the chemical reaction species (usually a reaction intermediate) create an oscillating chemical reaction. In oscillating systems, the reaction is far from thermodynamic equilibrium. In these systems at least one autocatalytic step is required. Developing an instinctive feeling for how oscillating reactions work will be invaluable to future generations of chemists.
𝐴→𝑋 (1.a) 𝐴+𝑋 →2𝑋 (1.b) 𝑋+𝑌 →2𝑌 (1.c) 𝑌 →𝐵 (1.d)
Using kinetic theory, the concentration-time equations of the species in a reaction mechanism can be defined by a system of ordinary differential equations (ODEs). Euler's method is a routine numerical integration method. This method uses a form of the Taylor series expansion truncated to the first derivative. Starting with the concentration at time 𝑡 𝑖−1 , the concentration at 𝑡 𝑖 is estimated using the derivative at t (Eq. 2). 𝑐 𝑡 𝑖 =𝑐 𝑡 𝑖−1 + 𝑑𝑐(𝑡) 𝑑𝑡 ∆𝑡
𝑋+𝑌 𝑘 𝑍 (3.a) 𝑑 𝑐 𝑋 𝑑𝑡 =−𝐾 𝑐 𝑋 𝑐 𝑌 (3.b) 𝑐 𝑋 𝑡 𝑖 = 𝑐 𝑥 𝑡 𝑖−1 −𝑘 𝑐 𝑋 𝑐 𝑌 ∆𝑡 (3.c)
Mechanism of oscillating reaction Lotka–Volterra model 𝐴+𝑋 𝐾 1 2𝑋 (6.a) 𝑋+𝑌 𝐾 2 2𝑌 (6.b) 𝑌 𝐾 3 𝐵 (6.c)
𝑑 𝑐 𝑋 𝑑𝑡 = 𝐾 1 𝑐 𝐴 𝑐 𝑋 − 𝐾 2 𝑐 𝑋 𝑐 𝑌 (7.a) 𝑑 𝑐 𝑌 𝑑𝑡 = 𝐾 2 𝑐 𝑋 𝑐 𝑌 − 𝐾 3 𝑐 𝑌 (7.b) 𝑑 𝑐 𝐵 𝑑𝑡 = 𝐾 3 𝑐 𝑌 (7.c) 𝑑 𝑐 𝐴 𝑑𝑡 =− 𝑘 1 𝑐 𝐴 𝑐 𝑋 (7.d) 𝑐 𝑋, 𝑡 𝑖 = 𝑐 𝑋, 𝑡 𝑖−1 + 𝑑 𝑐 𝑋 𝑑𝑡 ∆𝑡= 𝑐 𝑋, 𝑡 𝑖−1 + 𝐾 1 𝑐 𝐴 𝑐 𝑋, 𝑡 𝑖−1 − 𝐾 2 𝑐 𝑋, 𝑡 𝑖−1 𝑐 𝑌, 𝑡 𝑖−1 ∆𝑡 (8.a) 𝑐 𝑌, 𝑡 𝑖 = 𝑐 𝑌, 𝑡 𝑖−1 + 𝑑 𝑐 𝑌 𝑑𝑡 ∆𝑡= 𝑐 𝑌, 𝑡 𝑖−1 + 𝐾 2 𝑐 𝑋, 𝑡 𝑖−1 𝑐 𝑌, 𝑡 𝑖−1 − 𝐾 3 𝑐 𝑌, 𝑡 𝑖−1 ∆𝑡 (8.b) 𝑐 𝐵, 𝑡 𝑖 = 𝑐 𝐵, 𝑡 𝑖−1 + 𝑑 𝑐 𝐵 𝑑𝑡 ∆𝑡= 𝑐 𝐵, 𝑡 𝑖−1 + 𝐾 3 𝑐 𝑌, 𝑡 𝑖−1 ∆𝑡 (8.c)
One of the spreadsheet applications developed by Microsoft is Microsoft Excel. It has a grid of cells arranged in letter-named columns and numbered rows for organizing data manipulations. It allows sectioning of data to view its dependencies on various factors from different perspectives. Microsoft Excel has a programming ability, Visual Basic for Applications (VBA). This ability allows the user to employ a wide variety of numerical methods, e.g., solving differential equations of mathematical physics. The Macro Recorder is a common and easy way to generate VBA code. It records actions of the user and generates VBA code in the form of a macro. Running the macro lets users to repeat those actions automatically.
Thank you for your attention