Department of 
Mechanical Engineering

Mech 403/503

 

Computer Aided Design    Tues, Thurs 1:00-2:15     Room ME241

 
 

Home
Schedule
Assignments

Completed assignments

General

Help Files

Demo Files

Fortran 90/95

F90 Overview

Finite Element Book

OOP via F90 Book

Additional resources

 

 
 
  TK!Solver Owlnet Helpfile

I HIGHLY RECOMMEND THIS AS A POWERFUL ENGINEERING COMPUTATIONAL TOOL !! JEA 2005: To see a annimated video tutorial on TK go to an Owlnet Pc: Start-->Programs-->Applications-->TK solver 5.0-->Tutorials Begin with the introduction, the units, etc.

*******************************************************************
(Unix version James Maddox, Mech403 October 31, 1992)
Windows Version Modifications Oct 2001 JEA
*******************************************************************
==> The Windows description is under construction. That version has 
tutorials that are even more helpful.

------------------------------------------------------------------
Why Use TK? The TK (Tool Kit) Solver system is unlike most engineering analysis tools because it is a "case solver", and thus it is a non-procedural environment. (Fortran, C, and Matlab are procedural). Basically this means:
1. you can write equations in ANY order you wish!
2. the unkown(s) DO NOT have to be to the left of an equals operator (=)!
3. it can solve such non-linear systems iteratively.
------------------------------------------------------------------

The following demo consists of two separate TK Solver runs. The first is just a simple exercise to introduce you to TK. The second is an applied problem dealing with torsion in a hollow shaft. After running this demo, you should be able to do the following:

- input rules and variables into TK
- solve the system of equations
- modify values and backsolve
- use the list generation and list solve features of TK
- use the table capabilities in TK
- generate plots
- get hardcopies of plots and tables

Additional practice can be obtained by running some of the engineering examples supplied with TK Solver. Besides the shaft torsion problem described here, you will find a variety of other applications (cantilevered beam, circuit analysis, helical spring analysis, etc.).

1. Go to an Owlnet PC lab or podium system in ML or Ryon.

2. Start up TK Solver. 

3. Two windows will appear inside the main TK window. One is called the Rule Sheet and the other is termed the Variable Sheet. Clicking the left mouse button when the cursor is positioned within the bounds of either will make it the active window.

4. Position the pointer immediately under the title bar of the Rule Sheet and click the left mouse button to highlight the first line. Now, type in the equation 

a + b = c * d

Note that * represents multiplication. Also note that this equation has more than one variable on the left hand side. If a mistake is made, use the DELETE or BACKSPACE key to remove the error, then type the correct character. If a major mistake is made, TK will open a window displaying an error explanation. Click on the CONTINUE button and take corrective action. 

5. Select the Variable Sheet as the active window by placing the cursor over it and pressing the left mouse button. Notice how TK automatically entered the variable names.

6. Enter data for the variables. This is done by typing a number in the Input field of a variable. Click the left mouse button while the cursor is on the field to select it. Enter the value of 4 for "a", 5 for "b", and 2 for "c" in the appropriate fields. Use function key F5 to enter edit mode on a line.

7. Choose "Solve" from the Commands menu (or press F9). Note that TK has calculated an output value for the "d" variable and placed it in the Output field.

8. Now, do a backsolve. First, blank out the input value for "a" by clicking on the Status field of "a" and typing the letter "B" (upper or lower case is acceptable). This can also be accomplished by selecting (clicking on) the Input field of "a" and hitting the space bar. Click on the Input field of "d" and type an 8.

9. Choose "Solve" from the Commands menu (or press F9). TK now backsolves and produces an output value for "a" in the Output field.

10. SIDENOTE: TK organizes information in specialized work areas called sheets. We've already seen two such sheets, the Variable Sheet and the Rule Sheet. Other sheets contain unit conversions, plot definitions, table definitions, lists of values, user-defined functions, and numeric formatting definitions. All of these sheets are available as icons in the main TK window (just click on them) or from the Sheets menu selection. Subsheets containing additional information can be opened by selecting an appropriate field and choosing "Open Subsheet" from the Windows menu. This is known as "diving." Diving can also be done by pressing the middle mouse button after selecting an appropriate field to dive on. On the IBM RTs, clicking the middle mouse button to dive will have no effect. Instead, press both mouse buttons simultaneously.

