Find the approximation in the 3rd order polynomial equation for the heat
capacity of carbon dioxide shown in the literature data below.
/* Approximation in 3rd order polynomial (hear capacity
of carbon dioxide) */
VAR x(8) "Temperature [K]" ..
,y(8) "Heat capacity (lit.) [J/mol.K]" ..
,ycal(8) "Heat capacity (calc.)[J/mol.K]" ..
,e(8) "Marginal error"
x = ( 250, 300, 400, 500, 700, 1000, ..
1200, 1500 )
y = ( 35.44, 37.52, 41.44, 44.68, 49.59, 54.32, ..
56.34, 58.38 )
ycal = a + b*x + c*x^2 + d*x^3
e = y - ycal
FIND (a#1,b#1,c#1,d#1) LEAST e
OUTPUT a, b, c, d
Explanation
- X, y, ycal and e are arrays with 8 elements. Array variables are
required to be specified in the VAR statement in advance.
- The least-squares method is specified in the FIND statement. The
coefficients a,b,c and d that minimize the sum of the residual error e
square between the literature data y and the calculation data ycal are
to be solved. The number after " # " is an initial value.
Enter equations and click on the [Solve] button.
The following sample problems will help you understand how EQUATRAN-G works.