|
|
OR/MS Today, August 1997 Software Review: |
|
Mathematical modeling package is versatile, offers application development capabilities 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.
The advantage of the sheet structure is that a model developer can easily keep track of several different aspects of the model as it is being developed or used. Although it might seem that nine different sheets are a lot, two things should be kept in mind: First, every model will not require each type of sheet; some models will only require two or three sheets. Second, some of these sheets are generated automatically by TK Solver. For instance, the variable sheet is generated whenever a set of equations is entered on the rule sheet, and the list sheet is automatically created when a variable is identified as a "list" variable of when generated by a TK procedure function. 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. 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:
If these conditions are not met, the Iterative Solver must be used. This solver uses an initial value of a variable (in TK language, this is called a "guess" value) and converges to a solution using a modified Newton-Raphson procedure. 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 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. 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. ![]() 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. 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 [email protected] |