24Chapter2SolvingMathProgramswithLINGOBOPENCtrl+OUse the OPEN command from the File menu, press Ctrl+O, or use the button to open an existing file,typically a model file.SAVE Ctrl+sUse the SAVE command from the File menu, press Ctrl+S, or use the button to save the active(frontmost)window.You can saveanywindowModel,Report, orCommand-inthisway.If thewindow is a new Model window, a Report window, or the Command window, SAVE opens the SAVEAS... dialog.SAVEAS...F5UsetheSAVEAS...commandfromtheFilemenu orpressF5tosavetheactive(frontmost)windowunder thename you enter in the dialogbox.CLOSEF6Use the CLOSE command from the File menu or press F6 to close the active (frontmost) window. Ifthe window is a new Model window or you have changed the file,you will be asked whether you wantto save the changes.图PRINT F7Use the PRINT command from the File menu, use the button, or press F7 to send the active(frontmost)window to your printer.PRINT SETUP... F8UsethePRINTSETUP...commandfromtheFilemenuorpressF8toselecttheprintertowhichyouwant output to go.PRINTPREVIEWShift+F8Use the PRINT PREVIEW command from the File menu or press Shiff+F8 to display each page of theactive (frontmost)windowas it will appear when printed.LOGOUTPUT... F9UsetheLOG OUTPUT...command fromtheFile menu orpressF9 to send all subsequent screenactivity, which would be sent to the Command Window, to a text file. The command opens a standardWindows file dialog from which you can name the log file and choose to echo output to the screen.You may also choose either to overwrite an existing file in the Log Output... dialog box or to appendsubsequent outputto it.Once you have selected a file to write to, a check will appear in the File menu before the LogOutput...Command. To turn off Log Output, simply select thecommand again.TAKECOMMANDS...F11Use the TAKE COMMANDS..command from the File menu or press FII to“"Take" a LINGO batchfilewithcommands andmodeltextforautomatedoperation
24 Chapter 2 Solving Math Programs with LINGO OPEN Ctrl+O Use the OPEN command from the File menu, press Ctrl+O, or use the button to open an existing file, typically a model file. SAVE Ctrl+S Use the SAVE command from the File menu, press Ctrl+S, or use the button to save the active (frontmost) window. You can save any window — Model, Report, or Command— in this way. If the window is a new Model window, a Report window, or the Command window, SAVE opens the SAVE AS. dialog. SAVE AS. F5 Use the SAVE AS. command from the File menu or press F5 to save the active (frontmost) window under the name you enter in the dialog box. CLOSE F6 Use the CLOSE command from the File menu or press F6 to close the active (frontmost) window. If the window is a new Model window or you have changed the file, you will be asked whether you want to save the changes. PRINT F7 Use the PRINT command from the File menu, use the button, or press F7 to send the active (frontmost) window to your printer. PRINT SETUP. F8 Use the PRINT SETUP. command from the File menu or press F8 to select the printer to which you want output to go. PRINT PREVIEW Shift +F8 Use the PRINT PREVIEW command from the File menu or press Shift+F8 to display each page of the active (frontmost) window as it will appear when printed. LOG OUTPUT. F9 Use the LOG OUTPUT. command from the File menu or press F9 to send all subsequent screen activity, which would be sent to the Command Window, to a text file. The command opens a standard Windows file dialog from which you can name the log file and choose to echo output to the screen. You may also choose either to overwrite an existing file in the Log Output. dialog box or to append subsequent output to it. Once you have selected a file to write to, a check will appear in the File menu before the Log Output. Command. To turn off Log Output, simply select the command again. TAKE COMMANDS. F11 Use the TAKE COMMANDS. command from the File menu or press F11 to “Take” a LINGO batch file with commands and model text for automated operation
25SolvingMathProblemswithLINGOChapter2IMPORTLINDOFILE...F12Use the IMPORT LINDO FILE... command from the File menu or press FI2 to open a file containingaLINDOmodelinLINDOTAKEformatEXPORTFILEUse the MPS FORMAT... or MPIFORMAT... sub-commands from the File |Export File command towrite MPS or MPI format files, respectively. The MPS file format is an industry standard formatdeveloped by IBM and is useful for passing models from one solver or platform to another.The MPIfile format is a special format developed by LINDO Systems for representing all classes ofmathematicalprogramslinear,integer,andnonlinear.LICENSEUsetheLICENSEcommandfromtheFilemenuto enteranewpasswordforLINGO.Someversionsof LINGO require the user to input a password. Think of the password as a "key" that unlocks theLINGO application.If you upgrade your copy of LINGO, you will need to enter a new password.DATABASEUSERINFOUse the DATABASE USER INFO command from the File menu when linking models directly todatabases through use of the@ODBCO function. Many times the database you link your model to willrequire a user id and/or password.To avoid having to enteryour user id and password each timeyourmodelis run, you can input them once at the start of your session using this command.EXITF10UsetheEXITcommandfromtheFilemenuorpressFI0toquitLINGO2.2.2 Edit MenuUNDOCtrI+ZUsetheUNDO commandfrom theEdit menu,orpressCtrl+Z,to undothelastaction品CUTCtrl+XUse the CUT command fromtheEdit menu,click thebutton, or pressCtr/+Xto clearthe selected textandplaceitontheclipboardforpasting电COPYCtrl+CUse the COPY command from the Edit menu, click the button, or press Ctrl+C to copy the selectedtext to the clipboard for pastingPASTE Ctrl+VUse the PASTE command from the Edit menu, click the button, or press Ctrl+V to paste clipboardcontents at the insertion point.PASTESPECIAL.Use the PASTE SPECIAL command from the Edit menu to insert a selected item from the Windowsclipboard intothe active (frontmost)window atthe cursor insertion point, allowing choiceas tohowthe object is pasted
Solving Math Problems with LINGO Chapter 2 25 IMPORT LINDO FILE. F12 Use the IMPORT LINDO FILE. command from the File menu or press F12 to open a file containing a LINDO model in LINDO TAKE format. EXPORT FILE Use the MPS FORMAT. or MPI FORMAT. sub-commands from the File | Export File command to write MPS or MPI format files, respectively. The MPS file format is an industry standard format developed by IBM and is useful for passing models from one solver or platform to another. The MPI file format is a special format developed by LINDO Systems for representing all classes of mathematical programs—linear, integer, and nonlinear. LICENSE Use the LICENSE command from the File menu to enter a new password for LINGO. Some versions of LINGO require the user to input a password. Think of the password as a “key” that unlocks the LINGO application. If you upgrade your copy of LINGO, you will need to enter a new password. DATABASE USER INFO Use the DATABASE USER INFO command from the File menu when linking models directly to databases through use of the @ODBC() function. Many times the database you link your model to will require a user id and/or password. To avoid having to enter your user id and password each time your model is run, you can input them once at the start of your session using this command. EXIT F10 Use the EXIT command from the File menu or press F10 to quit LINGO. 2.2.2 Edit Menu UNDO Ctrl+Z Use the UNDO command from the Edit menu, or press Ctrl+Z, to undo the last action. CUT Ctrl+X Use the CUT command from the Edit menu, click the button, or press Ctrl+X to clear the selected text and place it on the clipboard for pasting. COPY Ctrl+C Use the COPY command from the Edit menu, click the button, or press Ctrl+C to copy the selected text to the clipboard for pasting. PASTE Ctrl+V Use the PASTE command from the Edit menu, click the button, or press Ctrl+V to paste clipboard contents at the insertion point. PASTE SPECIAL. Use the PASTE SPECIAL command from the Edit menu to insert a selected item from the Windows clipboard into the active (frontmost) window at the cursor insertion point, allowing choice as to how the object is pasted
26Chapter2SolvingMathProgramswithLINGOSELECTALL... Ctrl+AUse the SELECT ALL command from the Edit menu or press Ctr/+A to select the entire contents of theactive(frontmost)window.UINDCt+Use the FIND command from the Edit menu or press Ctrl+Fto search for a desired string of text inthe active (frontmost)windowFINDNEXT...CtrI+NUsetheFINDNEXTcommandfromtheEditmenuorpressCtr/+Ntofind thenext instanceofthetextmostrecentlysearchedforusingtheFiNDcommandintheactive(frontmost)windowREPLACE Ctrl+HUsetheREPLACEcommandfromtheEdit menu orpress Ctrl+Htoreplaceonestringof textwithanotherintheactive(frontmost)windowGOTOLINE...CtrI+TUse the GOTO LINE command from the Edit menu, click on the button, or press Ctrl+T to enter alinenumberoftheactivewindowtowhichyouwanttogo6MATCHPARENTHESISCtrI+PUse the MATCH PARENTHESIS command from the Edit menu, click the button, or type Ctrl+P tofind the close parenthesis that corresponds to the open parenthesis you have selected.In addition to this command, there is one other way to find matching parentheses. LINGO willhighlight matching parentheses in red when the Match Paren option is enabled under theLINGOOptionscommand(seebelow).Byplacingthecursorimmediatelyafteroneoftheparenthesesof interest,you will noticethat thecolor of theparenthesis changesfromblackto red.LINGO willsimultaneouslydisplay the matching parenthesis in red.These parentheses will remain displayed in reduntil you move the cursor to another position.PASTE FUNCTIONUsethePASTEFUNCTIONcommandfromtheEditmenutopasteanyof LINGO'sbuilt-infunctionsat the current insertion point.Choose the category of theLINGOfunction you want to paste, thenselect thefunction from thecascading menu.LINGO inserts placeholders for arguments inthefunctions.SELECTFONT...Ctrl+JUsetheSELECTFONTcommandfromtheEditmenuorpressCtr/+Jtoselectanewfontinwhichtodisplay the currently selected text.INSERTNEWOBJECTUsetheINSERTNEWOBJECT commandfromthe Editmenu toembed anOLE objectinto theLINGOdocument
26 Chapter 2 Solving Math Programs with LINGO SELECT ALL. Ctrl +A Use the SELECT ALL command from the Edit menu or press Ctrl+A to select the entire contents of the active (frontmost) window. FIND . Ctrl+F Use the FIND command from the Edit menu or press Ctrl+F to search for a desired string of text in the active (frontmost) window. FIND NEXT. Ctrl +N Use the FIND NEXT command from the Edit menu or press Ctrl+N to find the next instance of the text most recently searched for using the FIND command in the active (frontmost) window. REPLACE Ctrl +H Use the REPLACE command from the Edit menu or press Ctrl+H to replace one string of text with another in the active (frontmost) window. GO TO LINE. Ctrl+T Use the GO TO LINE command from the Edit menu, click on the button, or press Ctrl+T to enter a line number of the active window to which you want to go. MATCH PARENTHESIS Ctrl+P Use the MATCH PARENTHESIS command from the Edit menu, click the button, or type Ctrl+P to find the close parenthesis that corresponds to the open parenthesis you have selected. In addition to this command, there is one other way to find matching parentheses. LINGO will highlight matching parentheses in red when the Match Paren option is enabled under the LINGO|Options command (see below). By placing the cursor immediately after one of the parentheses of interest, you will notice that the color of the parenthesis changes from black to red. LINGO will simultaneously display the matching parenthesis in red. These parentheses will remain displayed in red until you move the cursor to another position. PASTE FUNCTION Use the PASTE FUNCTION command from the Edit menu to paste any of LINGO’s built-in functions at the current insertion point. Choose the category of the LINGO function you want to paste, then select the function from the cascading menu. LINGO inserts place holders for arguments in the functions. SELECT FONT. Ctrl +J Use the SELECT FONT command from the Edit menu or press Ctrl+J to select a new font in which to display the currently selected text. INSERT NEW OBJECT Use the INSERT NEW OBJECT command from the Edit menu to embed an OLE object into the LINGO document
SolvingMathProblemswithLINGOChapter227LINKSUse the LINKS command from the Edit menu to control the links to external objects in your document.OBJECTPROPERTIES Alt+EnterUsetheOBJECTPROPERTIEScommandfromtheEditmenuorpressAlt+Entertospecifytheproperties ofa selected, embedded object2.2.3LINGO MenuSOLVE Ctr+uUsetheSOLVEcommandfromtheLINGOmenu,clickonthebutton,orpressCtr/+Utosend themodel currently in memoryto theLINGO solver.If you have more than onemodel open, thefrontmost (or active) window is the one in memory.SOLUTION...CtrI+WUse the SOLUTION command from the LINGO menu, click the button, or press Ctrl+W to open theSolutions dialog box.Here you can specify the way you want a report of the solution currently inmemoryto appear.When you click OK,LINGOwrites the report to a Report Window.RANGE Ctrl+RUsetheRANGEcommand from theLINGOmenuorpressCtr/+R to see a standardrange report区OPTIONS...CtrI+IUse the OPTIONS... command from the LINGO menu, click the button, or press Ctrl+I to change anumberof parameters thataffecttheconfigurationoftheprogramGENERATE...Ctrl+G/Ctrl+QUsetheDISPLAYMODELandDON'TDISPLAYMODELsub-commandsfromtheLINGO|Generatecommand or press Ctr+Gor Ctrl+Q,respectively,to create an expanded version of thecurrent model.The expanded model explicitly lists all the generated constraints and variables in your model.If you choose to display the model, LINGO will place a copy of the generated model in a newwindow, which you may scroll through to examine, print, or save to disk. If you choose not to displaythe model, LINDO will generate themodel without displaying it, but will store the generated model forlater use by the appropriate solver.PICTURECtrI+KUse the PICTURE commandfrom the LINGO menu or press Ctr/+K todisplaya model inmatrixform. Viewing the model in matrix form can be helpful in identifying special structure in your model.MODELSTATISTICSCtrI+EUse the MODEL STATISTICS command from the LINGO menu or press Ctrl+E to list summarystatistics for your model. The statistics shown vary slightly depending on whether the model you'reworkingwithis linearornonlinear
Solving Math Problems with LINGO Chapter 2 27 LINKS Use the LINKS command from the Edit menu to control the links to external objects in your document. OBJECT PROPERTIES Alt+Enter Use the OBJECT PROPERTIES command from the Edit menu or press Alt+Enter to specify the properties of a selected, embedded object 2.2.3 LINGO Menu SOLVE Ctrl+U Use the SOLVE command from the LINGO menu, click on the button, or press Ctrl+U to send the model currently in memory to the LINGO solver. If you have more than one model open, the frontmost (or active) window is the one in memory. SOLUTION. Ctrl+W Use the SOLUTION command from the LINGO menu, click the button, or press Ctrl+W to open the Solutions dialog box. Here you can specify the way you want a report of the solution currently in memory to appear. When you click OK, LINGO writes the report to a Report Window. RANGE Ctrl+R Use the RANGE command from the LINGO menu or press Ctrl+R to see a standard range report. OPTIONS. Ctrl +I Use the OPTIONS. command from the LINGO menu, click the button, or press Ctrl+I to change a number of parameters that affect the configuration of the program. GENERATE. Ctrl+G/Ctrl+Q Use the DISPLAY MODEL and DON’T DISPLAY MODEL sub-commands from the LINGO | Generate command or press Ctrl+G or Ctrl+Q, respectively, to create an expanded version of the current model. The expanded model explicitly lists all the generated constraints and variables in your model. If you choose to display the model, LINGO will place a copy of the generated model in a new window, which you may scroll through to examine, print, or save to disk. If you choose not to display the model, LINDO will generate the model without displaying it, but will store the generated model for later use by the appropriate solver. PICTURE Ctrl+K Use the PICTURE command from the LINGO menu or press Ctrl+K to display a model in matrix form. Viewing the model in matrix form can be helpful in identifying special structure in your model. MODEL STATISTICS Ctrl+E Use the MODEL STATISTICS command from the LINGO menu or press Ctrl+E to list summary statistics for your model. The statistics shown vary slightly depending on whether the model you're working with is linear or nonlinear
28Chapter2SolvingMathProgramswithLINGOLOOK...Ctrl+LUse the LOOK command from the LINGO menu or press Ctrl+L to generate a report containing yourmodel's formulation. The LOOK command lets you choose all or selected lines of a model forviewing.This command is mainly of interest if you are working in command linemode ratherthan themore typical Windows environment.2.2.4 Windows MenuCOMMANDWINDOWCtrI+1UsetheCOMMANDWINDOWcommandfromtheWindowsmenuorpressCtr/+ItoopenLINGO'sCommand Window.TheCommand Windowgivesyou accesstoLINGO'scommand lineinterface.Ingeneral, Windows users will not need tomake use of the Command Window.It is provided for userswho may want to put together application-specific "products" that make use of LINGO throughCommand Window scripts to control the program. Please refer to your help file or user's manual formoreinformationonthecommandlinecommandsSTATUSWINDOWCtrl+2UsetheSTATUSWINDOWcommandfromtheWindowsmenuorpressCtrl+2toopenLINGO'sSolver Status window.GSENDTOBACKCtrI+BUse the SEND TO BACK command from the Windows menu, click on the button, or press Ctrl+B tosend the active (frontmost)windowto the back.This command isvery useful for switching between aModel window and a Report Window.CLOSE ALCt+s?UsetheCLOSEALLcommandfromtheWindowsmenu,click on thebutton, orpress Ctr+3tocloseall open model windowsand dialogboxesTILECtrl+4UsetheTILEcommandfromtheWindowsmenu orpressCtr/+4toarrangeall openwindows,sotheyeachoccupythesameamountofspacewithintheLINGOprogramwindow.CASCADECtrl+5Use the CASCADE command from the Windows menu or press Ctrl+5 to arrange all open windows ina cascade from upper left to lower right with the currently active window on top.ARRANGEICONSCtrI+6Use the ARRANGE ICONS command from the Windows menu or press Ctrl+6 to move iconsrepresenting any minimized windows, so they are arranged across the bottom of the screen.LISTOFWINDOWSA list of all open windows appears at the bottom of the Windows menu, with the currently activewindow checked.You may selecta window from the list to bring it to the front
28 Chapter 2 Solving Math Programs with LINGO LOOK. Ctrl+L Use the LOOK command from the LINGO menu or press Ctrl+L to generate a report containing your model’s formulation. The LOOK command lets you choose all or selected lines of a model for viewing. This command is mainly of interest if you are working in command line mode rather than the more typical Windows environment. 2.2.4 Windows Menu COMMAND WINDOW Ctrl +1 Use the COMMAND WINDOW command from the Windows menu or press Ctrl+1 to open LINGO’s Command Window. The Command Window gives you access to LINGO’s command line interface. In general, Windows users will not need to make use of the Command Window. It is provided for users who may want to put together application-specific “products” that make use of LINGO through Command Window scripts to control the program. Please refer to your help file or user’s manual for more information on the command line commands. STATUS WINDOW Ctrl +2 Use the STATUS WINDOW command from the Windows menu or press Ctrl+2 to open LINGO’s Solver Status window. SEND TO BACK Ctrl+B Use the SEND TO BACK command from the Windows menu, click on the button, or press Ctrl+B to send the active (frontmost) window to the back. This command is very useful for switching between a Model window and a Report Window. CLOSE ALL Ctrl+3 Use the CLOSE ALL command from the Windows menu, click on the button, or press Ctrl+3 to close all open model windows and dialog boxes. TILE Ctrl+4 Use the TILE command from the Windows menu or press Ctrl+4 to arrange all open windows, so they each occupy the same amount of space within the LINGO program window. CASCADE Ctrl+5 Use the CASCADE command from the Windows menu or press Ctrl+5 to arrange all open windows in a cascade from upper left to lower right with the currently active window on top. ARRANGE ICONS Ctrl+6 Use the ARRANGE ICONS command from the Windows menu or press Ctrl+6 to move icons representing any minimized windows, so they are arranged across the bottom of the screen. LIST OF WINDOWS A list of all open windows appears at the bottom of the Windows menu, with the currently active window checked. You may select a window from the list to bring it to the front