Robotics
Circuit Design
Medicine
Glass Melting
Computation with SINGULAR
By symbolic methods the describing equations can be generated automatically (in a ring with long floating numbers) using the initial data (molecular weight, temperature, initial concentrations). These equations can then be solved by using a globally converging Newton method.

LIB "glas.lib"; // Procedures: gemischsnamen, createchemkoeff, gleichungen, konzplus, getstart
LIB "ntsolve.lib"; // Procedure: nt_solve
// Notations for the initial elements
list n="C","M","A","S";
// The matrix containing the molecular weights of the chemical compounds
intmat vb[4][16]=
1,2,0,3,12,1,1,1,2,0,1,0,0,0,2,1,
0,0,0,0, 0,0,0,0,0,2,1,1,2,1,1,1,
0,0,3,1, 7,2,6,1,1,2,0,0,0,1,0,0,
1,1,2,0, 0,0,0,2,1,5,2,1,1,0,2,1;
// Temperature T (in degree Kelvin)
number T=1273;
// Quasipotentials of the initial elements
vector Gb=[710.32,632.11,1832.41,1014.23];
// Quasipotentials of the compounds
vector Gv=[1809.47,2614.19,7538.19,4066.45,21839.93,
4446.45,11777.19,4704.59,4462.73,10137.22,
3543.27,1702.53,2399.79,2470.85,4365.37,
2536.67];
// The initial concentrations
vector z=[0.1,0.25,0.4,0.25];

Automatical symbolic model generation

// generate appropriate names for the variables
string namen=gemischsnamen(n,vb);
// define the ring
string rr="ring gemisch=(real,30),("+namen+",Mol),(c,dp);";
execute(rr);
// generate the (transformed) equations
int trans=2; // Exponent of the transformation
vector Ch=createchemkoeff(trans,T,Gb,Gv,vb);
ideal gl=gleichungen(trans,Ch,vb);
gl=homog(gl,Mol);
ideal in=konzplus(gl,z);

Solution with SINGULAR

// generate (heuristic) initial values
ideal st=getstart(16,0.001,z);
// Parameters
intvec pp=100,15,0;
// Solving with automatically damped Newton method
ideal aa=nt_solve(in,st,pp);
// aa contains the solutions
Conclusion

Sao Carlos, 08/02 http://www.singular.uni-kl.de