
Page 22-36
Modular programming
To develop the program that will plot Mohr’s circle given a state of stress, we
will use modular programming. Basically, this approach consists in
decomposing the program into a number of sub-programs that are created as
separate variables in the calculator. These sub-programs are then linked by a
main program, that we will call
MOHRCIRCL
. We will first create a sub-
directory called MOHRC within the HOME directory, and move into that
directory to type the programs.
The next step is to create the main program and sub-programs within the sub-
directory.
The main program MOHRCIRCL uses the following sub-programs:
•
INDAT: Requests input of
σ
x,
σ
y,
τ
xy from user, produces a list
σ
L =
{
σ
x,
σ
y,
τ
xy} as output.
•
CC&r: Uses
σ
L as input, produces
σ
c = ½(
σ
x+
σ
y), r = radius of
Mohr’s circle,
φ
n = angle for principal stresses, as output.
•
DAXES: Uses
σ
c and r as input, determines axes ranges and draws
axes for the Mohr’s circle construct
•
PCIRC: Uses
σ
c, r, and
φ
n as input, draw’s Mohr’s circle by
producing a PARAMETRIC plot
•
DDIAM: Uses
σ
L as input, draws the segment AB (see Mohr’s circle
figure above), joining the input data points in the Mohr’s circle
• σ
LBL: Uses
σ
L as input, places labels to identify points A and B with
labels “
σ
x” and “
σ
y”.
• σ
AXS: Places the labels “
σ
” and “
τ
” in the x- and y-axes, respectively.
•
PTTL: Places the title “Mohr’s circle” in the figure.
Running the program
If you typed the programs in the order shown above, you will have in your
sub-directory MOHRC the following variables: PTTL,
σ
AXS, PLPNT,
σ
LBL,
PPTS, DDIAM. Pressing
L
you find also: PCIRC, DAXES, ATN2, CC&r,
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...