OR/MS Today, August 1997

Software Review:
TK Solver Release 3.0


Mathematical modeling package is versatile, offers application development capabilities

By Jerry Allison

TK 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:
  1. A rule sheet, which contains the equations or rules of the model, as well as the status of each rule. The status indicates whether the rule was satisfied during solution, or whether the program detected problems with the rule.
  2. A variable sheet, which lists each variable used in the model, as well as its status. On this sheet, the status indicates the type of variable (input, output, list or guess), and will contain an error symbol if the particular variable is involved in an error condition.
  3. A function sheet, which contains a summary of all user-defined functions in a model. The functions themselves are contained on function subsheets.
  4. A unit sheet, which contains conversions between units of measurement used in a model.
  5. A list sheet, which contains a summary of all lists in the model. Individual lists are displayed on list subsheets.
  6. A plot sheet, which summarizes all plots that have been created in the model. Each line on this sheet contains the name, plot type and title of an individual plot.
  7. A table sheet, which summarizes all tables in a model. A table is used to contain lists, and displays the lists as either rows or columns. Details about each table are found on a table subsheet.
  8. A format sheet lists the names of formats which can be used to control the appearance of screen or print displays. Each individual format is contained on a format subsheet.
  9. A comment sheet, which summarizes the names of comments in a model. These comments, each of which is contained on a comment subsheet, can be linked to any sheet in the model.
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.


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:
  1. All variables in the equation except the one being solved for have known values.
  2. The variable being solved for appears only once in the equation.
  3. The unknown variable cannot be the argument of a function which does not have a unique solution (e.g., the absolute value or signum functions).
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
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

Product Information

TK Solver is available for DOS, VAX/VMS, Macintosh, UNIX and Windows 3.x. A 32-bit version for Windows 95/NT is currently undergoing beta testing.

For information on technical specifications and pricing, contact Universal Technical Systems, Inc., 1220 Rock Street, Rockford, Ill., 61101; ph: (815) 963-2220; fax: (815) 963-8884. Visit the UTS web site at http://www.uts.com

Vendor Comments

It is the policy of OR/MS Today to allow software developers an opportunity to clarify and/or comment on the review article. Following are comments from Todd Piefer, a project manager with UTS, Inc.

OR/MS Today readers would be particularly interested in Queueing Analyses With TK Solver, a group of more than 50 queueing analysis models that run on TK Solver, developed by the authors of "Fundaments of Queueing Theory." Besides automating a wide range of queueing analyses, this application takes advantage of such TK Solver features as its rule-based declarative structure and its ability to solve systems forward or backward. As authors Carl M. Harris and Donald Gross say in their forward, you can "Let your inquisitive nature about queueing systems lead you in running the models" and, "Follow your 'what if' and 'how can I' instincts."

The TK Library, included at no extra charge with TK Solver, includes several models of particular use in operations research and decision support. These include:
  • Matrix manipulation and operations
  • Simulation (random-number generation and probability distribution)
  • Arbitrary-length integer (ALI) arithmetic tools for counting and probability calculations.

Wanted: Software Reviewers

Susan Palocsay, the new OR/MS Today software review editor, is in the process of updating the list of software reviewers and is looking for new reviewers. Individuals interested in reviewing should contact her directly at James Madison University, Computer Information Systems/Operations Management Program, Harrisonburg, Va., 22807; telephone: (540) 568-3061; e-mail: palocssw@jmu.edu


For more information, put the number 4 in the appropriate space on the
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