Professional Documents
Culture Documents
Chapter1 PDF
Chapter1 PDF
Chapter1 PDF
Introduction to Mathcad
1
2 1. INTRODUCTION TO Mathcad
The blank area is the work area that allow us typing and evaluat-
ing mathematical expression, graphing, symbolic computing, entering
and running Mathcad scripting codes, and entering ordinary text.
It has standard main menu bar at the top of the window as most
window programs do that is shown in the following screen shot.
But some menus deserve a little more attention. They are View,
Insert, and Symbolic menus.
1.1. The View Menu. The View menu, among other features,
allows a user to bring up popup menu bars for using with Mathcad .
1. USER INTERFACE: MENUS AND TOOLBARS 3
Mathcad has nine popup toolbars that for entering math formulas,
mathematical symbol, graphing, programming, etc. We can choose to
bring up each one at a time or bring up the top level popup menu
toolbar by selecting Math as shown in the following screen shot,
By click each menu icon at this top level menu bar, we can bring
each individual one as needed.
4 1. INTRODUCTION TO Mathcad
Practice
(1) Start the Mathcad program and explore it top menu system by
click on each menu item.
(2) Bring up the Math popup menu toolbar, move mouse over
each icon to see the caption.
(3) Click each icon of the Math popup toolbar to bring up other
popup toolbars and explore them.
creating 2D-graph and 3D-graph that are most useful for our purpose.
First click on any blank spot in the work area, which tells Mathcad
where to place the graphic region; then click on the icon
The most frequently use menu selection in the matrix popup toolbar
is the create matrix icon,
which upon click will bring up a dialog box that allow us to create
a matrix with specified number of rows and columns. Another way to
bring up the matrix creating dialog box is press [Ctrl][M] (hold [Ctrl]
key and press [M] key)). matrix with one row or column is a
vector. The matrix popup toolbar also contains menu selections that
help us to find eigenvalues and eigenvectors, to access each individual
row or column, or find inverse. However once we remember the hot-key
or function-call for each operation, we don’t really need these toolbars.
Using hot-key or function-call is a much quick way to invoke the menu
selection.
For example, to find inverse of an given matrix A, we only need to
type A^{-1} (which will show as A−1 in the workplace) and = (which
tells Mathcad to execute the operation) to find it.
1.1.3. Evaluation Toolbar. The Evaluation Toolbar contains tool-
bar for assignment operator :=, global definition operator ≡, and the
evaluation command =.
Notice in Mathcad , equal sign = is used as evaluation command
that tells Mathcad to carry out the computation. There are two ex-
ecution mode, one is automatic, in this mode, Mathcad carries out
execution when we press [=]; another is manual, in this mode you will
have first press [=] followed by [F9] key to let Mathcad to carry out the
execution. The manual mode is desirable when we want to delay the
execution and don’t want to be bothered by many error message Math-
cad would produce in automatic mode. You turn off/on the automatic
mode from the Math menu on the Main Menu bar.
6 1. INTRODUCTION TO Mathcad
to
²
Bottom
Practice
(1) Find difference between =, := ([Shift][;], :), =([Ctrl][=]) and
≡([Shit][‘], ∼ sign) with mathematical express y = x + 3.
(2) Define some matrix in you working area and place with Matrix
toolbar.
(3) Place graph region in the work area, the typing something in
the place hold .
1. USER INTERFACE: MENUS AND TOOLBARS 11
Practice
Start Mathcad and practice all shortcut keys (hot-key) listed in the
four tables.
To select one or more regions on the screen, move the mouse to the
starting point and hold down right button and move the mouse. A
selecting box appears, any item inside the selecting box is surrounding
by a dashed box as shown in the following screen shot.
After releasing the right mouse button, all regions selected items
are bounded by dash box and the mouse cursor changes to a small
hand. Click and hold mouse on any of selected region, you can move
the selected regions to any wanted location. To deselect, simply click
on any blank region outside the selecting box.
We can also select items inside each region. When we click a math
region, we see a blue selecting line under the currently selected item.
The blue selecting line has three different shape depends on where we
click at in a math region. If we click at the beginning of the math
region (or before a math operator like +, -, ) etc.), the blue selecting
line is look like x; if we click at the middle of some text, the blue
selecting line is look like ⊥; if we click at the end of the region (or after
a math operator like +, -,) etc.), the blue selecting line is look like y.
The following screen shot displays some of the cases,
By push space bar, we can increase number of item selected, arrow
keys are used to change selection and shape of the blue selection line.
To select texts in a text region, we just click at any desired point
inside the region, and either hold the right button down while dragging
2. BASIC USAGE OF Mathcad 15
or hold the [Shift] down and using the arrow keys to choose the selection
as in most text editors.
Furthermore, we can use [Ctrl]C (copy), [Ctrl]V (paste), and [Ctrl]X
(cut) as in most text editors to copy, paste, and cut selected region(s).
2.2. Define Variables and Functions. As in all computational
program, when a computation involving a variable of functions, the
variable or function must be defined before its use unless the function is
predefined in Mathcad . Mathcad predefines many functions, such as all
trigonometric function, exponential function and logarithm function.
The following table list most frequently used predefined functions
the assignment operator :=, and followed by the numeral value. For
example the keystrokes x:23 defines a variable named x whose value
is 23, which is displayed as a := 23 in the worksheet.
To defined a range variable, usually an index variable, we use ‘;’,
semicolon. The following table list several type of range variables,
is displayed. That might be due to our variable only has one value,
so only a dot is plotted. To see if this is the case, double click the
graph box, a popup window will show, by specifying the thickness of
the trace we will see the dot if it is graphed. Another reason we don’t
see a curve is that the range for y is not properly specified. We can
change the lower and upper limit for y variable by clicking the lower
and upper left corners, place holders(or number) will appear, change
it to the desired value, the graph will appear. So to graph a function,
we do:
(1) Define the function.
(2) Define range value for the variable of your function.
(3) Press @ and enter the function name and variable name in
proper place holder.
(4) Adjust the thickness of the trace.
(5) Adjust the y ranges by changing the numbers on the far left
(see the graph below).
We have two screen shots here, the first one shows a blanket graph-
ing box with place holder and another graphing box display graph of
f (x) = 13 x(3 − x) over interval[-4, 4].
The second one shows how to graph more than one functions in
the same graph box; it also shows the configuration box and change
of the weight of the curve. To graph two or more functions in one
graphing box, you just type comma(,) after each function name as
f(x),g(x), h(t). If two or more variable name (as in the case of
screen cut) you need specify them in the place holder for variable
comma separated as x,t.
2. BASIC USAGE OF Mathcad 19
Notice, in this second screen shot t has only one value 2, so the
graph displayed as one point(green). We have changed the weight of
the trace to 5 so the point is big green dot.
Mathcad is capable to display many type of graphs. In the later
chapters we will learn how to plot 3-D graphs, such surface plot, contour
plot, vector field plot, etc.
Practice
Start Mathcad program,
(1) Type the following expression in the work area
(a) x + 3y
(b) x2 + 2x − 5
(c) e2x
(d) x^2 *y^2 -x*y /2x*y-5, notice you need to hit
space bar a few time to before you enter /, so you get expression
x2 y 2 −xy
2xy−5
(e) sin(3x)ex − t3·e−2t ¸
3 4
(2) Define matrices A = by entering A:[Ctrl][M]
−1 18
and choose 2 for row and column numbers, entering the num-
bers in proper place holder.
(a) Find inverse
· ¸of A by type A^{-1}
2
(a) Find A by entering A*[Ctrl][M] and set row=2
4
and col=1 in the dialog
· box,
¸ entering the number then press =.
−2
Define b = , and find Ab.
−5
(3) Define the following functions
20 1. INTRODUCTION TO Mathcad
(a) f (t) = 2t − et
(4) (b) f (t, x) = t2 − 4t sin(x)
2x−ex
(5) (c) f (t, x) = 2tx−cos(x) .
(6) Graph function f (t) = t2 − 2t − 1
(a) without specifying value for t.
(b) define t = 0, 0.1 · · · 5
(c) Graph g(t) = 4 sin(t) in the same chart.
(d) Graph a point (4, 5) in the same plot, now you need
put t, t, 4 in the bottom place holder and f (t), g(t), 5 in the left
middle place holder. You also need to double click the graph
and change the weight so the point is shown as in the following
screen shot.
Project
At beginning you should enter: Project title, your name, ss#, and
due date in the following format
Project One: Define and Graph Functions
John Doe
SS# 000-00-0000
You should format the text region so that the color of text is different
than math expression. You can choose color for text from Format–
>Style select normal and click modify, then change the settings for
font. You can do this for headings etc.
(1) Define and Graph functions
In the project you will do:
• Define f (x) = (x − 3)(x − 1)(x + 2)
Define a range variable x = −5, −4 · · · 5 and find func-
tion value at range variable.
• Find zero of its derivative by perform the following task,
[-] define df (x) with input df(x):[Shift][/] and en-
ter f (x) and x in the place holder so you have df (x) :=
d
dx
f (x).
[-] Type keyword Given , entering df(x)[Ctrl][=] in
next line, and keyword Find following by (x), then press
[Ctrl][.]
[-] Find zeros of its second derivative.
• Determine intervals where the function is concave upward
and concave downward. Type your explanation in text
regions.
• Graph the function, its first derivative, and second derivative
in the same plot. Explain the relationship between the
signs of its derivatives and concavities of its graph.
(2) Matrix Calculation
3 −2 4
Define the matrix A = −1 2 1
5 −8 22
• Find determinant of A by type |A, notice when you type
| you will get | | and in enter A.
• Find inverse of A.
• Find the solution of the following system of equation
[-] entering
3x − 2y + 4z = 1
−x + 2y + z = 3
5x − 8y + 22z = 11,
notice, you use [Ctrl][=] to enter the logic equal sign =.
[-] Enter keyword Find following by (x, y, z), then press
[Ctrl][.]
• Compare the solution obtained in above two steps, do see
any difference? and why? You should enter your obser-
vations in text region (created by enter double quotation
”).
• Double click the result of A-1 b and change the display to
fraction.
• Define three functions:
M 1(x, y) = − 34 x + 12 y − 14
M 2(x, y) = x − 2y − 1
5 4
M 3(x, y) = − 22 x + 11 y − 12
and graph them in a 3-D plot. You can use [Shift][Ctrl][2]
to create a 3-D plot region and in the place holder, enter
M1,M2,M3.
• Rotate the graph by click at the region and hold right
mouse while moving it so the intersection is clearly seen.