0360-1312182104038 I-1ow3.oo/a Copyright 6 1982Pergamon Press Ltd
Compur.Educ. Vol. 6. pp. 381 to 390. 1982 Printed in Great Britain. Allrights reserved
AN INTERACTIVE GRAPHICS TEACHING COMPUTER AIDED
PROGRAM FOR DESIGN OF BEAMS
M. P. RANAWEERA* Department of Mechanical and Industrial Engineering. University of Illinois at Urbana-Champaign. Urbana. IL 61801. U.S.A.
(Received I8 November I981 : revision
received
18 January I983
computer program devetoped for teaching Rexural design of shafts to students taking machine design courses is described. The program utifizes conversationai mode interaction via a storage tube graphics terminaf and it includes interactive faciiities for problem definition, analysis, evaluation and modification. Some experience in using this program is also presented. Abstract-A
1. INTRODUCTION
Design is an optimum seeking iterative process involving, among other things, problem specification, analysis, evaluation and modification. The last three stages form a loop which is executed until a satisfactory solution is obtained. This process involves decision making as well as laborious calculations. The digital computer forms a very valuable tool in this process because of its ability to perform complex caIcuIations fast and accurately. The decision making should however be best left to the designer who will make his decision based upon his experience, overall feel for the problem and the results of repeated analyses performed by the computer. With proper communication this design team will perform better than either one alone. Interactive computer graphics is being recognized by many industries as the best communication medium in engineering design and significant progress has been made in some areas, especially the aerospace and automobile industries. Consequently, the demand for engineers familiar with graphics techniques for design is increasing and the universities are required to fulfill this demand by introducing these techniques into the curricula. This paper describes a computer program developed for use by students taking machine design courses at the department of Mechanical and Industrial Engineering, University of Illinois at UrbanaChampaign. Ail the students doing mechanical engineering are exposed to CAD through these and other similar canned programs and for some of them, this is their first introduction to interactive computer graphics. 2. THE
DESIGN
PROBLEM
The problem deals with a very common topic taught in machine design courses, viz. the flexural design of a linear elastic shaft. To make the data and interaction simpler, the particular geometry chosen is that of a solid circular shaft of stepped profile under concentrated loads of the type coming from gears and pulleys. The shaft may have any number of simple and/or fixed supports. A typical problem is shown in Fig. l(a). This design involves the selection of the shaft profile for minimum cost and the cost is taken as the sum of four parts, i.e. material cost, machining cost. setup cost and support cost. The material cost is taken to be directly proportional to the volume of the shaft so that, material cost = (unit cost of material) x (volume of the shaft). In computing the machining cost, it is assumed that the final stepped profiIe of the shaft is obtained by machining away material from a uniform rod of diameter equal to the maximum diameter of the shaft. Hence, the machining cost = (unit cost of machining) x (volume machined away). getup cost is taken to he proportional to the number of steps in the shaft, including the two ends. Thus, the setup cost = (unit cost of setup) x (number of steps). The support cost is taken to be proportional to the number of supports, with fixed supports costing twice as much as simple supports. Hence, the support cost = (unit cost of support) x (number of simple supports + twice the number of fixed supports). * Present address: Department of Civil Engineering. University of Peradeniya, Peradeniya. Sri Lanka. 381
M. P. RANAWEERA
Node :
Fig. 1. Example
problem
and finite element
model.
Any value may be prescribed for a unit cost and for costs not considered, the unit cost is taken to be zero. Thus a minimum weight (volume) design may be obtained by neglecting all but the material cost. The problem as defined above is one of constrained minimization because the usual limitations on deflections and stresses have to be satisfied. The objective function as well as the constraints are nonlinear functions of the variables. viz. the positions of the steps and their diameters.
Type
r-
in Initial
Type
I
Read oata From
Data
I t
in Node
1
Data
t Type
1
ln Element
Type
Data
rn Load Data
+ Display
Model
and Data
t OPTION?
r
Change Loads
Change Supports
Change Element Diameter
Change Node Coords.
Change Modulus & Costs
Fig. 2. Flow chart.
Add Nodes
Create Data File
Interactive graphics program for teaching CAD of beams
383
Table 1. Program description ..,SHAFT THIS
IS
AN
INTERACTIVE
FORCES. AND
COSTS
A LINEAR IN
THE
BENDING
PROGRAM MOMENTS,
ANALYSIS
FOR
THE
PROGRAM,..
DETERMINATION
BENDING
STRESSES,
FINITE
ELEMENT
OF
SHEAR
DEFLECTIONS
OF
ELASTIC
SHAFT.
THE
METHOD
IS
USED
ANALYSIS
THE
PROGRAM
THE
SUPPORTS
THE
PROGRAM
PRESS
BENDING
A
HANDLES CAN IS
KEY
ONLY
BE
STEPPED
EITHER
DIMENSIONED
TO
OF
SHAFTS
SIMPLE
SUBJECTED
OR FIXED
FOR A MAXIMUM
OF
TO POINT
LOADS.
TYPE
20
NODES
CONTINUE
3. COMPUTING
FACILITY
The program is run on Tektronix 4006-I storage tube graphic terminals connected to the University computer (Cyber 175) time sharing system. The program is written in FORTRAN IV using the GCS graphics package [ 1-J. 4.
COMPUTER
PROGRAM
The program enables the student to prescribe the shaft geometry and loading. modify it. analyse it and obtain the results in graphical as well as numerical form. The interaction is by the conversational mode. A flowchart of the program is given in Fig. 2. The shaft analysis is done by the finite element method, the details of which are found in any standard book on finite element techniques (e.g. Ref. [2]). By placing nodes at the ends, supports, ioad points and the steps [see Fig. l(b)], the shaft is modeled as an assembly of circular rod elements loaded at their ends. Generation of element stiffness matrices, the overall stiffness matrix and the load vector as well as the application of boundary conditions and the solution of the equations are done using standard procedures[2]. The program is executed by invoking a procedure file containing the compiled version of the program. Once the execution is started a brief description of the program indicating its capabilities and limitations appears on the screen (Table 1) and the data input begins.
5. DATA INPUT Data may be input by typing in through the terminal keyboard or by reading in a previously created data file. New users are urged to input data through the keyboard and this mode of data input is described here. Data input via the keyboard is done by responding to a series of statements appearing on the screen. A question mark (?) appears at the end of the statement requiring user response and the user then types in the data item. The data is input in five stages. i.e. initial data. node data, element data. support data, and load data. At the end of each stage, the data just entered is displayed on the screen so that the user can check and correct the data for that stage before proceeding to the next stage. The following is a description of this data input with reference to the finite element model shown in Fig. I(b). 5.1. Initial data These consist of the number of nodes and the elastic modulus. This data input is given in Table 2. Numerical values that appear to the right of the question marks are the data typed in b? the student. After entering the last item of this data the screen is cleared and the data just entered is displayed for checking as shown in Table 3. At this stage. the student has four options. shown at the bottom of Table 3. If the data is correct the student types 1 to go to the next stage. 5.2. Node data These consist of the x-coordinates of all the nodes. The computer prompts for this data in terms of the node numbers and the student responses are given in Table 4.
384
M. P. RANAWEERA Table ?. Input of initial data
l
**
+**
SHAFT
ANALYSIS
INITIAL
NUMBER
OF
ELASTIC
-
DATA
+**
NODES?
6
DATA
INPUT
l **
2E5
MODULUS?
II1 UNlT
COSTS(=o
MATERIAL
7
FOR
COSTS
NOT
CONSIDERED)
0,0004
MACHlNiNG?
0,0006
SETUP?
10
SUPPORT?
40
Table 3. Display of initial data for checking fNITIAL
DATA
NUMBER
OF
ELASTIC UNIT
NODES
MODULUS COSTS:
=
6
=
2, UOOOOOE+05
MATERIAL
-
MACHINING SETUP SUPPORTS IF
DATA
IS
OK
IF
DATA
IS
NOT
TO
START
TO
STOP
ALL
TYPE
4,000000E-04
=
6,000000E-04
=
~.000000E+01
=
4,OOOOOOE*Ol
1
CORRECT
OVER
TYPE
=
-2
AGAIN
TO
CONTINUE TYPE
0
TYPE
TO
REPEAT
-1
7 1.
5.3. Ekment data
These consist of the diameters of ail the elements. The input of data at this stage is as given in Table 5. 5.4 Support data At this stage. the student will be asked for the number of simple supports and their node numbers and the number of fixed supports and their node numbers. This data input is shown in Table 6. 5.6 Load data These consist of the number of loaded nodes, their node numbers and the components of the loads acting at them. Input of this data is shown in Table 7. Table 4. Input ***
NODE
DATA
of node
data
***
X-COORDINATE
OF
NODE
1
?
0
X-COORDINATE
OF
NODE
2
7
100
X-COORDINATE
OF
NODE
3
?
250
X-COORDINATE
OF
NODE
4 ‘! 400
X-COORDINATE
OF
NODE
X-COORDINATE
OF
NODE
5 7 500 6 ? 550
Interactive
graphics
program
for teachmg
CAD of beams
385
Table 5. Input of element data
l
ELENENT
**
DATA
*et
DIAMETER
OF
ELEMENT
1
^
2c
DIAMETER
OF
ELEMENT
DIAMETER
Oi
ELEMENT
DIAMETER
OF
ELEMENT
DIAMETER
OF
ELEMENT
2 3 4 5
n 7 7 7
25 25 20 20
Table 6. Input of support data a.+
SUPPORT
NUMBER NODE
OF
NO,
NUMBER NODE
DATA
sew
SIMPLE OF
OF
FIXED
NO OF
SUPPORTS
SIMPLE
7
SUPPORT
SUPPORTS
FIXED
SUPPORT
1 1
Y’
1
1
7
7
5
1
Table 7. Input of load data
*II
LOAD
NUMBER NODE
NODE
DATA OF
NO.
NO,
+*t
LOADED OF
NODES
LOADED
NODE
2
? !
?
3
LINEAR
COMPONENT
OF LOAD
7
-3000
ANGULAR
COMPONENT
OF LOAD
?
-~ooooo
OF
LOADED
NODE
2 ? 6
LINEAR
COMPONENT
OF
LOAD
?
1000
ANGULAR
COYPONENT
OF
LOAD
?
0
5.7 Data checks
Basic checks are incorporated into the program to ensure that the data typed in are realistic and corresponds to a solvable problem (e.g. elastic modulus and the element diameters are positive. the shaft is adequately supported etc.). If these conditions are not satisfied. error messages will-appear on the screen and the student is requested to re-enter the particular data item. After all the data are input. a model of the shaft will appear on the screen (Fig. 3) with supports and loading so that the student can visually check the correctness of the data before proceeding to the analysis stage. Data is also presented in numeric form alongside this model so that by taking a hard copy of the display screen at this stage. the student has a permanent record of the full definition of the design. 6. ANALYSIS
AND
EVALUATION
OF
RESULTS
After the model is displayed, the student can opt to analyse it or choose other options and modify it (see bottom line-Fig. 3). In the former case. the results of the analysis will appear on the screen in the form of the plots of the bending stress at the bottom fiber of the shaft and the deflection of the shaft center line (Fig. 4). Numerical values of the costs and support reactions as well as the maximum stress and deflection will also appear on this diagram. Hence it contains all the information necessary to evaluate the design. At this stage the student may choose to view bending moment and shear force diagrams for the shaft and to obtain the results in numeric form or to go for other options (see bottom line-Fig. 4). In the former case. the bending moment. shear force and deflection diagrams will appear on the screen (Fig. 5) and the numerical results will be sent to the line printer. These numerical output consist of the
M. P.
386
RANAWEERA
1000
**wDDEL X-COORD.
NODE NO.
: ELASTfC MDWLUS NWHINING
= =
I TO ANALISE,
2 FOR OTHER OPTIONS
2.00aO0uE*D1 2.500000ft01 2.5Do000E*01 Z.DOO~~~+Di 2.~D~~~O?
: 3 4 s
UNIT COSTS: MATERIAL SETUP = O.IOOOE+OZ
o..mDE*o6 O.,mDOE-03
DIAMETER
ELEM NO.
a. l,DDDDDOE+DP 2.5tmoDE+o2 4.~~~2 ~.~~D2 ~.5~~f~D2
1 3 4
TYPE
DATA*"
= U.QDODf-03 SUPPORTS =
0.4000f*02
1 1
Fig. 3. Shaft model and data.
deflections, rotations, shear forces, bending moments, and bending stresses along the shaft axis as well as the costs of the shaft.
After compfeting an analysis, the student is presented with a series of options as given in Table 8 and in the flow chart (Fig. 2). These options enable the student to rake a variety of courses of action.
6
-
1.4866
t4ATERIAL MST MxmWIBs CDST SETUP COST SUPPORT EDST . ..TDTAL COST... TYPE:
1 - FOR W/SF
= 90.321 = 26.507 = 4u.D 0 izo.0 = 276.83
KAXlMUU SlxESS %XIfWl OfRECtlDl
OIAGRAPIS. 3 - FOR OfAGRAMS f MJMENICAL 2 - FOR OTHER OPTIONS 1 1
Fig. 3. Stresses.
MJTPUT
deflections and costs.
- 267.11 1.4866 =
Interactive graphics program for teaching CAD of beams
387
Fig. 5. Shear moment and deflection diagrams, Table 8. Options
I
I
I
SELECT OPTION
l-
PLOT
MODEL
BY TYPING:-
AND
2-
CHANGE
LOADS
3-
CHANGE
SUPPORTS
4-
CHANGE
ELEMENT
5-
CHANGE
NODE
6-
CHANGE
ELASTIC
7-
ADD
8-
WRITE
9-
GO
O-
STOP
NEW
ANALYSIS
OPTION
DIAMETERS
COORDINATES MODULUS
AND
UNIT
COSTS
NODES
DATA TO
SELECT
A
ON NEW
TAPE PROBLEM
? 0
Option (1) allows the student to view the shaft model and analyse it again while options (2)-(7) allow the student to change all the parameters of the design including the number of nodes. Option (8) ailows the student to output a data file on the current design in a form suitable for input at a subsequent run of the program. This enables the student to stop the design iteration at any stage and continue with it at a later time without having to enter all the data through the terminal keyboard. The other two options allow the student to start a new problem or to terminate the design process. Selecting appropriate options. the student can go through the iterative design cycle involving analysis, evaluation and modification until a satisfactory solution is reached. Real time interaction with graphics greatly facilitate the student in this design process.
8. A DESlGN
EXERCISE
A typical design problem given to students, to be solved using this computer program is as follows: “A shaft is to be designed to support two concentrated loads having magnitudes and lines of action as shown in Fig. 6. It may be simply supported over any number of supports. but no support should
~&_LLl.&_I____1 Fig. 6. Design problem.
M. P. RANAWEERA
388
‘2 ‘3 ‘4
I ‘5
‘6
‘7
8
IO
II
12
13
5 6 7
11 12 13 14 I5 16 17 18 19
:: 13 14 15 16 I7 18
1.40000E+03 1.50000E+03 1.60000E+03 1.70000E+03 l.a0000E+03 UNIT COSTS: SETUP = 0.0
ELASTIC FODULUS * 0.2000E+06 MACHINING - 0.0 I TO ANALYSE.
2 FOI( OTHEH OPTIUNS
Fig. 7. A mimmum
i.8OOOOOf+O1 2.400000E+Ol 3.000000E+01 3.400000E+01 3.400000E+01 2.800000E+01 1.900000E+01 2.200000E+Ol 2.700000E+Ol 3.100000E+01 3.2OOOOOE+Ol 2.300UOOE+Ol 3.000000E+01 3.aoooooE+oI 3.80000UE+01 3.400000E+01
2 3 4 5 6 7 a 9 10
7.OOOOOE+02 8.00000E+02 9.0OOOOE+02 l.O0000E+03 1.10000E+03 1.20000E+03 1.3OOOOE+03
i 10
-
MATERIAL
z.auooooE4
2.30000OE+UI
=
0.780UE-05 SUPPORTS = 0.0
? 1
weight
design-model
and data.
t-2000
I4
I6
15
OIAMETER
I
0.0 1.00000E+02 2.00OOOE+02 3.OOOOOEt02 4.OOOOOE+02 5.OOOOOE+02 6.00000E+02
13
IS
ELEM. NO.
X-COORO.
: :
142.8
I
I
14
l'+MOOEL DATA"'
NODE NO.
TYPE
.9
t -4000
16
17
16
19
110
Stress
MTERIAL COST MACHINING COST SETUP COST SUPPORT COST . ..TOTAL COST... TYPE: 1 - FOR LWSF
- 9.3368 - 0.0 - 0.0 - 0.0 * 9.3360 OIAWIAMS.
Fig. 8. A minimum
MXINUN HAXIWM
STRESS DEFLECTION
3 - FOR OIAGRAI(S t WNERICAL 2 - FOR OTHER OPTIONS ? 1
weight
design-results
= 142.8 1.9972 =
OUTPUT
of analysis.
I I7
I I8
I
I9
389
Interactive graphics program for teaching CAD of beams
come ctoser than 400mm from any load or any other support. The shaft may be of the stepped type and the allowable bending stress for its material is 150 N/mm’. The maximum deflection in the shaft should not exceed 2 mm. Young’s modulus for shaft material = 2 x lo5 N/mm’. (i) Design a minimum weight shaft to carry this loading. 7.8 x 10e6 kgjmm3. (ii) Design a minimum cost shaft with the following unit costs:
The
shaft
material
weighs
material = 0.0004 S/mm3 machining = 0.0006 G/mm’ setup = 10 $/step support = 40 $/support”. Most of the students did not have any previous knowledge of the finite element method. Even though they could have used the computer program without knowing the theoretical aspects of the method. the students were given an introduction to the method before they were assigned the design project. This helped them to get a better understanding of the modeling needed to solve the problem using the program. The students were also given a handout describing the use of the program through a worked example. This includes a description of finite element modeling as well as the full dialogue between the user and the computer in the course of a normal run of the program. In fact, the students were encouraged to run this example problem before attempting the actual design. This helped to alleviate the “shyness” some students have towards interactive computing and build up some confidence. Approaches used by students in doing this design were varied but most of them first located the best positions of the supports for a uniform shaft and afterwards introduced steps to minimize the volume or the total cost. Almost all of the students ended up with three supports and in doing the design they obtained a feel for the way stresses change globally with local changes of cross-section in their statically indeterminate beam. For the first part of this ptobiem. which involves the minimization of shaft material. students arrived at a design having a large number of steps and a typical solution is shown in Figs 7 and 8. In the case of the second part, addition of steps has a detrimental effect and students decided on a uniform shaft as shown in Figs 9 and 10. 9. OBSERVATIONS
AND FUTURE
IMPROVEMENTS
Response of the students to the use of programs like this as teaching aids has been most encouraging and it is found that the interest of even the most apathetic student can be aroused by using interactive graphics programs. With the use of such programs, students also came to understand the roles played by the designer and computer in an interactive design process.
I
I
f
I
I
3
2
I
"'HoDEL x-CWD.
ELEII. NO.
1
0 4,0000OE*02 1.00000E+03 1.4WOOE+03 1.8000OE+03
I 2
:
ELASTIC MODULUS a 0.2000E+06 MACHINING * 0.6000E-03 TYPE
1 TO ANALYSE,
4
raTA**'
NOOE NO.
5"
I
:
DIAMETER 3.40sl0OE+01 3.4OOOOOE+O1 3.4oOOoOE+o1 3.4OmOOE+o1
UNIT COSTS: - MATERIAL = 0.4000E-03 SETUP - O.lOOOE+02 SUPPORTS - 0.4000E+O2
2 FOR OTHER OPTIONS
? I
Fig. 9. A minimum cost design-model and data.
I 5
390
M.
1746.67
P.
RANAWEERA
73820
I
NAXIWH STRESS - 653.7 NATEHIAL COST I MAXIM_&! DEFLECTION f4ACHINIffiCOST = 2::: SETUP COST - 120.0 SUPPORT COST = 793.7 . ..TOTAL COST... TYPE: I - FOR BH/SF DIAGRAMS, 3 - FOR OIAGRABS + NWERICAL OUTPUT 2 - FOR OTHER OPTIONS ? 1
Fig. 10. A minimum cost design-results
1433.3
= 148.58 1.8823 =
of analysis.
Two complaints students had on using this program were the slow response at times and the inability to observe effects of design changes dynamically. The first is due to time sharing, which at peak times involves almost 200 users and the second is an inherent drawback in storage tube displays. Both these drawbacks can be remedied by using a single user refresh graphics facility as has been done by Rogers rr al.[3], for the case of a uniform beam. In fact some software has already been developed by the author on a similar facility for computer aided design[4] and the implementation of this program on this facility should pose no problems. As pointed out previously. the problem being tackled is a multi-variable constrained optimization problem and the students can have difficulties in reaching the optimum. Past experience and physical intuition will usually guide the student to a good feasible solution in a short time and very often this could be a practically acceptable solution. Refinements beyond this could be very costly in terms of terminal time and except in some simple cases (e.g. case of a statically determinate beam where the bending moment diagram is independent of the beam cross-section) the strategy to reach the optimum is not clear at all. One solution to this problem is to enter an automatic optimization routine with the manually obtained design as the starting point. The author’s past experience[5] in this direction has been most encouraging. Other improvements proposed for the future are the incorporation of biaxial bending, and the use of other cross-section shapes and loading and support conditions. REFERENCES 1. Graphics Compatibility System (GCS). Primer on Computer Graphics Programming. U.S. Army Engineer Waterways Experimental Station. Vicksberg. MS (1978). 2. Desai C. S.. Elemenrary Finite Element Method. Prentice-Hall. Englewood Cliffs, NJ (1979). 3. Rogers D. F.. Chalmers D. and Richardson J. D.. The uniform beam. Covtput.Educ. 5. 201-217 ( 1981). 4. Ranaweera M. P. and Leckie F. A., The introduction of computer graphics in undergraduate courses m mechanical engineering design. Submitted for publication. 5. Ranaweera M. P. and Leckie F. A., Interactive use of light pen in finite element limit load analysts. Proc. Symp. Comp. Graphics. Brunei (1970).