441 Section 201
Sample inputs for LINGO for absorptivity example.
|Online Course Material
LINGO is a higher level language from which you can use Linear programming. The LP model is typically formulated in more general terms with access to data files containing for example, the requirements or availablities of raw materials and sets of variables etc. Examples throught the HELP function may be useful. Please note that there is some careful syntax to trip you up. Each `line' (say a constraint or the objective function) ends with a semicolon ;
and you can embed comments using !comment here between exclamation and semicolon; Also multiplication is expressely done with * key and is not implicit as in LINDO. Many other pitfalls as well. Good luck.
!a=(best guessof) concentration of adenine in sample;
!c=(best guessof) concentration of cytosine in sample;
!g=(best guessof) concentration of guanine in sample;
!t=(best guessof) concentration of thiamine in sample;
!u=(best guessof) concentration of uracil in sample;
!guess(wavelength)=absorptivity predicted by choices for a,c,g,t,u;
!error(wavelength) is greater than or equal to |guess(wavelength)-abssample(wavelength|;
!diff is greater than equal to all errors and, because we are minimizing,it will end up as;
!min |guess(wavelength)-abssample(wavelength)| over all wavelengths;
wavelength / 220 230 240 250 260 270 280 290 300 310 320 330/: abssample,
absa, absc, absg, abst, absu, guess, error;
@for(wavelength(j): [guessabs] absa(j)*a+absc(j)*c+absg(j)*g
@for(wavelength(j): [onediff] -error(j)+guess(j)< abssample(j));
@for(wavelength(j): [otherdiff] error(j)+guess(j)> abssample(j));
@for(wavelength(j): [finalerror] diff-error(j)>0);
I had the excel file absorptivity.xls in the Z drive. When accessinging it in LINGO, the file must be closed. I had some challenges getting the name correct. I suspect a more generic access to the spreadsheet is possible but giving the specific locations `B2-B13' worked.