11. What if we want to calculate a number of values of "a" for a list of "d" values? The "List Solve" command allows us to do this. First, select the Status field of "a" and type "L" (upper or lower case is fine) to instruct TK to create a new list "a" and associate it with the variable "a" of our equation. Next, do the same thing in the Status field of "d" and create another list. At this point, do a dive (open a subsheet). A window will be created containing an Associated List field and the letter "d" in that field. Click on this field and perform another dive operation. A List Subsheet will be opened. Now, choose "Fill List..." from the Commands menu. Select Linear and Fill by Step. Enter 8 into the box entitled First Value. Put 20 in Last Value. Put 0.25 in the Step Size box and click the Fill button. A list is created. Choosing "List Solve" from the Commands menu will now initiate the solver and an output list will be generated for the "a" variable of our equation.

12. Plotting these results is a simple matter. Click on the Plots icon to open the Plots window. Select the Name field and type "plot1" for the name. Click on the Type field and type "L" to specify a Line Chart. Performing a dive operation while items on this line are selected will open a Plot Subsheet containing data about this particular plot. Type "d" in the X-axis List field. Enter "a" in the Y-axis column. Now, to see the plot, choose "Display Plot" from the Commands menu (or press F7). A plot window opens to display the plot. TK allows any number of plots with any number of curves in each.

13. Getting a hardcopy of a plot is also easy. Under the Options menu, select "Print Setup..." and specify the pertinent data. This includes "POSTGRAP" for the Graphics Device and an arbitrary filename for the Graphics Print Command or Filename box. Once this data has been specified, click the OK button. Selecting "Print" under the File menu will result in the generation of a PostScript file of the active graphics window. Don't forget that the active window is the one most recently clicked on using the left-most mouse button.

14. At this point, selecting the "Save" command from the File menu will store the activity of this session for future use. If you ever want to recover it, select "Open" under the File menu and specify the particular data file when prompted.

15. We are now going to work on a shaft torsion problem. Recover the model, which has already been created, by selecting the "Open" command under the File menu. Type the pathname "/usr/site/tk/eng/shaft.tk" into the blank on the dialog box that comes up. Then, click on the Open button. The simple model we've been working on will go away and it will be replaced by two new windows containing a Rule Sheet and a Variable Sheet for the torsion problem. The problem has been configured to compute the inner diameter, angle of twist, and polar moment of inertia corresponding to other specified conditions.

16. Select the "Solve" command from the Commands menu or hit F9. The solution is displayed almost instantly. Note that there was no need to isolate variables in order to determine the values. This capability allows greater versatility when working with sets of equations. There is no need to rewrite equations when there is a change of goals.

17. Now, suppose we know the maximum torque applied. Holding this constant, what effects do changes of inner diameter have on the torsional shear stress, angle of twist, and polar moment of inertia? We will utilize a table to answer this question. First, enter an "L" in the Status field of the variables under inspection (ID,J,Txy,
theta). By doing this, you are signalling to TK that these variables will be associated with lists of values. The Input field of "Txy" will need to be blanked and a dummy value for "ID" will be needed in its Input field.

18. To get TK's Table Sheet, just click on the Tables icon or choose "Tables" from the Sheets menu. There is no limit to the number of tables which may be included in a single TK model. Now, select the Name field and type "table1" for the name. An optional title can also be included. Dive into the table subsheet. The table can be
set up vertically or horizontally. We can even focus on a certain subset of our data by indicating the first and last elements we wish to include in the table. Also note the numeric formatting and width settings available to tailor the table. On four separate lines in the List column, put the variables under inspection (TK is case
sensitive, so type "ID", "J", "Txy", and "theta").

19. We can observe the contents of the table by diving down another level into TK's Interactive Table. At this point, the variation of the inner diameter needs to be specified. Put the cursor in the first cell of the ID column, then choose "Fill List..." from the Commands menu. Select Linear and Fill by Step. Enter 1 into the box
entitled First Value. Put 3.5 in Last Value. Put 0.1 in the Step Size box and click the Fill button. The ID column is filled in.

20. Given these values, we can now solve for corresponding values of Txy, polar moment of inertia, and angle of twist by choosing "List Solve" from the Commands menu. TK fills the table quickly.

21. Getting a hard copy of this table is a simple matter. Under the Options menu, select "Print Setup..." and specify the needed data. This includes selecting Disk File and typing a pathname in the Text Print Command or Filename box. Once this data has been specified, selecting "Print Table" under the File menu will result in the creation of a file containing the table data.

22. At this point, selecting the "Save" command from the File menu will store the activity from this session for future use. Selecting "Exit" from the File menu will terminate the session.