|
OR/MS Today, August 1997 Software Review: By Jerry AllisonTK Solver from Universal Technical Systems, Inc. (UTS) has been around since the early 1980s. Over the years, TK Solver has evolved from a basic equation solver to a versatile mathematical modeling and application development tool. It has proven to be popular, especially among engineers and physical scientists. Release 3 for Windows has added several features that should make it even more so. These features include OLE Automation support for custom front-end programming using Visual Basic, Microsoft Excel or other environments; OLE 2.0 support for dynamic linking and embedding of TK objects into Microsoft Office documents; external function calls using FORTRAN, C, Pascal and other compiled languages; a set of Wizards to aid in list solving, plotting and unit conversion; and a Greek character palette for math equations.Word has been received from UTS that it is currently beta testing a 32-bit version of TK Solver for Windows 95/NT. This review, however, covers the Windows 3.x version. TK Objects and TK Solver's Sheet Structure TK designers "hard wired" into TK Solver's structure nine classes of objects, each of which has a specific role and that prove to be useful for TK model development and for running TK applications. The summaries of object classes and the individual objects reside in sheets and subsheets; their attributes may be viewed in windows brought up through TK Window menu, a special Object Bar or icons located at the bottom of the main TK window. The nine different sheets are:
There is a 10th icon at the bottom of the TK Solver window; this icon does not represent a sheet. It is the "MathLook" icon, which is used to access the MathLook window. This special window is used primarily to display equations in math notation and can be very useful for debugging purposes. It can also be used to display bitmap images. It is not directly linked to the rule sheet, however, so changes in this window are not active in the model. The TK Equation Solver TK Solver is based on a declarative (as opposed to procedural) programming language. This means that the equations can be entered in any order on the rule sheet, and the "unknowns" can be anywhere within an equation, instead of being isolated on the left hand side. This declarative language allows the model developer to easily add or delete rules without being concerned about the impact on the remaining rules. At the heart of the TK system is the equation solver. Actually, there are two different solvers in TK; one is called a "Direct Solver" and the other is referred to as an "Iterative Solver." TK always attempts to use the Direct Solver first. The Direct Solver will yield a correct solution to an equation if the following conditions are met:
Figure 1 shows the steady-state solution to a simple three-state Markov chain. The rule sheet shows three equations in three unknowns, the steady-state probabilities, pi 1, pi 2 and pi 3. These variables, incidentally, make use of the Greek letter palette shown on the right of the screen. The variable sheet shows the solution values of these variables. The solution to this system was not possible using the Direct Solver, since conditions 1 and 2 listed above are not met. This was initially indicated (in a screen display not shown here) by a flag in the status field of each rule showing that the rule was unsatisfied. Therefore, "guess" values had to be supplied for two of the variables, and the Iterative Solver was then invoked. Since this is a linear system, it does not really matter what "guess" values are supplied; the same solution will result. Lists and Matrices in TK Solver Lists play a major role in TK Solver. These single-dimension arrays can contain numeric values, symbolic values or blanks. There are several different ways to create a list (so many, in fact, that the beginner may feel somewhat daunted by the choices). Consider a simple case in which the user wants to calculate several values of a dependent variable over a certain range of an independent variable. To do this, a list is needed for each variable. The simplest way to create a list is by entering an "L" in the status field of a variable on the variable sheet. This will cause an entry having the same variable name to appear on the list sheet, and a list subsheet will be automatically created. Just as there are several ways to create a list, there are also several ways to fill a list. TK provides a List Wizard which is very useful in filling the positions in the independent variable's list in this simple case. Then the list-solving mechanism can be used to calculate corresponding values in the dependent variable's list. Matrix operations are handled in a somewhat unusual way. TK Solver does not really have matrices, per se. Instead, a "list of lists" is used. Each list within this "list of lists" represents a row or column (user's choice) of a matrix. Since only one list (row or column in this case) is displayed at a time, working with a matrix in this way could be awkward. To get around this, TK provides an "interactive table," in which several lists can be displayed as rows or columns. Any changes made in this table will automatically be reflected in the lists involved. Matrix operations such as multiplication, inversion, etc. are most easily performed using procedures supplied in the TK Library. Data can be imported into a model from Lotus spreadsheets. Each column in the spreadsheet becomes a list in TK Solver. Excel spreadsheets are not supported in this version, but the user can convert these to Lotus format within Excel before importing into TK Solver. The TK Library By clicking on the Applications menu, the user has access to the TK Library, a set of more than 200 files which can be used to aid in program development. Programs and routines in this library can be modified by the user to meet specific needs. These files are divided into 18 groups under four main headings: Utilities, Math, Statistics and Examples. Most operations researchers will be interested in the Math and Statistics categories. Under Math, programs can be found which deal with topics such as roots of equations, differentiation and integration, differential equations, special functions, matrix algebra, complex variables and optimization (including two-phase simplex, Marquardt's quadratic approximation, conjugate-gradient method, Nelder-Mead, Brent's method, and golden section search). Under Statistics, programs are divided into descriptive statistics and hypothesis testing, probability distributions, and curve fitting. To use a routine in the TK Library, the routine's file is first loaded into the current application. This updates the function sheet and subsheets. The user then provides arguments to the library routine through function calls on the rule sheet. In addition to the applications found in the TK library, the Royal Military College of Canada maintains a TK Solver web page (http://www.rmc.ca/other/tksolver/tkpage.html). User-developed applications can be downloaded from this site. Most of the applications found here are in engineering and the physical sciences. Plotting in TK Solver TK plots are made using tables or lists of data in a model. It is up to the user to fill these tables or lists. Then a Plot Wizard can be used to enhance the plots. The Wizard includes a gallery of 14 two-dimensional and 12 three-dimensional chart types. In addition to the Plot Wizard, the TK Library contains plotting routines which the user can load into a model and greatly enhance the graphics capability. For instance, Figure 2 contains a plot of the hyperbolic paraboloid function10z = x2 - y2 in cavalier projection. This plot was created by the TK function "graph3," which is located in the TK Library. ![]() Figure 2 also illustrates the TK sheet structure. The rule sheet contains a call to the function "graph3." The variable sheet contains values for each variable used in the plotting function. The function sheet (partially hidden behind the plot sheet) contains the procedure function "graph3," and the plot sheet contains the graph of the hyperbolic paraboloid function. Reviewer's Comments Installation of the program under Windows 95 was very straightforward and was easily completed in less than 30 minutes. Documentation comes in two volumes, a User's Guide and a "Getting Started" manual which contains an overview of TK Solver, a tutorial and troubleshooting tips. The tutorial is highly recommended. For application developers, the User's Guide also contains an appendix which gives an overview of OLE automation and external function calls. To really learn TK Solver, I would recommend that a new user cover the sections of the User's Guide in order. I tried to skip around to explore different capabilities of the software, but found in many instances that I did not understand some key principles which had been covered earlier in the User's Guide. I feel that more illustrative examples might have helped. There are several good examples in the documentation, but I still found myself wishing for more. There are two aspects of TK Solver which I think could be improved. The first is the way in which matrices are handled. The use of a "list of lists" to represent the columns or rows of a matrix just seems awkward. A spreadsheet-like interface with direct data entry would be much easier to use. The second is related to the solution of simple linear systems of equations, such as the Markov process. It would be nice if TK Solver could recognize a linear system (or at least give the user the option of specifying linearity) and then solve the system directly using linear algebra, without requiring the user to supply "guesses" to an iterative Newton-Raphson procedure. In almost any system, there is a tradeoff between ease of use and flexibility. In TK Solver the tradeoff leans toward flexibility, which is provided by the declarative programming language and the programs in the TK Library, which can be modified according to the user's needs. Many model builders appreciate this approach, as is evident from the favorable users' comments which can be found at the UTS web site. Jerry Allison is an associate professor of decision sciences at the University of Central Oklahoma. His e-mail address is allison@aix1.ucok.edu
Reader Service Form E-mail to the Editorial Department of OR/MS Today: orms@lionhrtpub.com OR/MS Today copyright © 1997 by the Institute for Operations Research and the Management Sciences. All rights reserved. Lionheart Publishing, Inc. 2555 Cumberland Parkway, Suite 299, Atlanta, GA 30339 USA Phone: 770-431-0867 | Fax: 770-432-696 E-mail: lpi@lionhrtpub.com Web Site © Copyright 1997 by Lionheart Publishing, Inc. All rights reserved. Web Design by Premier Web Designs, e-mail lionwebmaster@preweb.com |