使用lingo求解数学程序2指南教程chapter2.pdf
2
SolvingMathProgramswith
LINGO
2.1Introduction
Theprocessofsolvingamathprogramrequiresalargenumberofcalculationsandis,therefore,best
performedbyacomputerprogram.ThecomputerprogramwewilluseiscalledLINGO.Themain
purposeofLINGOistoallowausertoquicklyinputamodelformulation,solveit,assessthe
correctnessorappropriatenessoftheformulationbasedonthesolution,quicklymakeminor
modificationstotheformulation,andrepeattheprocess.LINGOfeaturesawiderangeofcommands,
anyofwhiaybeinvokedatanytime.LINGOcheckswhetheraparticularcommandmakessense
inaparticularcontext.
LINGOisavailableintwoversions:
1)aWindows-specificversion,and
2)ageneric,text-basedversion.
Thetext-basedversionrunsundermostpopularoperatingsystems,ludingUnixandLinux.For
eitherversion,additionalinformationisavailabletotheuserundertheHelpitemorHelp
command.TheWindowscommandsarecoveredbrieflyhere.Afterthecommandssection,wewill
showyouhowtoenndsolveasimplemodel.
2.2LINGOforWindows
WhenLINGOforWindowsstarts,itopensablankwindowknownasaModelWindow.TheModel
Windowiswhereyou“doallyourwork”.OutputinLINGOisdisyedinaReportWindow.LINGO
cangenerateanumberofreportspertainingtoyourmodel.Thefollowingisalistofallthecommands
thatareavailabletoyou,mainlyinthemodelwindow.
2.2.1File
NEWF2
UsetheNEWcommandfromtheFile,pressF2,orusethebuttontocreateanewModel
window.IntheModelwindow,youcanenteryourmodel.