Thread Content
I have just created a refractive index curve, and I want to fit an equation to it in order to reduce human error when referring to the graph. I’m not sure which software would be suitable; I’d appreciate some advice
Origin can be used for fitting, or MATLAB
Origin offers powerful linear regression and curve fitting functions, the most representative of which are linear regression and nonlinear least squares fitting. Origin7.5 provides over 200 mathematical expressions for curve fitting. Furthermore, Origin 7.5 also allows users to easily define their own fitting functions to meet certain specific requirements. Similar to Origin’s built-in functions, once defined, these custom fitting functions can be stored in Origin for use later. Origin7.5 also provides a Nonlinear Least Squares Fitting Wizard, which makes curve fitting easier. In inorganic chemistry experiments, physical chemistry experiments, and principles of chemical engineering experiments, data processing often involves fitting certain data points in order to determine the parameters we need. For example: (1) In inorganic chemistry, regarding the data processing of reaction rates and activation energy, we know that there is generally the following relationship between the reaction rate constant and temperature T: lg = A – Ea/RT, where Ea is the reaction activation energy, R is the molar gas constant, and T is the thermodynamic temperature. By measuring values at different times and plotting them against lg, a straight line is obtained; the activation energy Ea of the reaction can be determined from the slope of this line (which equals –). (2) In physical chemistry experiments, the maximum bubble pressure method is used to determine the surface tension of solutions. From thermodynamic principles, it is known that the relationship between them is governed by Gibbs’ adsorption equation: =- ( )T, where represents the amount of surface adsorption ; T is the thermodynamic temperature; c is the concentration of the dilute solution ; R is the molar gas constant. The adsorption amount at various concentrations is determined using Gibbs’ equation; a -c graph is plotted, and the surface tension value can be calculated from the slope of the line. (3) In the experiment on chemical engineering principles concerning the determination of the air heat transfer film coefficient under forced convection, similarly, using the formula Nu = CRe^m, the unknown parameters C and m can be determined. By obtaining relevant data for steam and air through experiments, a Re-Nu graph can be created on a dual-log scale, thereby yielding the heat transfer parameters C and m.
Origin handles data very well, but it would be better to transform the following formula using linear fitting for greater accuracy. For example: y=a*exp(x) should be transformed into lny=x+lna
Origin, MATLAB, Mathematica; even simple Excel will do
If you don’t have any other software available, Excel can be used. Excel can not only simply simulate linear, polynomial, and logarithmic equations. Optimization methods, such as least squares fitting, can also be utilized, and with the addition of planning components, complex fitting according to predefined equations can be carried out.
For linear equations, Excel’s fitting function is sufficient for your needs; multiple equations can provide extremely high fitting accuracy.
Actually, it’s easy for a person to write such a program – one just needs to understand computer-aided geometric design. However, I should warn you that the commercial software we use relies heavily on NURBS curves, but B-splines are generally sufficient for most applications~
Origin is very useful; MATLAB is more professional, so it is recommended to use Origin.
MATLAB is a professional mathematical software with high computational accuracy.
Both MATLAB and Excel are very useful.
I think EXCEL will work fine; the fitting results are similar to those from ORIGIN, as both use least squares method
Be careful; the normal equations obtained by least squares are often ill-conditioned, and corresponding countermeasures should be taken. Various software or programs have been used, with damping least squares being the best option.