Professional Documents
Culture Documents
These tutorials are provided to help you get started using Mechanical
Expressions. They refer to the ideas discussed in Solving Geometry Problems
Using Mechanical Expressions, which we therefore recommend that you read
first.
Contents
Tutorial 1: Define and solve a problem. ................................................................ 2
Explore the user interface. ................................................................................ 2
Define a problem. .............................................................................................. 5
Calculate output. ............................................................................................... 7
Resolve a constraint conflict. ............................................................................. 7
Make your own expression. ............................................................................. 10
Tutorial 2: Statics ................................................................................................ 12
Tutorial 3: Dynamics ........................................................................................... 15
Tutorial 4: Loci and Transformations................................................................... 21
Draw a locus.................................................................................................... 21
Lock a variable. ............................................................................................... 24
Animate a variable........................................................................................... 24
Calculate parametric and implicit equations. ................................................... 25
Make the locus reflection. ................................................................................ 25
Compare locus and reflection equations. ........................................................ 26
Explore on your own. ....................................................................................... 26
Documentation Conventions
You see:
It means:
Space
Return
Enter
Type the value or click to make the object, then press Return.
Control-Z
page 1
page 2
You can customize the user interface in various ways. The options available in
the View menu control zooming, scaling, axes etc. and the items in Edit >
Preferences, address other visual, text and mathematical properties.
Under the Math tab, for example, you can set the threshold for Intermediate
Variable Complexity, which under some circumstances can significantly affect the
actual expression thats calculated. A low threshold tells the application to
substitute only simple intermediate variables, so you'll see more of them. A
progressively higher threshold results in the substitution of progressively larger
and more complex intermediate variables, so you'll see fewer but more complex
ones.
page 3
5. Starting near the bottom left of the drawing, click and hold the mouse button
down as you draw a line segment going upward and to the right. Mechanical
Expressions places the first point where the cursor is when you first press the
mouse button, and the second point where you release it. It then labels the
first point A and the second point B.
A
page 4
6. With the line segment tool still selected, move the mouse around the drawing
area, passing over one or both of these points. Mechanical Expressions
tracks the location of the drawing cursor, snapping it to an existing geometry
object when the cursor gets close enough.
7. Try creating other kinds of geometry objects with some of the other drawing
tools. When youre ready to go on, undo them all except the line AB.
Define a problem.
To start, well use the first line segment and add three more to create something
like this:
1. Again using the line segment tool, snap the cursor to point B and draw three
more line segments; BC, AC, and then BD. (Remember, theres no need to
draw precisely.)
To ensure that point D lies along the line AC, move the cursor near enough to
AC that the line becomes selected, and D will snap to it automatically.
2. Change to the selection tool and select line AB by clicking the mouse
anywhere along its length.
3. With one object selected, some of the tools in the Constrain Input palette are
enabled. Click the Distance/Length constraint. (Tooltips give the name of
each tool. You can use this to see what options are available.)
page 5
The constraint appears, along with the default variable name of a, selected
and ready to change. Press Return to accept it.
4. Select line BC and repeat the previous two steps to constrain its length to b.
5. Youve now added two variables to your drawing. Go to the Variables palette
to see their names and values.
The values displayed in the Variables palette
are the current values, as taken from the
default coordinate system. Notice that these
values will change as you vary the lengths of
the sides. Vice versa, if you select a variable
and change its value in the Variables palette,
the geometry will change accordingly.
6. Select the variable a in the Variables list and,
in the input field below, enter the nearest
round number.
7. Select both lines AB and BC. (You can select
more than one object at a time by making the
first selection, then holding down Shift as you
make subsequent selections.)
8. With two objects selected, youll see a
different set of constraint tools enabled. Click the Perpendicular constraint to
constrain the angle to 90. ABC is now a right triangle.
Notice that point C moved, not point A, though either could have moved to
satisfy the constraint. Mechanical Expressions moves the more recently
added object when it can.
9. Theres one last constraint to add. Select both lines BD and AC, and
constrain their angle to be perpendicular as well.
B
b
a
D
page 6
10.
Calculate output.
Suppose you want to know the length of the line BD:
1. Select BD.
2. The Calculate palette offers output as both numeric Real and expressions
Symbolic. Click on Symbolic if its not already in front, then click the
Distance /Length calculation.
An expression appears, showing the requested length in terms of the two
variables, a and b. Its selected, allowing you to move it wherever you wish.
a
ab
a +b
The double arrow => that appears to the left of the expression indicates that the
expression is an output that the application has calculated.
page 7
page 8
6. Click the angle at B. Its highlight changes to indicate its selected; the
conflicting constraint highlights vanish, and the new one now is outlined in
green.
page 9
7. Click OK. Now the figure includes the length constraint c, while the
perpendicular angle constraint at B is gone.
a+b+c (a+b-c)(a-b+c)(-a+b+c)
2c
D
c
8. Edit > Undo again. Were going to need that perpendicular angle later. Leave
the drawing as it was, without length constraint c.
7. Click in the drawing where you want to put the expression. The expression
appears as a 0, selected for overwriting. To replace the zero, enter:
z[n]/z[n+1]
(Square brackets indicate subscripts. Or use whatever names you created.)
8. The expression is calculated and displayed.
z1
z2
ab
2
a +b
D
2
z1
a
2
a +b
z2
page 11
b
2
a +b
Tutorial 2: Statics
The first tutorial could be done in Geometry Expressions; this one uses new
features from Mechanical Expressions. For a first example, we will create a
classic plank-and-string problem:
The line AC represents a massless plank fixed to a wall at A and with a weight at
C, supported by a string fixed to point B, also on the wall, and D, at the midpoint
of AC. To create this:
1. Enable the axes: the Axes/Grid icon,
Axes, will enable them.
2. Place A at the origin and B along the y-axis. Place C near the x-axis but
not on it, and D along AC.
At this point, your diagram should look roughly like this:
page 12
page 13
8. This isnt the only way Mechanical Expressions can measure this system.
Its also possible to ask for the force on a point, if that point is treated as a
pin supporting an object. Edit > Undo the three reaction forces you added
to clean up the screen, then try it out. Select the object (line segment) and
the point, then click the Pin Reaction button:
. Try this for the forces
AC exert on A; it will give the generic name z3 to these forces, but you
should change the name to AAC. Then try it for point D; calculate both DBD
and DAC. You should observe Newtons Third Law in action here.
page 14
Tutorial 3: Dynamics
Force and Torque
We havent used the torque or acceleration abilities of Mechanical
Expressions yet. Lets work through an example that does: Two
identical hanging bars, with the top bar attached to a fixed pin at
A and the bars connected by a pin at B. When a force of P lbs is
applied at C, the bottom of the lower bar, what is the angular
acceleration on each bar?
0. To set up this problem correctly, we need to use pounds
rather than kg. Open Edit > Mechanics Environment and
change Current > System from SI (m/kg/sec) to FPS
(ft/lb/sec).
1. Plant point A along the x-axis, and make line segments AB
and BC below it, unconstrained.
2. To model the bars, we will need to give each a fixed
length, mass and moment of inertia. The moment formula
for a uniform bar is I=L2w/12.
3. Constrain the length of each bar to be L. Then select
each bar and Construct the midpoint.
4. At each midpoint, add a mass labeled w, representing the
weight of the bar.
5. Select the bar itself and click the Moment icon
. To
properly reflect the distribution of the mass, each bar
should have moment L2 * w/12.
With this done, the diagram should appear like the example at
left. But there are more restrictions needed, and output to
calculate.
6. We want to have the system start at rest, which means
that both bars will hang straight down. We can do this by
constraining the angles; Mechanical Expressions
diagrams dont normally evolve over time, so we are
constraining only the initial conditions. Constrain the
angle between AB and the axis to be /2, and the angle
ABC to be .
7. Now, we add the pushing force incident at C, Applied
Force. Set this to be a purely horizontal force,
page 15
page 16
page 17
Models in Motion
So far, our models have been at rest, with forces disturbing them from it. It is also
possible, however, to have a model which is in motion, or even undergoing
constant acceleration. As an example, consider this kinetics problem:
A cart is rolling freely along a flat surface. A bar is fixed at one end
to a pivot on the bed on this cart, and its other end is fixed to a
spring. The other end of the spring is fixed to a slider on a rigid
upright bar (also fixed to the cart) so that the spring remains
horizontal. Assuming that when the cart is at rest the pivoting bar is
upright, what is the resting angle of the bar when the cart is
accelerated by a m/s2?
This apparatus would
look roughly like this,
being accelerated to
the right. This is simple
to model.
1. Put the line
segment AB
along the x-axis,
and draw AC
upward from A.
2. Place D on line
segment AB and
draw DE
upward.
3. Constrain AC to
be perpendicular
to AB.
4. Select C and E, then select Spring from the Mechanics Input
palette. You should disable the actuator and the damper. This
leaves a spring with spring constant k and natural length L.
page 18
5. Select AD and
constrain its length
to be L. This
ensures that when
the cart is at rest,
DEs rest position
is vertical. The
diagram up to this
point is shown at
right.
6. Next, constrain DE
to have length d.
7. Select DE again
and construct a
midpoint. Add a
mass m at that
point. (For easier
modification, you
may wish to
increase the size of
this mass using the
right-click menu or
Edit>Properties)
8. Select DE once
more and add a
Moment of inertia.
Enter its value as
d^2*m/12, the
formula for the
moment of a bar
about its midpoint.
It should now
appear as at right.
9. The final steps are
to set the cart and
the bar in motion.
Select DE and AB
and constrain their
angle to be .
10. Select C and
constrain its
coordinates to
(x,d*sin()). The ycoordinate here
page 19
page 20
Draw a locus.
Were now going to re-create the old exercise of drawing an ellipse using a
pencil, two pins, and a piece of string.
1. Turn on the axes by clicking on the grid tool in the toolbar.
2. Make two line segments, AB and BC. Points A and C are the pins, while B
represents the pencil.
4
B
3
1
A
-5
C
-4
-3
3. Select point A.
-2
-1
1
-1
1
A
-5 (-a,0) -4
C
-3
-2
-1
4 (a,0) 5
-3
-4
-5
8. Reselect A and drag it to the right a short distance. As you drag, notice:
A is now constrained to lie along the X axis; moving it up or down has no
effect.
When you move A, C also moves.
When you move A, the value of the associated variable a changes in the
Variables list.
9. Select the line AB and constrain its length to be distance t.
10. Select the line BC and constrain its length to be Lt. L now represents the
length of the string.
page 22
4
B
3
t
L-t
1
A
-5 (-a,0) -4
-3
-2
-1
4 (a,0) 5
11. Notice that the two new variables have-1appeared in the Variables list.
-2
-3
-4
-5
14. In the resulting dialog, choose t as the Parametric Variable, and enter start
and end values of 025, guesses that will probably produce a complete curve.
The locus appears half of an ellipse, above the X axis.
4
B
3
t
L-t
1
A
-6
-5 (-a,0) -4
C
-3
-2
-1
1
-1
page 23
-2
-3
4 (a,0) 5
15. Now drag B up and down, the equivalent of changing the length of the string,
and seeing how the ellipse changes. You can also drag A or C to change the
position of the pins.
Lock a variable.
When you draw an ellipse this way using real pins, pencil, and string, the length
of the string cant change. To emulate this real-world behavior, we can lock the
value of the variable L.
1. In the Variables list, select L and click the lock icon below the list. A plus sign
(+) appears next to the locked variable in the Locked column.
2. Select points A or C and drag them. With the length of the string constant, B
traces the same locus no matter which point you drag.
Animate a variable.
You can also animate the drawing. To do so, we can set start and stop values for
the variable t.
1. In the Variables list, select t.
2. The first input field below the video playback interface specifies the start
value. Enter 1.5.
3. The middle field specifies the duration of the animation. Accept the default
value of 4. The input field to its right specifies the stop value. Enter 12.
page 24
).
NOTE: The start and stop values that yield an interesting animation depend to
some extent on where youve located objects in your drawing. Experiment to find
values that make an interesting animation. Values that do not allow Gx to create
a construction sequence will cause objects to disappear briefly, (e.g. if your start
and stop values cause the string to break or the pins to pop out!) Theyll reappear
when values make sense again, or when the animation stops.
Y=
L(-L+2t)
4a
L-2t+2 a L-2 a L+2 a -L+2t+2 a
4a
B
3
t
L-t
1
A
-7
-6
-5 (-a,0) -4
C
-3
-2
-1
-1
-2
-3
-L4+4L2Y 2+4L2a2+X2 4L2-16a2 =0
B'
-4
page 25
4 (a,0) 5
page 26