Copyright: Copyright (c) 1991-1997, MathSoft Inc.


ANIMATION EXAMPLES

To see some animation examples:

Open QuickSheets from the Resource Center.

Click on "Animations" in the QuickSheets table of contents page.


Specifying what to animate
CREATING THE ANIMATION

You can animate any plot or numerical result whose appearance depends on the built-in variable FRAME. To do so:

Create a region whose appearance depends on FRAME.

Make sure your worksheet is in automatic mode.

Choose Animate from the View menu to open the Animate dialog box.

Enclose the region(s) you want to animate in a selection rectangle.

In the dialog box, specify starting and ending values of FRAME.

Click "Animate."

You’ll see a miniature rendition of your selection inside the dialog box. Mathcad redraws this once for each value of FRAME. This won’t necessarily match the playback speed since at this point, you’re just creating the animation, you’re not playing it back yet.


"Animate" dialog box
Click on the various parts of the dialog box to see what they're for:


Frame view

This box will display successive frames from your animation sequence as they are recorded. The frames may take a few moments to display the first time. However once they've been recorded, you'll be able to play them back much more quickly.

This box is empty until you select a region to animate and click the "Animate" button.


Animate

Click this button to begin recording the animation. This button is grayed out until you select a region in your worksheet to animate.


Save As

Click this button to save a recorded animation in a format suitable for use by most other multimedia applications.

This button is grayed out unless there is something to save.


Options...

Since animation clips tend to take considerable disk space, Mathcad saves them in compressed format. Click this to open a dialog box presenting numerous options relating to what compression method, if any, you want to use to save your animation.


FRAME counter

This shows the value of the built-in FRAME variable corresponding to the picture in the box above it.


Animation speed

This controls the default rate at which the animation will be played back.

Since you'll be able to adjust the playback speed at the time you play back the animation, this value is important only when you want to add a soundtrack to your animation.


Upper and lower values of FRAME

This controls the range over which the built-in FRAME variable will vary. Each value of FRAME generates a separate frame in the animation sequence.


Cancel

This closes the dialog box. If you've created an animation and haven't saved it, you'll have to recreate it the next time you want to look at it.

To save an animation before closing, click the "Save As" button.


FRAME variable

This is the built-in variable that drives animations. Do not define this variable in your worksheet. You should only define it in the Animate dialog box.


Playing back the animation
PLAYING THE ANIMATION

Once you've created the animation, you'll see the first frame of your animation in the animation player. You can now:

Play back the whole animation by clicking on the playback button, or

See one frame at a time by using the slider.


Use the mouse to drag the slider control left or right to go backwards and forwards in an animation


SAVING THE ANIMATION

Once you've created an animation, you can save it. This will allow you to play it later without having to re-record it. To save the animation as a Windows AVI file:

Make sure the Animate dialog box is open

Make sure that the first frame of the animation you want to save is shown in the dialog box.

If necessary, change the compression method used to save files by clicking the "Options" button.

Click the "Save as" button.


Animating a plot

When animating a plot, it's best to set the axis limits yourself instead of letting them be set automatically.

If you don't do this, the axis limits get reset at every frame in the animation. The result: a movie in which the axis limits and not the plot change from one frame to the next.


PLAYING BACK A PREVIOUSLY SAVED ANIMATION

To playback a previously saved animation (or any Windows AVI file):

Choose Playback from the View menu. This opens the Playback dialog box.

Click the [image] button.

Choose Open from the menu.

Double-click on the name of the animation you want to open.

Play back the whole animation by clicking on the playback button, or

See one frame at a time by using the slider.


"Playback" dialog box
Click on the various parts of the image below to see what they're for:


Frame view

This box shows the first frame of whatever animation clip is ready to be played back. If nothing is available for playback, this box disappears.

To make an animation available for playback, either open the file containing it or create an animation using the Animate dialog box.


Slider for frame-by-frame playback

Use this slider as you would use a scroll-bar. You can use this to go forward or backward one or more frames at a time.


This brings down a menu allowing you to control playback speed, the size of the image, and various configuration options.

You can also use this menu to open an existing file.


Playback button

Click this to begin playing the animation. If the animation is already playing, clicking this will stop it.


Animation (generally)
ANIMATION

Animation can be a very useful tool for studying numeric output both directly and visually. You can create animations in Mathcad using a variable called FRAME in your equations. Mathcad creates a video by shooting a sequence of snapshots or frames. One frame is generated, in order, for each value of FRAME in the specified range.

Creating an animation

Playing back an animation

Saving an animation

Animation examples


3D BAR CHARTS

Three-dimensional bar charts allow you to visualize a matrix of data as bars of varying heights. You can control the layout of the bars and whether they are in color or grayscale. You can also change a 3D bar chart into another type of 3D plot.

Creating a 3D bar chart

Deleting a 3D bar chart

Moving a 3D bar chart

Changing the size of a 3D bar chart

View settings

Axis settings

Color and line settings

Adding a title to a 3D bar chart

Animating a 3D bar chart


In the default perspective, the first row of the matrix extends from the back left corner of the grid to the right, while the first column extends from the back left corner out toward the viewer.


CREATING A 3D BAR CHART

To create a 3D bar chart:

Define the matrix of elements to plot. The matrix must have at least two rows and two columns.

Choose Graph / 3D Bar Chart from the Insert menu to create a 3D bar chart region.

Place the name of the matrix in the placeholder.

Mathcad draws a perspective view of the matrix as a two-dimensional grid lying flat in three-dimensional space. Each matrix element is represented as a column at a specified height above or below this grid.

If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

See Mathcad Quicksheets for an example of a bar chart.


VIEW SETTINGS (3D BAR CHARTS)

To modify the general presentation of your bar chart:

Double-click on a plot to open a tabbed dialog box.

Click on the View tab.

The View page has the following options. Click on an option to learn more about it.

Rotation

Tilt

Vertical scale

Axes style

Show border

Show box

Show back planes

The View page also has options that allow you to change any 3D bar chart into another type of 3D plot:

Surface plot

Contour plot

Data points

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D bar chart displayed with different view options.


AXIS SETTINGS (3D BAR CHARTS)

To select the characteristics of each axis:

Double-click on the bar chart to open a tabbed dialog box.

Click on the Axes tab.

The Axes page shows each axis having the following check boxes associated with it. Click on an option to learn more about it:

Grid lines

Numbered

Autoscale

Auto grid

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D bar chart displayed with different axis settings.


COLOR AND LINE SETTINGS (3D BAR CHARTS)

To define the color and shading associated with the individual bars and the way in which the bars are layed out relative to each other:

Double-click on a plot to open a tabbed dialog box.

Click on the Color & Lines tab.

The Color & Lines page has the following boxes for controlling the location of the bars relative to each other. Click on an option to learn more about it:

Matrix

Stacked

Side by side

Spacing

The page also has the following check boxes for specifying the meaning of colors on the bar chart. Click on an option to learn more about it:

None

Increasing X

Increasing Y

Increasing Z

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D bar chart displayed with different color and line settings.


ADDING A TITLE TO A 3D BAR CHART

To add a title to a 3D bar chart:

Double-click on a plot to open a tabbed dialog box.

Click on the Title tab.

In the text box on the Title page, type the title for your graph. You can use upper and lower case letters in the title.

Click on either the "Above" or "Below" button. Then click "OK" to display the title of the graph region or "Cancel" to restore the title text box to its original state.

Click on "Show Title" to toggle it off if you don't want the title to appear on your graph. Or backspace over the title to remove it from the text box and to delete it from the graph.


Rotation must be between 0 and 360 degrees.

Rotation = 0

You look directly down the first column of the matrix. The first row points right.

Rotation = 90

You look directly down the first row of matrix. The first column points left.


Tilt must be between 0 and 360 degrees.

Tilt = 0

You look from the edge on the plane of the matrix. The effect is like standing at sea level and looking at mountains.

Tilt = 90

You look from directly above. The effect is like flying directly over those same mountains.


Vertical Scale

This is an integer between 1 and 100. When the vertical scale is small, the variations among the bars will barely be perceptible. At 100, the variations are such that the chart fills almost the entire frame.


Contour Plot

When this button is clicked, the 3D bar chart is converted into a contour plot showing the matrix's level curves.


Surface Plot

When this button is clicked, the 3D bar chart is converted into a corresponding surface plot.


Data Points

When this button is clicked, the 3D bar chart is converted into a plot showing just the points making up the surface.


Matrix bar layout

When this button is clicked, the bars are arranged in exactly the same way that the corresponding numbers in the underlying matrix are arranged.


Stacked bar layout

When this button is clicked, all the bars coming from the same column of the matrix are stacked one on top of another.


Side by Side bar layout

When this button is clicked, all the bars coming from the same column of the matrix are clustered together side-by-side.


Spacing bar layout

This controls the spacing between adjacent bars. The percentage that you enter indicates the percentage of the grid that the spacing takes up. As you increase the percentage, the bars become progressively skinnier.


Show Border

When checked, the 3D bar chart is enclosed in a rectangle.


Show Box

When checked, the 3D bar chart is enclosed in a three-dimensional bounding box.


Show Back Planes

When checked, the 3D bar chart has xy, xz, and yz back planes. Use the "Fill Color" and "Edge Color" buttons to add color to the back planes so that the 3D bar chart stands out.


Axes Style

This controls whether the axes appear at the front perimeter of the plot (perimeter), whether they intersect in the back left of the plot (corner), or whether they appear at all (none).


Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by grid lines.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 1 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Autoscale

By default, the z axis of all 3D bar charts is autoscaled. With Autoscale on, the z axis limit is set to the first major tick mark beyond the end of the data.

With Autoscale off, the axis limit is set right at the data limits. You can redefine this limit by entering values in the Max. Val. and Min. Val. text boxes.

To turn off Autoscale and have your plot drawn to the ends of the plot region:

Click on the "Autoscale" check box for the z axis to toggle it off.

If you want to set axis limits other than at the data limits, enter values in the Max. Val. and Min. Val. text boxes.

Since a 3D bar chart is made by plotting the elements of a matrix, Mathcad cannot “know” anything about x and y coordinates. By default, the coordinates on these axes will simply be rows and columns.

If you are setting up an animation sequence, you may want to turn Autoscale off.


None

When this button is selected, the bar chart doesn't show any colors.


Increasing X

When this button is selected, the largest values along the x-axis will be in red and the smallest will be in blue. Intermediate values range from yellow through green.


Increasing Y

When this button is selected, the largest values along the y-axis will be in red and the smallest will be in blue. Intermediate values range from yellow through green.


Increasing Z

When this button is selected, the largest values along the z-axis will be in red and the smallest will be in blue. Intermediate values range from yellow through green.


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed.


Interpolated Mesh

This group is only active if you have created your surface plot by converting from a scatter plot. In such a case, you'll actually see an interpolated surface that approximates your scatter data.

To change the density of the mesh used for interpolation, edit the number of rows and columns in the Interpolated Mesh text boxes. If your data is not well approximated by a surface, it may be impossible to generate a useful interpolation. If this occurs, you'll see an appropriate message on the message line.


DEFINING A VARIABLE

Before you can evaluate an expression involving a variable rather than a constant, you must define the variable. To do so:

Type the variable name.

Type ":" to create a ":=" with a placeholder.

Type a number, an expression, or a string in the placeholder.

If you type an expression in the placeholder, make sure any variables or functions you use in that expression are defined beforehand. If you don't, you'll see any undefined variables marked in red.


In the right-hand worksheet below, an attempt is made to use y before it is defined. Note how y is red. This shows that it is undefined.

y must be defined above and/or to the left of its first use as shown in the left-hand worksheet.


DEFINING A FUNCTION

A function is a rule which performs certain operations to its arguments and returns a numerical result. To define a function:

Type the function name followed by a left parenthesis.

Type a list of arguments separated by commas followed by a right parenthesis.

Type ":" to create a ":=" with a placeholder.

Type an expression or a string in the placeholder.

Make sure any variables you use in right-hand expression are either

defined beforehand, or

part of the argument list.

If a variable in the right-hand expression doesn't satisfy one of these conditions, you'll see it marked in red as undefined..

When you’ve defined a function, Mathcad does not try to evaluate it until you use it later on in the worksheet.


DEFINING A VARIABLE OR FUNCTION GLOBALLY

When you define a variable or function, it applies to everything below and to the right of it. However, when you define a variable or function globally, it applies to all local definitions, regardless of their location in the worksheet. Thus, global definitions allow you to supersede the usual order in which Mathcad evaluates your worksheet.

To define a variable or function globally, follow these steps:

Type a variable name or function to be defined.

Enter the priority equals sign by pressing the tilde key (~).

Type an expression involving number or other globally defined variables or functions.


EVALUATING A FUNCTION

To evaluate a user-defined  function:

Click below the definition of the function to position the crosshair and type the function name folllowed by a left parenthesis.

Type a list of arguments separated by commas followed by a right parenthesis.

 Press the “=”

Results are displayed in a non-scrolling table.


Arguments to functions

Arguments can be constants, variables, or arrays. To see an example of an array as an argument, examine the Quicksheet titled “Array-valued Functions.”


EVALUATING AN EXPRESSION

Although Mathcad can perform sophisticated mathematics, you can just as easily use it as a simple calculator. To make a simple numerical calculation:

Click anywhere in your Mathcad worksheet and type the expression you want to evaluate.

Press "=".

Make sure any variables you use in the expression to the left of the equals sign are defined beforehand. If you don't, you'll see any undefined variables marked in red.


WHAT YOU CAN DO WITH MATHCAD

Mathcad combines the live document interface of a spreadsheet with the WYSIWYG interface of a word processor while allowing you to solve just about any math problem you can think of.

You can place equations, text, and graphics anywhere in the Mathcad worksheet. This makes it easy keep track of the most complex calculations and represent your results in two or three dimensional plots.

After creating a presentation-quality document, you can share your work with others by printing the worksheet exactly as it appears on the screen, emailing it, or posting it on the World Wide Web.


As soon as you make a change anywhere in your worksheet, Mathcad updates results and redraws graphs.


Mathcad lets you type equations as you're used to seeing them on blackboards or in reference books. You can also print exactly what you see on the screen.


Mathcad’s computational abilities range from adding up a column of numbers to evaluating integrals and derivatives, solving systems of equations and more.


THE MATHCAD DESKTOP

When you start Mathcad, you will see:

   An untitled Mathcad worksheet

   The Resource Center window

   The menu bar

   The Math Palette

   The Toolbar

   The Format Bar

To conserve screen space, you can show or hide the palette button bar, toolbar, or font bar using the View menu options. If you prefer to have these elements elsewhere on the screen, you can move them around your window. When you exit and re-open Mathcad, the elements will be positioned as they were when you exited.


To move the Math Palette bar, the Toolbar, or the Format Bar:

   Place the mouse pointer anywhere other than on a button or a text box.

   Press and hold down the mouse button and drag.

You’ll find that the toolbar and palette button bar rearrange themselves appropriately depending on where you drag them. The font bar, on the other hand, will retain its shape no matter where you drag it.


This is where you can start typing to create a new Mathcad worksheet. To open previously saved worksheets, choose Open from the File menu.


Controlling calculation (generally)
CONTROLLING CALCULATION

Your calculation mode controls how often the results on your screen are updated. Your worksheet will always be in one of two calculation modes:

Automatic mode in which results are updated continuously, and...

Manual mode in which you control when results are updated.

While in either mode, you can turn specific equations on or off or interrupt a calculation in progress.


Automatic calculation mode
AUTOMATIC MODE

When you start Mathcad, you are in automatic mode. This means that Mathcad updates results in the worksheet window automatically.

Advantages of automatic mode...

Disadvantages of automatic mode...

Limitations of automatic mode...

How to tell when you're in automatic mode...

How to get into automatic mode...


In auto mode, the numerical results and graphs you see in your window will always be up-to-date.


If your worksheet contains lots of computationally intensive equations, you may find scrolling through the worksheet time-consuming.


The following results are not updated automatically:

Results of symbolic transformations.

File access functions such as READPRN, WRITEPRN and the like.

To update these results choose Calculate Worksheet from the Math menu.


When you're in automatic mode...

The word "auto" appears on the message line.

A check appears to the left of Automatic Calculation on the Math menu.


Choose Automatic Calculation from the Math menu.


MANUAL CALCULATION MODE

When you start Mathcad, you are in automatic mode, meaning that Mathcad updates results in the worksheet window automatically as you make changes. However, if you don’t want to wait for Mathcad to make computations as you edit, you should change to manual mode.

Advantages of manual mode...

Disadvantages of manual mode...

How to update results in manual mode...

How to tell when you're in manual mode...

How to get into manual mode...


In manual mode, you'll be able to scroll through worksheets faster because time-consuming calculations need not be performed as you scroll.


Results in your worksheet may not be up-to-date. If they're not, you'll see the word "calc" on the message line.


To update only what you see in the window:

Choose Calculate from the Math menu.

Mathcad performs whatever computations are necessary to update all results visible in the worksheet window. When you move down to see more of the worksheet, you must recalculate to see up-to-date results.

To update all results throughout the worksheet:

Choose Calculate Worksheet from the Math menu.


When you're in manual mode...

The word "auto" will not be on the message line.

The word "calc" may be on the message line.

No check appears to the left of Automatic Calculation command on the Math menu.


Choosing Regions from the View menu boxes all regions and displays their anchor points.


Disabling equations
TURNING EQUATIONS ON OR OFF

To prevent a region such as an equation or a graph from being calculated:

Click in the equation.

Choose Properties from the Format menu and click on the Calculation tab.

Click in the box next to “Disable Evaluation.”

Click “OK.”

You'll see a small box next to the equation to show that it's turned off. To turn the equation back on, follow the same steps.

You can edit a disabled equation just as you would any other equation. However, a disabled equation does not affect any other calculations, nor does it reflect changes you make to other equations in the worksheet.


Although you can edit disabled equations as usual, if you move a disabled equation that happens to be displaying a result, the result will disappear. If you move a disabled graph, whatever is inside the graph will disappear.


Interrupting calculation
INTERRUPTING A CALCULATION

To interrupt a calculation:

Press Esc.

You'll see an error message pointing at whichever equation was interrupted.

To resume calculation:

Choose Calculate from the Math menu.


To insert a global equals sign (triple equals)

press ~ (the tilde key)


To insert :=

press : the colon key


To insert =

press =


To insert »

press Ctrl+=


AVOIDING UNDEFINED EXPRESSIONS

Before you use any variable or function, make sure you've defined it earlier in your worksheet.

If you can't tell whether one equation comes before another, choose Regions from the View menu and examine their respective anchor points.


MAKING A PASS THROUGH YOUR WORKSHEET

With one exception, all math expressions in a worksheet are evaluated the same way you read: from top to bottom and from left to right. Click on the various expressions in the picture below or more explanation.


The ":=" assigns the value "1" to the variable "x". To insert the ":=" type the colon (:) key.

The black dot on the left is the "anchor point". This point defines exactly where this definition is. To see anchor points, choose Regions from the View menu.


This defines a function f(z). Note that z doesn't have to be defined because it's used only as a dummy argument. After all, you don't really have to know what z is to define a function with it.


The "=" takes the current value of x and displays it to the right.


This evaluates the function f at the current value of x.


This redefines x. Above this point, x is still set to 1. Below this point, x is set to 33.


This evaluates the function f at the current value of x. Since x is now 33, f(x) = 3x = 99.


This plot is incorrectly placed because the anchor point (the black dot on the left) is above the anchor point at which u is defined. As a result, u is not yet defined when this plot is evaluated. Note that undefined variables are displayed in red.


This defines u as a range variable by assigning to it the sequence 1, 2, 3...10. Range variables are indispensable for creating plots.

To insert the ".." type the semicolon (;) key.


This plot is correctly placed. Both the range variable u and the function f are defined before the anchor point on the upper left corner of this plot.


SUPERSEDING THE ORDER OF EVALUATION

If you want to define something above and/or to the left of where you use it, you'll have to use the priority equals sign. Click on the various expressions in the picture below or more explanation.

Note that within the assignments using the priority equals there is an order of evaluation: top to bottom and left to right. In effect, there are two passes through your worksheet:

The first pass does all assignments involving the priority equals sign.

The second pass is for doing all assignments involving ':=' and for displaying results and plots.


The first pass through the worksheet is for evaluating anything that has a priority equals sign. Although this equation is halfway down the page, it is in fact the first equation having a priority equals sign. This gives it priority over any equation involving a ':=' or a '='.


We are still on the first pass through the worksheet. This first pass is for evaluating anything that has a priority equals sign.

This is the second equation having a priority equals sign. Note that although the priority equals sign gives this priority over any equation having either a ':=' or a '=', it does not give it priority over other equations having a priority equals sign which happen to lie either above or to the left.


We have finished the first pass through the worksheet, the one for evaluating any equations using a priority equals sign. This is the beginning of the second pass, the one for evaluating equations having either a ':=' or a '='. This is the first such equation because it lies above all the others.


We are now in the second pass through the worksheet, the one for evaluating equations having a ':=' or a '='. This is the second such equation.

Note that even though there is a definition for y below this equation, that definition uses a priority equals sign. Therefore it was already "spent" during the first pass through the worksheet. As a result, it has no further effect.


We are now at the end of the second pass through the worksheet, the one for evaluating equations having a ':=' or a '='.

This is the last equation to be evaluated. The value of y is set by the most recent definition using ':='. The (apparently) intervening definition using a priority equals sign  was "spent" during the first pass through the worksheet. It therefore has no further effect.


DOING CALCULATIONS IN PARALLEL

Any calculation Mathcad can perform with single values, it can also perform with arrays of values. There are two ways of doing this:

By iteration over each element using range variables as subscripts.

By using the vectorize operator which allows Mathcad to perform the same operation efficiently on each element of a vector or matrix.


CALCULUS OPERATORS

You can type any operator using its keystroke. Most operators are also available on the calculus palette off the Math Palette.

derivative	?

nth derivative	Ctrl+?

definite integral	&

indefinite integral	Ctrl+I

summation	Ctrl+Shift+4

summation with range variables	Ctrl+4

iterated product	Ctrl+Shift+3

iterated product with range variables	Ctrl+3

two-sided limit	Ctrl+L

left-hand limit	Ctrl+A

right-hand limit	Ctrl+B


Integration operator
Definite integral	Press &

Returns the definite integral of f(x) from a to b.

Operands:

f is any scalar valued function defined in the closed interval [a,b].

x is the dummy variable of integration.

a and b must be real scalars, but f may be complex valued.

a and b must be have the same dimensions if any.

For example:

Although the example shows a function of one variable, f can be a function of any number of variables.

Like all numerical methods, Mathcad’s integration algorithm can have difficulty with ill-behaved integrands. If the expression to be integrated has singularities, discontinuities, or large and rapid fluctuations, Mathcad’s solution may be inaccurate.

To evaluate double or multiple integrals, press  & more than once.

Related Topics:

Symbolic integration


Differentiation operator
Derivative	Press ?

Returns the derivative of f(t) evaluated at the point t.

Operands:

f(t) is a scalar valued function.

t is the point at which the derivative is to be evaluated.

You must first define the point at which the derivative is to be evaluated. For example:

Note in the above example that the value returned is the derivative of f with respect to t evaluated at whatever point(s) t is defined at.

Although the example shows a function of one variable, f can be a function of any number of variables.

If f has several terms, be sure to enclose them in parentheses to keep them inside the derivative operator.

With Mathcad’s derivative algorithm, you can expect the first derivative to be accurate to within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.

Related Topics:

Symbolic differentiation


Nth Derivative operator
nth Derivative	Press Ctrl+Shift+?

Returns the nth derivative of f(t) evaluated at the point t.

Operands:

f(t) is a scalar valued function.

t is the point at which the derivative is to be evaluated.

n= 0, 1, 2, 3, 4 or 5.

You must first define the point at which the derivative is to be evaluated. For example:

Note in the above example that the value returned is the nth derivative of f with respect to t evaluated at whatever point(s) t is defined at.

Although the example shows a function of one variable, f can be a function of any number of variables.

If f has several terms, be sure to enclose them in parentheses to keep them inside the derivative operator.

With Mathcad’s derivative algorithm, you can expect the first derivative to be accurate to within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.

Related Topics:

Symbolic differentiation


The accuracy tends to decrease by one significant digit for each increase in the order of the derivative.


Built in constants
PREDEFINED CONSTANTS

Predefined Math Constants

Name	Keystroke

∞	Ctrl+z

π	Ctrl+p

e	e

i	1i

j	1j

%	%

To redefine...

Predefined System Constants

Name	Default Value

TOL	0.001

ORIGIN	0

PRNPRECISION	4

PRNCOLWIDTH	8

CWD	a directory string

To redefine...


pi
π	Press Ctrl+p

The value of π to 15 decimal digits when used in numerical calculations.

The exact value of π when used in symbolic calculations.


Imaginary units
i or j	Press 1i or 1j

The imaginary unit. Note that you must type 1i and 1j, not i and j. In either case, the extra '1' disappears when you leave the expression.

You can type multiples of i and j similarly, for example, 2i or -2.5j.


e (natural log base)
e	Press e

The value of e to 15 decimal digits when used in numerical calculations.

The exact value of e when used in symbolics calculations.


Infinity
∞	Press Ctrl+z

When used in a numerical expression, this is set to

When used in symbolics calculations, this represents the usual mathematical definition of infinity.


Percent
%	Press %

This is set to 0.01. Use it as a convenient way to work with percent. For example:


Array origin
ORIGIN	Default = 0

This represents the starting index of all arrays. To change it, choose Options / Built-In Variables tab from the Math menu.

You can set ORIGIN to any integer, positive or negative. The value you set for ORIGIN will affect every array in your worksheet.


Data file column width
PRNCOLWIDTH	Default = 8

This represents the width of columns in ASCII files created by the WRITEPRN function.

To change it, choose Options / Built-in Variables tab from the Math menu.

PRNCOLWIDTH can be set to any integer between 1 and 132.


Precision in data files
PRNPRECISION	Default = 4

This represents the number of significant digits to be used when writing to a file with the WRITEPRN function.

To change it, choose Options / Built-in Variables tab from the Math menu.

PRNPRECISION can be any integer between 1 and 16.


Current working directory
CWD	Default = a directory string

This string variable displays the current working directory Mathcad is using. The working directory is the directory into which files are saved and the directory in which Mathcad looks for data files.

By default, the value of CWD is the directory into which you installed Mathcad (usually c:\Program Files\Mathsoft\Mathcad). To change the default value of CWD:

Create a Mathcad icon on the desktop of your operating system if you do not have one already.

Set the working directory or the “start in” directory to whatever you would like Mathcad to default to using.


Controlling the accuracy of calculation
TOL	Default = 0.001

This controls the precision to which integrals and derivatives are evaluated. It also controls how long iteration in solve blocks and in the root function will go on for.

Setting TOL low

When you make TOL very low, all results are computed with much greater precision. Depending on the numerical properties of the expression this may increase computation time.

You may also see a not converging or a did not find solution message when the numerical properties of the expression are such that a solution asymptotically approaches a number that exceeds the acceptance threshold set by TOL.

Setting TOL high

High values of TOL will decrease computation time at the expense of precision.

To redefine TOL...


Redefining built-in constants
REDEFINING BUILT-IN MATH CONSTANTS

You can change the value of the constants

∞

π

e

i

j

%

by using ":=" in your worksheet just as you would for any variable.

Related Topics:

Redefining built-in system constants


REDEFINING BUILT-IN SYSTEM CONSTANTS

You can change the value of the constants

ORIGIN

PRNPRECISION

TOL

PRNCOLWIDTH

in two ways:

By redefining them with ':=' in your worksheet

By choosing Options / Built-In Variables tab from the Math menu.

Related Topics:

Redefining built-in math constants


Math Options dialog options
Click on the various parts of the dialog box below to see what they're for:


Controls the precision to which integrals and derivatives are evaluated. It also controls the length of the iteration in solve blocks and in the root function.


Represents the starting index of all arrays in your worksheet.


Represents the number of significant digits to be used when writing to an ASCII data file with the WRITEPRN function.


Represents the width of columns in ASCII files created by the WRITEPRN function.


Change this value to select a different sequence of uniformly distributed random numbers.


Reverts all values to their default values (shown in the parentheses to the right of each value).


CONTOUR PLOTS

Contour plots require a matrix of values, Mathcad linearly interpolates the values of the matrix to form level curves. Such level curves can represent isotherms, isobars, equipotentials, streamlines, and many other physical phenomena. You can change the number of contours, whether the contours are in color or grayscale, and what labels and grid lines appear on the axes. You can also change a contour plot into another type of 3D plot.

Creating a contour plot

Deleting a contour plot

Moving a contour plot

Changing the size of a contour plot

View settings

Axis settings

Color and line settings

Adding a title to a contour plot

Animating a contour plot


CREATING A CONTOUR PLOT

To create a contour plot:

Define the matrix of values to plot The matrix must have at least two rows and two columns. For best results, the rows and columns should represent equally spaced intervals on the axes.

Choose Graph / Contour Plot from the Insert menu to create a contour plot region.

Place the name of the matrix in the placeholder.

See Mathcad Quicksheets for an example.

Mathcad linearly interpolates the values of the matrix to form level curves in such a way that no two  cross. Mathcad plots the matrix by rotating it so that the (0,0) element is at the lower-left corner. Thus the rows of the matrix correspond to the values on the x-axis, increasing to the right, and the columns correspond to the values along the y-axis, increasing toward the top.

If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

Alternatively you can create a contour plot from a set of x, y and z data points. First create three vectors:  one containing the x values, one containing the y values, and one the z values. Create a contour plot region and type the names of the x, y and z vectors separated by commas into the placeholder. The contour plot Mathcad generates is the same as a 3D scatter plot changed into a contour plot.


VIEW SETTINGS (CONTOUR PLOTS)

To modify the general presentation of your plot:

Double-click on a plot to open a tabbed dialog box.

Click on the View tab.

The View page has options that allow you to change a contour plot into other types of 3D plots:

Surface plot

3D bar chart

Data points

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a contour plot displayed with different view options.


AXIS SETTINGS (CONTOUR PLOTS)

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the Axes tab.

Each axis has the following check boxes associated with it. Click on an option to learn more about it:

Grid lines

Numbered

Auto grid

Min. Val./Max. Val.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a contour plot displayed with different axis settings.


COLOR AND LINE SETTINGS (CONTOUR PLOTS)

To define the shading of the contours:

Double-click on a plot to open a tabbed dialog box.

Click on the Color & Lines tab.

The Color & Lines tab has the following check boxes for managing the shading of the contours that constitute the plot. Click on an option to learn more about it:

Color

None

Grayscale

The tab also has the following check boxes for specifying the number of contours on the plot. Click on an option to learn more about it:

Contour Lines

Numbered

Auto Contour

Interpolated Mesh

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a contour plot displayed with different color and line settings.


ADDING A TITLE TO A CONTOUR PLOT

To add a title to a contour plot:

Double-click on a plot to open a tabbed dialog box.

Click on the Title tab.

In the text box, type the title for your graph. You can use upper and lower case letters in the title.

Make sure the "Show Title" checkbox has a check in it.

Click on either the "Above" or "Below" button. Then click "OK" to display the title of the graph region or "Cancel" to restore the title text box to its original state.


Surface Plot

When this button is clicked, the contour plot is converted into a surface plot that shows a three-dimensional illustration of a matrix's level curves.

See Mathcad Quicksheets for an example.


3D Bar Chart

When this button is clicked, the contour plot is converted into a 3D bar chart that shows a matrix as bars of varying heights.


Data Points

When this button is clicked, the contour plot is converted into a plot showing just the points making up the surface.


Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by grid lines.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 1 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Min. Val./Max. Val.

The Min. Val. and Max. Val. text boxes let you control the axis limits displayed for the specified axis. Since the contour plot is stored as rows and columns in a matrix, Mathcad has no way of knowing the actual values of the x and y axes. The row and column numbers therefore have no real significance as coordinates. They affect the display only. By default, Min and Max are set to -1 and 1 respectively.


Contour Lines

When this is checked, contour lines will be drawn. You should leave this box checked unless you've clicked on either the Grayscale or the Color button.


Numbered

When this is checked, you'll see a number beside each contour to indicate the level marked by that contour. Mathcad doesn’t number every contour when to do so would result in overcrowding.


Auto Contour

When this is checked the number of contour lines to display is automatically calculated based on the extent of the data. When this is unchecked, you can enter the number of contours in the text box labeled "No. of contours."

The following example shows a contour plot formatted with the "Auto contour" box unchecked and "8" written in the "No. of contours" box.


Color

When you click on this button, the bands between the contour lines are colored. The colors range from red for the largest values, through yellow and green and on to blue for the smallest values.


None

When this button is selected, the plot doesn't have any shading. Be sure to click on Contour Lines to see the contour plot at all.


Grayscale

This makes the bands between contour lines shades of gray. The shades range from white for the largest values to black for the smallest values.


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed on the screen.


VIEW PAGE FOR SURFACE PLOTS

Click on the various parts of the dialog box to see what they're for:


VIEW PAGE FOR CONTOUR PLOTS

Click on the various parts of the dialog box to see what they're for:


VIEW PAGE FOR 3D BAR CHARTS

Click on the various parts of the dialog box to see what they're for:


VIEW PAGE FOR SCATTER PLOTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR SURFACE PLOTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR CONTOUR PLOTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR 3D BAR CHARTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR SCATTER PLOTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR VECTOR PLOTS

Click on the various parts of the dialog box to see what they're for:


COLOR AND LINES PAGE FOR SURFACE PLOTS

Click on the various parts of the dialog box to see what they're for:


COLOR AND LINES PAGE FOR CONTOUR PLOTS

Click on the various parts of the dialog box to see what they're for:


COLOR AND LINES PAGE FOR 3D BAR CHARTS

Click on the various parts of the dialog box to see what they're for:


COLOR AND LINES PAGE FOR SCATTER PLOTS

Click on the various parts of the dialog box to see what they're for:


TITLE PAGE FOR SURFACE PLOTS

Click on the various parts of the dialog box to see what they're for:


TITLE PAGE FOR CONTOUR PLOTS

Click on the various parts of the dialog box to see what they're for:


TITLE PAGE FOR 3D BAR CHARTS

Click on the various parts of the dialog box to see what they're for:


TITLE PAGE FOR SCATTER PLOTS

Click on the various parts of the dialog box to see what they're for:


TITLE PAGE FOR VECTOR PLOTS

Click on the various parts of the dialog box to see what they're for:


Title

Controls placement of title. Type the title in the text box. Click on the "Above" or "Below" buttons to position the title. Make sure "Show Title" is checked.

You can suppress the display of a title without actually deleting it by leaving "Show Title" unchecked.


AXES PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


TRACES PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


LABELS PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULTS PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULT AXES PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULT TRACES PAGE FOR XY PLOTS

Click on the various parts of the dialog box to see what they're for:


AXES PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


TRACES PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


LABELS PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULTS PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULT AXES PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


DEFAULT TRACES PAGE FOR POLAR PLOTS

Click on the various parts of the dialog box to see what they're for:


Collaboratory

A Web site maintained by MathSoft. The Collaboratory contains worksheets and other documents collected from around the world and organized into forums. By using the Collaboratory dialog box, visitors to the Collaboratory can easily engage in multi-threaded discussions on a variety of topics, exchanging worksheets and other documents as they do so.


Context menu

The menu that appears when you click on a region to select it and then click on it with the right mouse button.


Input variable

A Mathcad variable (an array or a scalar) whose value(s) are passed to another application or data source via a component.


Output variable

A Mathcad variable (an array or a scalar) that is defined with values from another application or data source via a component.


Template

A file on which a Mathcad worksheet is based. A template contains customized information for laying out and formatting the worksheet.

The default template is the Blank Worksheet template, but Mathcad comes with a variety of predefined templates for you to use as you create new Mathcad worksheets. To see the templates available, choose New from the File menu.

You may extend the collection of templates by saving any of your Mathcad worksheets as a template. Mathcad uses “.mct” as the default file extension for templates.


Upwardly compatible

Mathcad worksheets are upwardly compatible meaning that a worksheet created in an earlier version of Mathcad will open in the same or higher version.


Active worksheet

This is the worksheet that will be sensitive to most menu commands, to palette buttons and to keystrokes. You can identify the active worksheet's window by its title bar. Look for the worksheet window having a distinctive title bar.


Argument list

This is the list of variables between the parentheses in a function. For example, in the expression:

f(x, y, z) := x + y + z + w

The argument list is

x, y, z


URL (Universal Resource Locator)

This is the path name to a particular file on the Internet. For example, the URL to the MathSoft home page on the World Wide Web is "http://www.mathsoft.com"


ASCII file

This is a simple text file you can open in a basic text editor such as Notepad for Windows or SimpleText for Macintosh. The file contains nothing but letters, numbers, spaces, tabs and carriage returns. Many applications can save their documents in this form. You would usually use the Save As command and look in the scrolling list of file types.


Argument to a function

This refers to whatever appears between the parentheses when you use or define a function. For example:


:=

This is the most commonly used assignment operator. It evaluates whatever is on its right and assigns it to the variable name on its left.

The left side must be either a variable name or a function name; not an expression. The right side must be an expression that evaluates to a number or a function definition. Any variables or functions on the right side must already have been defined.


Pointer (defined)
Pointer

The pointer is the symbol that moves around as you move the mouse. The pointer takes on three different forms:

Most of the time, the pointer looks like an arrow.

When you move the pointer over the edge of a selected region, it turns into a small hand.

When the clipboard contains a math expression and you drag with the Ctrl key held down, the pointer turns into an arrow with a small box balanced at its tip.


Scalar (defined)
Scalar

A scalar is a single number, for example 2 or 34+2i. Anything that's not a scalar is either a vector or a matrix.

When something is 'scalar valued,' it returns a scalar as a result. For example, cos(0) is scalar valued because it returns the single number 1. However identity(3) returns a 3x3 matrix. It is therefore not scalar valued, but matrix valued.


Dimensions

A dimension is a physical quantity associated with a number, an array or a variable representing a number or array. You can combine any of the following fundamental dimensions:

length

time

mass

charge

temperature

Note that a dimension is not a unit. A unit is a way to measure a dimension. For example, "ft", "cm" and "mm" are three different ways to measure the single dimension "length".


Pathname

A pathname is the complete DOS name for a file. For example, if a file named tuba.mcd is in a subdirectory called \orchestra\brass on your A drive, its full pathname is

A:\orchestra\brass\tuba.mcd.


Filename

A filename is the name for a file including the extension.

Example:   tuba.txt.


Variables style

This is the default math style assigned to any variable or function name you type in the worksheet.


Constants style

This is the default math style assigned to any constant you type in the worksheet.


User math styles

Rather than change the font of a name or number directly, you can create a new math style and assign the it to one or more names or numbers.

To create a new user math style:

Choose Equation from the Format menu.

Choose an unused math style such as “User1.”

In the “New Style Name” box, type a name for this new math style.

Click on the “Properties” button and choose a font, size, and style for this math style.

Click “OK.”

To apply this math style to a particular name or number:

Click on the name or number.

Choose Equation from the Format menu.

In the dialog box, choose a math style from the drop-down list.

Click “OK” to assign the selected style to the selected name.


Math Style

A tag consists of a font, size and style combination. Whenever you type a variable name, Mathcad assigns to it a math style named “Variables” which has a particular font, size, and style associated with it. Similarly, when you type a constant, Mathcad assigns to it a math style named “Constants” which also has a particular font, size, and style associated with it.

To see what math style is currently assigned to a name or number, click on the name or number and look at the math style window on the font bar or choose Equation from the Format menu.

To change the font characteristics of a style:

Choose Equation from the Format menu.

Select a style and click “Properties.”

To change the math style associated with a name or number:

Click in the name or number.

Choose Equation from the Format menu.

Select a style and click “OK.”


Graphics region

A graphics region is a region containing either:

An XY plot

A polar plot

A surface plot

A contour plot

A 3D bar chart

A vector field plot

A scatter plot

A graphics image

To create a graphics region, choose the appropriate entry from the Insert menu.


Importing from a data file

To bring data from an external data file into a Mathcad worksheet in a one-time fashion.


Reading data from a data file

To bring data from an external data file into a Mathcad worksheet by connecting to the data file. If the data file changes, the data automatically updates in the Mathcad worksheet.


Exporting data to a file

To send data out of a Mathcad worksheet into an external data file in a one-time fashion.


Writing data to a file

To send data from a Mathcad worksheet to an external data file by connecting to the data file. If the data in the Mathcad worksheet changes, the data automatically updates in the data file.


Windows bitmap image

A graphic image stored in standard Windows graphics format.

Many Windows applications, for example the Paintbrush accessory that ships with Windows, can create bitmap images.

Bitmap images stored in files usually end in the extension 'BMP'


Insertion point

The 'insertion point' is marked by a red vertical line behind which characters you type appear. Use the [image] and [image] keys to move it. You can also click wherever you want to move it.


Crosshair

The 'crosshair' appears when you click in empty space. It shows where the next character you type or the next paste from the clipboard will appear.

Move the crosshair either by clicking wherever you want to put it, with the arrow keys, the Enter key, the space bar, or the PgUp and PgDn keys.


Operator

An operator is something that turns one or more numbers into a third number. Examples are:

The exponent operator in " [image] "

The factorial operator in "(x + z)!",

The plus sign in "1 + 1",

The integral sign in [image].

The numbers that the operator acts on are called "operands."


Operand (defined)
Operand

An operand is a number or an expression upon which an operator acts. For example, in the expression "5! + 3" the number "3" and the expression "5!" are operands of the operator "plus." The numbers "5" is an operand of the factorial (!) operator.

The following table gives examples of operands:


Clipboard

The 'clipboard' is a temporary storage location in your operating system.

To place something on the clipboard, select it, pull down the Edit menu, and choose

Cut to remove it from the worksheet and put it on the clipboard.

Copy to put it on the clipboard without removing it from the worksheet.

When you cut or copy to the clipboard, the previous contents of the clipboard are discarded.

To put whatever is on the clipboard into your worksheet, choose Paste from the Edit menu.


Operator palette

The operator palettes are opened by clicking on the buttons just underneath the menu bar. Clicking on the buttons in these palettes inserts the corresponding operator.


Empty space

This refers to the space between regions. Whenever you click in empty space, you see a crosshair.

The blank spaces that separate variables and operators in an equation are not considered empty space.


Placeholder (defined)
Placeholder

A small black box in a math region is a 'placeholder.' The placeholder indicates that the mathematical expression or plot is incomplete. To complete it, you need to put something appropriate in the placeholder.

To fill the placeholder, click on it and begin typing.


Unit placeholder

If you click on a numerical result, you'll see a small black box to the right of the result. This is the 'unit placeholder'.

To fill the placeholder, click on it and type the name of a unit.


Editing lines

Use the arrow keys or click in different parts of the expression to change what's between the editing lines.

As a general rule,

Whatever is underlined and to the left of the insertion line becomes the first operand of the next operator you type.

To place an expression between the editing lines as described above:

Click in the expression with the mouse.

Use the arrow keys if necessary to move the editing lines.

If necessary, press the Space key to lengthen the editing lines until they hold the expression between them.


Region

Anything you create in your worksheet goes into a 'region.' Procedures for selecting, deleting and moving regions are the same regardless of what's in the region.

When you click in a region, you'll see either the a pair of editing lines or the text insertion point. When you click outside a region, you'll see a small crosshair.


Solve block

A 'solve block' consists of no more than 50  equations and inequalities between the keyword 'Given' and either a Find or Minerr function. The equations and inequalities should be typed using any of the boolean operators except Ctrl +3 (‘not equal to’).

Solve blocks should not contain the following:

Range variables.

Inequalities of the form a<b<c.

Other solve blocks. Each solve block can have only one ‘Given’ and one Find or Minerr function. You can however, define a function like f(x):=Find(x) at the end of one solve block and use this same function in another solve block.

Assignment statements using the assignment operator. When typing an equals sign in a solve block, press Ctrl+=.


OLE server

A Windows application capable of exporting OLE (Object Linking and Embedding) objects via the clipboard.

This feature allows you to edit the OLE object using whatever application created it. To do so, double-click on the object.


Embedded object

An object which, when double-clicked on, opens the application that created it and places a copy of itself into the application window. Or, if the application supports in-place activation, Mathcad’s menus and toolbars change to those of the other application and a hatched border surrounds the object.

Any changes you make to the object will affect only the object in Mathcad. This is analogous to making a photocopy and marking up the copy while leaving the original undisturbed.


Linked object

An object which, when double-clicked on, opens the application that created it together with a file containing the object. Or, if the application supports in-place activation, Mathcad’s menus and toolbars change to those of the other application and a hatched border surrounds the object.

Any changes you make to the object will affect the actual file containing the object.


Algebraic transformation

This is simply rearranging a math expression into another, equivalent math expression.


Boolean expression

This is an expression whose result is either true or false. For example:

"1 > 2" is Boolean because its value is "FALSE".

"x = 2" is Boolean because it could be either "TRUE" or "FALSE", depending on the value of "x".

"1 + 1" is NOT Boolean because it is neither "TRUE" nor "FALSE", it is simply "2".


The Resource Center is a collection of tools to help you get the most out of Mathcad such as reference tables, a Mathcad tutorial, Mathcad Quicksheets, and a link to MathSoft’s World Wide Web site.


Quickplots

Usually when you create a plot in Mathcad, you need to have previously defined the variables in the expression you are plotting. In a Quickplot, there is no need for these variable definitions.

For example, if you want to plot x versus x^2, you need to have previously defined x as a range variable. To create a Quickplot, however, you do not need to define x. Simply plot x versus x^2. Mathcad will choose an appropriate range for x and create the graph.


Electronic Books

A Mathcad Electronic Book is a collection of several hundred hyperlinked, interactive Mathcad worksheets demonstrating various calculations often performed in a certain discipline such as electrical engineering, statistics, finance, and advanced mathematics. A Mathcad Electronic Book has a table of contents, an index, and a full word search.


Function Packs

A Mathcad Function Pack, like an Electronic Book, is a collection of several hundred hyperlinked, interactive Mathcad worksheets. Unlike an Electronic Book, a Function Pack adds additional functions to Mathcad. For example, the Signal Processing Function Pack adds functions for designing digital filters. Function Packs require Mathcad Professional.


Quicksheets

Quicksheets are Mathcad worksheets demonstrating a variety of calculations. To open a Quicksheet, choose Resource Center from the Help menu and click on Quicksheets. You can search for a Quicksheet on a particular function or operator, by using the Search button on the toolbar at the top of the window.


DIFFERENTIAL EQUATION SOLVERS

Mathcad has a variety of functions for numerically solving ordinary differential equations, systems of differential equations, and certain partial differential equations.

Solving ordinary differential equations

rkfixed(y,x1,x2,npoints,D)

Smooth systems

Bulstoer(y,x1,x2,npoints,D)

Stiff systems

Stiffb(y,x1,x2,npoints,D,J)

Stiffr(y,x1,x2,npoints,D,J)

Slowly varying systems

Rkadapt(y,x1,x2,npoints,D)

Finding the last point on the integration interval

bulstoer(y,x1,x2,acc,D,kmax,save)

rkadapt(y,x1,x2,acc,D,kmax,save)

stiffb(y,x1,x2,acc,D,J,kmax,save)

stiffr(y,x1,x2,acc,D,J,kmax,save)

Solving two-point boundary value problems

bvalfit(v1,v2,x1,x2,xf,D,load1,load2,score)

sbval(v,x1,x2,D,load,score)

Solving partial differential equations

relax(a,b,c,d,e,f,u,rjac)

multigrid(M,ncycle)


Differential equations (generally)
DIFFERENTIAL EQUATIONS

Ordinary differential equations

Using rkfixed to solve an nth order ordinary differential equation.

Systems of differential equations

Using rkfixed to solve a system of n ordinary differential equations.

Differential equations with special properties

Using the Bulstoer function for smooth systems, the Stiffb and Stiffr functions for stiff systems, and Rkadapt for slowly varying systems.

When you want only the last point

Functions to use when you're only interested in the solution value at the last point on the integration interval.

Two point boundary value problems

Using bvalfit and sbval to convert a two-point boundary value problem to an initial value problem amenable to solution by rkfixed.

Partial differential equations

Using relax and multigrid to solve Poisson's equation in a square region.


ORDINARY DIFFERENTIAL EQUATIONS

The example below shows how to use rkfixed to evaluate the solution of a second order differential equation at equally spaced points.


SYSTEMS OF DIFFERENTIAL EQUATIONS

The example below shows how to use rkfixed to evaluate the solutions to the system of differential equations

at equally spaced points.


DIFFERENTIAL EQUATIONS WITH SPECIAL PROPERTIES

Follow the example for using rkfixed for one or more differential equations but use one of the functions below in place of rkfixed.

For smooth systems, use Bulstoer.

For stiff systems, use Stiffb or Stiffr.

For slowly-varying systems, use Rkadapt.


When the solution doesn't change fast, Rkadapt can adapt its step-size to avoid wasting processing time.


A system is stiff if when expressed in the form:

y=A x

the matrix A is nearly singular

Under these conditions, rkfixed may oscillate or be unstable.


When a system has no discontinuities in its solution, the Bulirsch-Stoer algorithm used by Bulstoer will be slightly more accurate than rkfixed.


WHEN YOU WANT ONLY THE LAST POINT

If you're not interested in seeing all the intermediate values taken by the solution, you can save processing time and reduce memory consumption by using one of the functions below.

stiffb and stiffr for stiff systems.

rkadapt for slowly varying systems.

bulstoer for smooth systems.

Unlike their uppercase equivalents, you don't specify the number of points in the result. Instead, you specify the level of accuracy and allow these functions to generate a solution having the required number of elements.


TWO POINT BOUNDARY VALUE PROBLEMS

To solve an nth order initial value problem, you need to know the value of the function and its first n-1 derivatives at the beginning of the integration interval. If you don't know this but:

You know some of the values of the solution and its derivatives at the beginning of the integration interval, and

You know some of the values of the solution and its derivatives elsewhere in the integration interval, and

Together you have n known values

Then you can solve for the unknown values at the beginning of the integration interval and convert your boundary value problem to an initial value problem amenable to solution by rkfixed and the other differential equation solvers.

If you know the values at the endpoint of the integration interval, use sbval.

If you know the values somewhere in the middle of the integration interval, use bvalfit.

Examples

Using the sbval function

Using the bvalfit function


USING THE SBVAL FUNCTION


USING THE BVALFIT FUNCTION


PARTIAL DIFFERENTIAL EQUATIONS

To solve Poisson's equation in a square region:

Use relax when the boundary condition is a constant along each side of the square.

Use multigrid when the boundary condition is zero on all four sides.

Examples

Using the relax function

Using the multigrid function


USING THE RELAX FUNCTION


USING THE MULTIGRID FUNCTION


SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS

rkfixed(y, x1, x2, npoints, D)

rkfixed returns a matrix in which: (1)the first column contains the points at which the solution is evaluated and (2)the remaining column contains the corresponding values of the solution and its first n-1 derivatives. rkfixed uses the fourth order Runge-Kutta method to solve first order differential equations.

Arguments:

y must be a vector of n initial values.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by rkfixed.

D is an n-element vector-valued function containing first derivatives of unknown functions.

Examples

Solving a second order differential equation

Solving a system of differential equations


SMOOTH SYSTEMS

Bulstoer(y, x1, x2, npoints, D)

Bulstoer returns a matrix in which: (1)the first column contains the points at which the solution is evaluated and (2)the remaining columns contain the corresponding values of the solution and its first n-1 derivatives. Bulstoer uses the Bulirsch-Stoer method which will be slightly more accurate than the Runge-Kutta method used by rkfixed.

Use the Bulstoer function instead of rkfixed when you know the solution is smooth.

Arguments:

y must be a vector of n initial values.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows
(1 + npoints) in the matrix returned by Bulstoer.

D  is an n-element vector-valued function containing the first derivatives of the unknown functions.


SOLUTION USING ADAPTIVE STEP SIZES

Rkadapt(y, x1, x2, npoints, D)

Rkadapt returns a matrix in which: (1)the first column contains the points at which the solution is evaluated and (2)the remaining columns contain the corresponding values of the solution and its first n-1 derivatives.

Unlike rkfixed which integrates in equal size steps to reach a solution, Rkadapt examines how fast a solution is changing and adapts its step-size accordingly. Rkadapt will use nonuniform step sizes internally when it solves the differential equation, but will return the solution at equally spaced points.

Arguments:

y must be a vector of n initial values.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by Rkadapt.

D  is an n-element vector-valued function containing the first derivatives of the unknown functions.


STIFF SYSTEMS

Stiffb(y, x1, x2, npoints, D, J)
Stiffr(Y, x1, x2, npoints, D, J)

Stiffb and Stiffr return a matrix in which: (1)the first column contains the points at which the solution is evaluated and (2)the remaining columns contain the corresponding values of the solution and its first n-1 derivatives.

Stiffb uses the Bulirsch-Stoer method for stiff systems. Stiffr uses the Rosenbrock method.

Use one of the two differential equation solvers specifically designed for stiff systems: Stiffb and Stiffr when solving a stiff system.

Arguments:

y must be a vector of n initial values.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

npoints is the number of points beyond the initial point at which the solution is to be approximated. This controls the number of rows
(1 + npoints) in the matrix returned by Stiffb or Stiffr.

D  is an n-element vector-valued function containing the first derivatives of the unknown functions.

J is a function which returns the n by (n+1) matrix whose first column contains derivatives and whose remaining rows and columns form the Jacobian matrix for the system of differential equations.


USING END VALUES TO DERIVE INITIAL CONDITIONS

sbval(v, x1, x2, D, load, score)

The sbval function returns a vector containing those initial values left unspecified at x1.

sbval solves a two-point boundary value problem by shooting from the endpoints and matching the trajectories of the solution and its derivatives at the intermediate point.

sbval computes the initial values the solution must have in order for the solution to match the final values you specify. You must then take the initial values returned by sbval and solve the resulting initial value problem.

When you know the solution at x1 and at x2, and you have n known values, you should use sbval to evaluate the missing initial values at x1. Once you have these missing initial values, you will have an initial value problem rather than a two-point boundary value problem.

Arguments:

v is a vector of guesses for the initial values left unspecified at x1.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated.

D  is an n-element vector-valued function containing first derivatives of the unknown functions.

load is a vector-valued function whose n elements correspond to values of the n unknown functions at x1. Some values will be constants specified by your initial conditions. Others will be unknown at the outset but will be found by sbval. If a value is unknown, use the corresponding guess value from v.

score is a vector-valued function having the same number of elements as v. Each element is the difference between an initial condition at x2, as originally specified, and the corresponding estimate from solution. The score vector measures how closely a proposed solution matches the initial conditions at x2. A value of 0 for any element indicates a perfect match.


USING INTERMEDIATE VALUES TO DERIVE INITIAL CONDITIONS

bvalfit(v1, v2, x1, x2, xf, D, load1, load2, score)

The bvalfit function returns a vector containing those initial values left unspecified at x1.

bvalfit solves a two-point boundary value problem by shooting from the endpoints and matching the trajectories of the solution and its derivatives at the intermediate point.

This method becomes especially useful when the derivative has a discontinuity somewhere in the integration interval.

Arguments:

v1 is a vector of guesses for the initial values left unspecified at x1. v2 is a vector which contains guesses for initial values left unspecified at x2.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated.

xf is a point between x1 and x2 at which the trajectories of the solutions beginning at x1 and those beginning at x2 are constrained to be equal.

D  is an n-element vector-valued function containing the first derivatives of the unknown functions.

load1 is a vector-valued function whose n elements correspond to the values of the n unknown functions at x1. Some of these values will be constants specified by your initial conditions. If a value is unknown you should use the corresponding guess value from v1.

load2 is analogous to load1 but for values taken by the n unknown functions at x2.

score is an n-element vector valued function used to specify how you want the solutions to match at xf. You'll usually want to define score(xf, y) := y to make the solutions to all unknown functions match up at xf.


POISSON'S EQUATION

relax(a, b, c, d, e, f, u, rjac)

relax returns a square matrix in which: (1)an element's location in the matrix corresponds to its location within the square region, and (2)its value approximates the value of the solution at that point.

This function uses the relaxation method to converge to the solution.

You should use the relax function if you know the value taken by the unknown function u(x, y) on all four sides of a square region.

Arguments:

a, b, c, d, e are square matrices all of the same size containing coefficients of the differential equation.

f is a square matrix containing the source term at each point inside the square.

u is a square matrix containing boundary values along the edges of the region and initial guesses for the solution inside the region.

rjac is a spectral radius of the Jacobi iteration. This controls the convergence of the relaxation algorithm. It can range from 0 to 1 but its optimal value depends on the details of your problem.

If the boundary condition is zero on all four sides of the square integration domain, use the multigrid function instead.


POISSON'S EQUATION WITH ZERO BOUNDARY CONDITIONS

multigrid(M, ncycle)

multigrid returns a square matrix in which: (1)an element's location in the matrix corresponds to its location within the square region, and (2)its value approximates the value of the solution at that point.

If u(x, y) is zero on all four sides of the square, use the multigrid function. This function will often solve the problem faster than relax.

Arguments:

M is a 1+2^n row square matrix whose elements correspond to the source term at the corresponding point in the square domain.

ncycle is the number of cycles at each level of the multigrid iteration. A value of 2 will generally give a good approximation of the solution.


FUNCTIONS WHICH EVALUATE ONLY THE SOLUTION'S FINAL VALUE

bulstoer(y, x1, x2, acc, D, kmax, save)
rkadapt(y, x1, x2, acc, D, kmax, save)
stiffb(y, x1, x2, acc, D, J, kmax, save)
stiffr(y, x1, x2, acc, D, J, kmax, save)

Use these functions when you only want the value of the solution at the endpoint of integration. Each function corresponds to one of those already discussed. The properties of each of these functions are identical to those of the corresponding function in the previous sections.

Arguments:

y must be a vector of n initial values.

x1, x2 are endpoints of the interval on which the solution to differential equations will be evaluated. Initial values in y are the values at x1.

acc controls the accuracy of the solution. A small value of acc forces the algorithm to take smaller steps along the trajectory, thereby increasing the accuracy of the solution. Values of acc around 0.001 will generally yield accurate solutions.

npoints is the number of points beyond initial point at which solution is to be approximated. This controls the number of rows (1 + npoints) in the matrix returned by Stiffb or Stiffr.

D  is an n-element vector-valued function containing the first derivatives of the unknown functions.

J is a function which returns the n by (n+1) matrix whose first column contains derivatives and whose remaining rows and columns form the Jacobian matrix for the system of differential equations.

kmax is the maximum number of intermediate points at which the solution will be approximated. The value of kmax places an upper bound on the number of rows of the matrix returned by these functions.

save is the smallest allowable spacing between the values at which the solutions are to be approximated. This places a lower bound on the difference between any two numbers in the first column of the matrix returned by the function.


First order differential equation

A first order differential equation is one in which the highest order derivative of the unknown function is the first derivative.


Ordinary differential equation

An Ordinary differential equation is a differential equation in which the unknown is a function of one variable.


Parial differential equation

A partial differential equation is a differential equation in which the unknown is a function of two or more variables.


THE STANDARD FORM OF A DIFFERENTIAL EQUATION

The most important step in “prepping” a differential equation for Mathcad’s differential equation solvers is to get them into stardard form which Mathcad’s differential solvers understand. The process is to take a differential equation and get rid of any higher order derivatives that appear, leaving only first derivatives. Your differential equation is then a system of first order differential equations.

For example, the differential equation:

contains a second derivative which can be written as a first derivative:

Define two functions as:

Now the differential equation contains two functions and is essentially a system of two differential equations:

The next step is to capture this information in a single vector valued function D for use with Mathcad’s differential equation solvers:


EULER GAMMA FUNCTION

Arguments:

z is a real or complex scalar. z cannot be 0, −1, −2...

For complex z, Γ(z) is the analytic continuation of the real function.

For z = 0, −1, −2 Γ(z) is undefined.

The following identities involving the gamma function may be useful:

Γ(z + 1) = zΓ(z)

Γ(z) Γ(1 − z) = π csc(πz)

Γ(n + 1) = n!


ERROR FUNCTION

Arguments:

x is a real scalar.

For x complex, erf(x) is undefined.

To define the complementary error function, add the following definition to your worksheet:

cerf(x) := 1 − erf(x)


NORMAL DISTRIBUTION

dnorm(x,μ,σ)	Returns the probability density for the normal distribution.

pnorm(x,μ,σ)	Returns the cumulative probability distribution.

cnorm(x)	Returns the cumulative probability distribution with mean 0 and variance 1.

qnorm(p,μ,σ)	Returns the inverse cumulative probability distribution.

rnorm(m,μ,σ)	Returns a vector of m random numbers having the normal distribution.


BINOMIAL DISTRIBUTION

dbinom(k,n,p)	Returns the probability density for the binomial distribution.

pbinom(k,n,p)	Returns the cumulative probability distribution.

qbinom(p,n,r)	Returns the inverse cumulative probability distribution.

rbinom(m,n,p)	Returns a vector of m random numbers having the binomial distribution.


CHI-SQUARED DISTRIBUTION

dchisq(x,d)	Returns the probability density for the chi-squared distribution.

pchisq(x,d)	Returns the cumulative probability distribution.

qchisq(p,d)	Returns the inverse cumulative probability distribution.

rchisq(m,d)	Returns a vector of m random numbers having the chi-squared distribution.


F DISTRIBUTION

dF(x,d1,d2)	Returns the probability density for the F distribution.

pF(x,d1,d2)	Returns the cumulative probability distribution.

qF(p,d1,d2)	Returns the inverse cumulative probability distribution.

rF(m,d1,d2)	Returns a vector of m random numbers having the F distribution.


POISSON DISTRIBUTION

dpois(k,λ)	Returns the probability density for the Poisson distribution.

ppois(k,λ)	Returns the cumulative probability distribution.

qpois(p,λ)	Returns the inverse cumulative probability distribution.

rpois(m,λ)	Returns a vector of m random numbers having the Poisson distribution.


STUDENT'S t DISTRIBUTION

dt(x,d)	Returns the probability density for the Student's t distribution.

pt(x,d)	Returns the cumulative probability distribution.

qt(p,d)	Returns the inverse cumulative probability distribution.

rt(m,d)	Returns a vector of m random numbers having the Student's t distribution.


UNIFORM DISTRIBUTION

dunif(x,a,b)	Returns the probability density for the uniform distribution.

punif(x,a,b)	Returns the cumulative probability distribution.

qunif(p,a,b)	Returns the inverse cumulative probability distribution.

rnd(x)	Returns uniformly distributed random number between 0 and x.

runif(m,a,b)	Returns a vector of m random numbers having the uniform distribution.


Probability density

These give the likelihood that a random variable will take on a particular value.


Cumulative probability distribution

These give the probability that a random variable will take on a value less than or equal to a specified value. These are obtained by simply integrating (or summing when appropriate) the corresponding probability density over an appropriate range.


Inverse cumulative probability distribution

These functions take a probability as an argument and return a value such that the probability that a random variable will be less than or equal to that value is whatever probability you supplied as an argument.


seed

Must be an integer between 1 and 32000.

Each seed value selects a sequence of uniformly distributed random numbers.


Distribution Functions
DENSITY AND DISTRIBUTION FUNCTIONS

beta

binomial

cauchy

chi squared

exponential

F

gamma

geometric

log normal

logistic

negative binomial

normal

poisson

student's t

uniform

weibull


RANDOM NUMBER GENERATORS

beta

binomial

cauchy

chi squared

exponential

F

gamma

geometric

log normal

logistic

negative binomial

normal

poisson

student's t

uniform

weibull

The random number generators use a seed value of 1 to generate a sequence of random numbers. To generate a different sequence of random numbers, change the seed value by choosing Options / Built-in Variables Tab from the Math menu and entering a seed value.


BETA DISTRIBUTION

dbeta(x,s1,s2)	Returns the probability density for the beta distribution.

pbeta(x,s1,s2)	Returns the cumulative probability distribution.

qbeta(x,s1,s2)	Returns the inverse cumulative probability distribution.

rbeta(m,s1,s2)	Returns a vector of m random numbers having the beta distribution.


GEOMETRIC DISTRIBUTION

dgeom(k,p)	Returns the probability density for the geometric distribution.

pgeom(k,p)	Returns the cumulative probability distribution.

qgeom(p,r)	Returns the inverse cumulative probability distribution.

rgeom(m,p)	Returns a vector of m random numbers having the geometric distribution.


CAUCHY DISTRIBUTION

dcauchy(x,l,s)	Returns the probability density for the Cauchy distribution.

pcauchy(x,l,s)	Returns the cumulative probability distribution.

qcauchy(p,l,s)	Returns the inverse cumulative probability distribution.

rcauchy(m,l,s)	Returns a vector of m random numbers having the Cauchy distribution.


EXPONENTIAL DISTRIBUTION

dexp(x,r)	Returns the probability density for the exponential distribution.

pexp(x,r)	Returns the cumulative probability distribution.

qexp(p,r)	Returns the inverse cumulative probability distribution.

rexp(m,r)	Returns a vector of m random numbers having the exponential distribution.


GAMMA DISTRIBUTION

dgamma(x,s)	Returns the probability density for the gamma distribution.

pgamma(x,s)	Returns the cumulative probability distribution.

qgamma(p,s)	Returns the inverse cumulative probability distribution.

rgamma(m,s)	Returns a vector of m random numbers having the gamma distribution.


LOG NORMAL DISTRIBUTION

dlnorm(x,μ,σ)	Returns the probability density for the log normal distribution.

plnorm(x,μ,σ)	Returns the cumulative probability distribution.

qlnorm(p,μ,σ)	Returns the inverse cumulative probability distribution.

rlnorm(m,μ,σ)	Returns a vector of m random numbers having the log normal distribution.


LOGISTIC DISTRIBUTION

dlogis(x,l,s)	Returns the probability density for the logistic distribution.

plogis(x,l,s)	Returns the cumulative probability distribution.

qlogis(p,l,s)	Returns the inverse cumulative probability distribution.

rlogis(m,l,s)	Returns a vector of m random numbers having the logistic distribution.


WEIBULL DISTRIBUTION

dweibull(x,s)	Returns the probability density for the Weibull distribution.

pweibull(x,s)	Returns the cumulative probability distribution.

qweibill(p,s)	Returns the inverse cumulative probability distribution.

rweibull(m,s)	Returns a vector of m random numbers having the Weibull distribution.


NEGATIVE BINOMIAL DISTRIBUTION

dnbinom(k,n,p)	Returns the probability density for the negative binomial distribution.

pnbinom(k,n,p)	Returns the cumulative probability distribution.

qnbinom(p,n,r)	Returns the inverse cumulative probability distribution.

rnbinom(m,n,p)	Returns a vector of m random numbers having the negative binomial distribution.


WORKSHEET MANAGEMENT

Mathcad allows you to create a worksheet based on a built-in template or on one that you create. Templates can be modified to suit your needs.

Once you’ve created a worksheet, you can do any of the following:

Open...

a new worksheet.

an existing worksheet.

a worksheet on the Internet.

Save the current worksheet...

under the same name.

under a different name.

as an RTF file.

as a Mathcad 6 worksheet.

Incorporate one worksheet inside another by...

pointing to an existing worksheet.

Disseminate your worksheet by...

printing it.

mailing it.

Dismiss your worksheet by...

closing it	Ctrl+F4

exiting the program	Alt+F4


Related Topics:

Creating a new worksheet

Creating a new template

Modifying a template

Opening an existing worksheet

Opening a worksheet on the Internet

Including one worksheet inside another

Saving a worksheet

Renaming a worksheet

Exporting a worksheet to another application

Mailing a worksheet

Closing a worksheet


Related Topics:

Creating a new template

Modifying a template

Creating a new worksheet

Opening a worksheet on the Internet

Saving a worksheet

Renaming a worksheet


EDITING CURSOR

The editing cursor takes on the three different forms shown below. Click on any picture below to learn what that cursor is for and how to get it.

Crosshair

Text insertion point

Editing lines

Don't confuse the "cursor" with the "pointer". The pointer is used to place the cursor. Which of the above three forms the cursor takes will depend on what the pointer is pointing at when you click the mouse.


Cursors look like this:

Unlike pointers, cursors respond to the arrow keys. You use cursors to type things. You can use pointers to drop a cursor into various places.


Pointers look like this:

Unlike cursors, pointers move with the mouse. Pointers can take many different forms. The one you'll see most often is

You'll use this arrow pointer to drop the cursor into new places.


POINTER

The pointer is what moves around as you move the mouse. It can take many different forms. Click on any of the pictures below for more detail.

To place a cursor

To resize a region

To drag a region

To drag the math expression


When you see the arrow pointer, a mouse click will:

place a crosshair wherever you click if you click in a blank space, or

place a text insertion point if you click in text, or

place a pair of editing lines if you click in math.


When the pointer looks like this, it means you've copied some information from an Electronic Book. If you double-click with the pointer looking like this:

This pastes whatever information you've copied wherever you happen to be pointing, and

turns the book pointer back into the default arrow.


When you see the hand pointer, you'll be able to drag the region(s) you've selected to some other part of the worksheet. To get this pointer:

Select one or more regions.

Move the arrow pointer to the edge of any selected region. This turns the arrow pointer into a hand.

If you now drag the hand you'll see the selected regions follow it.


When the pointer looks like this, you can copy whatever math expression you selected to a new location. To get this pointer,

Click on any part of an expression.

Press and hold down the Ctrl key and the mouse button.

Drag the pointer either to an empty space or to a placeholder and release the mouse button to drop the expression you selected.


When the pointer looks like any one of these double-headed arrows, it means you can change the size or shape of whatever region you've selected. To get this pointer:

Select a region.

Move the pointer to one of the three "handles" lying along the edge of the region.

If you now drag the mouse you'll see the selected region change size.


CROSSHAIR CURSOR

Where can it appear?

How do you make it appear?

How do you move it around?

What's it for?


The crosshair can exist only outside a math or text region.

This is the only cursor that can exist in a blank spot in your worksheet.


Click in any blank spot in your worksheet.


Click in another blank spot, or use the arrow keys to move it in the corresponding direction. Use PgUp and PgDn to move up or down about 80% of the window height.


The next math or text region you type begins at the location of the crosshair.

Note that as soon as you begin typing, the cursor turns into either a pair of editing lines or a text insertion point.


TEXT INSERTION POINT

Where can it appear?

How do you make it appear?

How do you move it around?

What's it for?


The text insertion point can exist only in a text region.


Start with a crosshair, and choose Text Region from the Insert menu.


Move the text insertion point by

using any of the arrow keys, or

clicking the mouse in text


Use it to insert and delete characters the same way you would in a typical word processor.

The next character you type will appear at the insertion point. Pressing BkSp or Del deletes the character to the left or right of the insertion point.


EDITING LINES

Where can they appear?

How do you make them appear?

How do you move them around?

What are they for?


Editing lines can appear only in a math expression.


Click anywhere in a math expression.


Use the arrow keys to move the editing lines in the direction indicated by the arrow.

To change what's enclosed between the editing lines:

Press Space to cycle through the various parts of the expression that could go between the editing lines given their current location.

If no step in the cycle encloses the right part of the expression, click on a name or number elsewhere in the expression and try it again. Each starting location for the editing lines spawns a whole new cycle in which the intermediate states enclose different parts of the expression.


Use the editing lines to select parts of your math expression. Putting part of an expression between the editing lines is just like enclosing it in a pair of invisible parentheses.


Related Topics:

Crosshair

Editing lines

Text insertion point

Pointers

Cursors (generally)


USING THE SPACEBAR

Use the Space key to select different parts of a math expression. What you select will depend on where the editing lines are to begin with. For example:


Using The Spacebar

Use the Space key to select different parts of a math expression. What you select will depend on where the editing lines are to begin with. For example:


Editing an expression (generally)
EDITING AN EXPRESSION

Editing an expression involves two steps:

Putting the right part of the expression between the editing lines.

Pressing the correct key.

The meaning of each keystroke depends on what's between the editing lines. Click on any of the expressions below to see what the most common editing keystrokes will do when the editing lines are in the position shown.


Click on any of the buttons below to see what happens to the expression and why it happens that way.


Pressing the up arrow makes the editing lines go up.


Since the editing lines can't go down any further, they leave the expression altogether and turn into a crosshair just below the expression.


The insertion line moves to whatever is to the right.


The insertion line moves to the left.


This deletes whatever is immediately to the right of the insertion line. In this case, it deletes the exponent operator.


This deletes whatever is immediately to the left of the insertion line, in this case, the variable "b." The black rectangle is a placeholderto show you where to type something to make exponentiation work correctly.


Pressing Space lengthens the editing lines so that more of the expression fits between them.


Pressing Ins moves the insertion line all the way to the other side. The Ins key toggles the insertion line from one side to the other.


The general rule is that whatever is between the editing lines becomes the first operand of the next operator you type.

In this example, the operator you typed is "plus". The editing lines held the "b." That's why the "b" became the first operand of the "plus".


The general rule is that whatever is between the editing lines becomes the operand of the next operator you type.

In this example, the operator is "square root" and the editing lines held the "b." That's why the "b" went inside the square root.


Click on any of the buttons below to see what happens to the expression and why it happens that way.


Pressing the up arrow makes the editing lines go up.


Since the editing lines can't go down any further, they just leave the expression and turn into a crosshair just below the expression.


Since there is nothing to the right of the insertion line, pressing the right arrow makes the editing lines leave the expression altogether. The editing lines turn into a crosshair to the right of the expression.


Since the "c" is just to the left of the insertion line, pressing the left arrow makes the editing lines select just the "c".


Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.


BkSp will generally delete whatever is to the left of the insertion line. When the expression to be deleted is something more complicated than a name or number however, pressing BkSp highlights it as shown. Pressing BkSp again will then delete it. This makes it harder to accidentally delete an expression.


Pressing Space lengthens the editing lines so that they now enclose the entire denominator.


The Ins key moves the insertion line to the other side. This key toggles the insertion line from one side to the other.


The general rule is that whatever is between the editing lines becomes the first operand of the next operator you type.

In this example, the operator is "plus" and the insertion point held the entire expression "b to the c" That's why the entire expression "b to the c" became the first operand of the "plus".


The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operand of the next operator you type.

In this example, the operator is "square root" and the insertion point held the entire expression "b to the c" That's why the entire expression "b to the c" went inside the square root.


Click on any of the buttons below to see what happens to the expression and why it happens that way.


Pressing the up arrow makes the insertion point go up.


Pressing the down arrow makes the insertion point go down. Since the insertion point is up in the exponent, "down" means down away from the exponent and around the "b".


Since there is nothing to the right, of the insertion point, pressing the right arrow makes the insertion point leave the expression altogether. The insertion point turns into a crosshair to the right of the expression.


When the insertion point is in a variable name, pressing the left arrow moves it one character to the left.


Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.


BkSp will deletes whatever is to the left of the insertion line.


Pressing Space lengthens the editing lines so that they now enclose the next larger expression, in this case, "b to the c."


This moves the insertion line to the other side. The Ins key toggles the insertion line from one side to the other. Note that since the variable name is only one character long, this ends up having the same effect as the left arrow.


The general rule is that whatever is between the editing lines becomes the first operand of the next operator you type.

In this example, the operator is "plus" and the insertion point held just the c. That's why the c becomes the first operand of the plus. Note the placeholder waiting for you to supply the second operand of the plus.


The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operand of the next operator you type.

In this example, the operator is "square root" and the insertion point held just the "c". That's why the "c" goes inside the square root.


Click on any of the buttons below to see what happens to the expression and why it happens that way.


Pressing the up arrow makes the insertion point go up.


Pressing the down arrow makes the insertion point go down. Since the insertion point is as far down as it can go, it turns into a crosshair just below the expression.


Since there is nothing to the right, of the insertion point, pressing the right arrow makes the insertion point leave the expression altogether. The insertion point turns into a crosshair to the right of the expression.


The left arrow moves the insertion line one character to the left. The character immediately to the left is the "c," hence the insertion point now encloses the "c."


Pressing Del will delete whatever is to the right of the insertion line. Since there is nothing there, pressing Del does nothing.


BkSp will generally delete whatever is to the left of the insertion line. When the expression to be deleted is something more complicated than a name or number however, pressing BkSp highlights it as shown. Pressing BkSp again will then delete it. This makes it harder to accidentally delete an expression.


Pressing Space lengthens the editing lines so that they now enclose the next larger expression. Since the editing lines already enclose the entire denominator, the next larger expression has to be the whole fraction.


The Ins key toggles the insertion line from one side to the other. Since the vertical arm was on the right, pressing Ins makes it jump to the left.


The general rule is that whatever is between the editing lines becomes the first operand of the next operator you type.

In this example, the operator is "plus" and the insertion point held the entire denominator. That's why the entire denominator becomes the first operand of the plus. Note the placeholderwaiting for you to supply the second operand of the plus.


The general rule is that whatever is between the editing lines becomes the first (and in this case the only) operand of the next operator you type.

In this example, the operator is "square root" and the insertion point held the entire denominator. As a result, the entire denominator becomes an operand of the square root. This causes it to go inside the square root as shown.


CHANGING A NAME OR NUMBER

There are two ways to do this. If you have just a few characters to change...

Click in the name or number. Use the left or right arrow keys to move the insertion line if necessary.

Type letters and numbers. To delete a character just behind the insertion line, press BkSp.

...or if you prefer to just start over:

Click in the name or number. If necessary, press Space to enclose the entire name or number between the editing lines.

Choose Cut from the Edit menu. This deletes the name or number and leaves behind a placeholder.

Click in the placeholder and type the new name or number.


INSERTING AN OPERATOR

To insert an operator, remember that whatever is between editing lines becomes the first operand of the next operator you type. So to insert an operator:

Place whatever you want the first operand to be between the editing lines. Press Space if necessary to lengthen the editing lines.

Type the keystroke for the operator.

To insert an operator before the selected expression, press Ins before typing the operator.


Related Topics:

Inserting an operator

Deleting an operator

Deleting a minus sign

Deleting parentheses

Inserting a minus sign

Inserting parentheses

Applying a function to an expression


DELETING AN OPERATOR

To delete an operator:

Place the insertion line to the right of the operator you want to delete.

Press BkSp.

For more complicated expressions, this replaces the operator you delete with an implied multiplication.


INSERTING A MINUS SIGN

The procedure below inserts the minus sign that negates a number.

Click in the expression and press Space if necessary to place it between editing lines.

Press Ins to put the vertical arm on the left side.

Press the minus sign.


DELETING A MINUS SIGN

The procedure below deletes the minus sign that negates a number.

Click in the expression and press Space if necessary to place it between the editing lines.

Press Ins to move the insertion line to the left.

Press BkSp.


There are really two kinds of minus sign. This one refers to the one in an expression like:

"−1" or "−(x + z)"

The other kind of minus sign is the one you see between numbers like:

"(x − z)"

You delete this kind of minus sign the same way you delete a plus sign.


APPLYING A FUNCTION TO AN EXPRESSION

Use the following procedure when you want to make an expression the argument to a function.

Click in the expression and press Space until the entire expression is between the editing lines.

Press the apostrophe (') to place parentheses around the expression.

Press Space to enclose the parentheses between the editing lines.

Press Ins to move the vertical arm to the left.

Type the function name.


DELETING PARENTHESES

To delete a pair of parentheses:

Move the insertion point to the right of the "(".

Press BkSp.

You cannot delete one parenthesis at a time. Whenever you delete one, you automatically delete the other.


INSERTING PARENTHESES

It's usually much easier to insert a pair of parentheses using the following procedure:

Enclose the expression between the editing lines

Press the apostrophe (') to insert parentheses.

This is much easier than trying to insert parentheses one at a time as you would with a word processor.


MOVING PARTS OF AN EXPRESSION

Use the following procedure to move part of an expression to either an empty placeholder or to a blank space in your worksheet.

Place the expression you want to move between the editing lines.

Choose Cut or Copy from the Edit menu.

Click on an empty space or on the placeholder into which you want to paste the selected expression.

Choose Paste from the Edit menu paste the expression.


DELETING PARTS OF AN EXPRESSION

Use the following procedure to delete part of an expression.

Place the expression you want to delete between the editing lines.

Choose Cut from the Edit menu. This leaves behind an empty placeholder.


Related Topics:

Moving parts of an expression

Moving the entire expression

Deleting parts of an expression

Deleting the entire expression


EQUALS SIGNS

There are two fundamentally different types of equal sign. These are:

The evaluation equals sign

The assignment equals sign

Note that neither of these equal signs really amounts to an assertion that two sides of an expression are equal.


Examples

Displaying the answer

Defining a variable or function


Equal sign for evaluation (=)
EQUAL SIGN FOR EVALUATION

How to type it...

What it does...

Restrictions on left of "="...

Restrictions on right of "="...


Click anywhere in the expression and press =.


Evaluates whatever is on the left of the "=" and displays the answer to the right of the "=".


Restrictions on left side of "="

Any variables or functions you use on the left should have been defined earlier.

For example, if type "x + 1 =" and you haven't defined "x" yet, it will be impossible to give you an answer. When this happens, you'll see an appropriate error message.


Restrictions on right side of "="

You cannot directly edit what appears to the right of the "=". You can, however, change the format or units in which the numbers are displayed.


Equal sign for definition (:=)
EQUAL SIGN FOR DEFINITION

How to type it...

What it does...

Restrictions on left of ":="...

Restrictions on right of ":="...


Click anywhere in the expression and press : (the colon key).


Evaluates whatever is on the right of the ":=" and assigns the result to whatever is on the left of the ":=".


Restrictions on left side of ":="

You cannot put a number or an expression to the left of the ":=".

Whatever is to the left of the ":=" must be a simple variable name, a subscripted variable, a matrix of variable names, or a function name.


Restrictions on right side of ":="

Any variables or functions you use on the right should have been defined earlier.

For example, if type "y := x + 1 =" and you haven't defined "x" yet, it will be impossible to assign any number to y. When this happens, you'll see an appropriate error message.


ENTERING EQUATIONS

To build mathematical expressions in Mathcad, you simply need to position the crosshair in your worksheet and begin typing letters, numbers or operators such as + or - .

When typing letters or numbers, you’ll see them appear surrounded by editing lines which show you which characters are selected. Use Space and the arrow keys to select various parts of an expression.

You can insert operators by clicking on the appropriate button in the operator palettes or by pressing the keystroke for the operator.

Follow these steps to build the expression [image] and see how the numbers, editing lines, and operators work together:

Type a

Type [Shift] 6 which is the keystroke for exponential operator.

Type 2 in the placeholder that appears.

Type the + on your keyboard for the addition operator  and type b in the placeholder.

Press Space twice to make the editing lines hold the entire expression.

Type the + on your keyboard and type y in the placeholder.


Mathcad automatically assembles the various parts that make up an expression using the rules of precedence and some additional rules that simplify entering denominators, exponents, and expressions in radicals. For example, Mathcad places whatever you type beside whatever is enclosed in the editing lines.


An error message is visible only when you click on the offending expression.


Since Mathcad doesn’t process an offending expression, several errors may appear in the worksheet. When the offending expression is a definition, for example, the variable or function it is supposed to define will remain undefined. This can cause any expressions that reference that variable or function to be undefined as well.


If your worksheet contains several expressions with errors, do the following:

Determine which expression with an error is closest to the top of the worksheet. This error is probably the cause of many of the other errors. (If a user-defined function is marked in error, check the function definition to find the actual source of the error.)

Press Shift F1 and click on the error message to find out what might be causing the error. Alternatively, look for the error in the list of errors provided in the Help.

Once you have determined which expression caused the error and why, edit that expression to fix the error. When you click in the expression and begin edting, Mathcad removes the error message. When you click outside the expression, Mathcad recomputes it.


The number of rows and/or columns in these arrays do not match.

You tried to perform a vector or matrix operation on arrays whose sizes are inappropriate. For example, adding two unequal size matrices is illegal. Matrix multiplication requires that the number of columns in the first matrix match the number of rows in the second.


The expression to the left of the equal sign cannot be defined.

Something other than a legally definable expression is on the left side of this definition. You can place any of the following on the left side of a definition:

A variable name.

A variable name with a subscript.

A variable name with a superscript.

An explicit vector or matrix generated by having chosen Matrix from the Insert menu. The vector or matrix can hold variable names or subscripted variable names only.

A function name with arguments: f(x,y).

Any other expression is illegal. If you want to compute a result instead of defining a variable, press the equals sign '=' instead of a colon.


cannot take subscript

You used a subscript on something other than a vector or a matrix.


cannot take superscript

You used a superscript on something other than a vector or a matrix.


Definition stack overflow

This function definition contains too many nested functions.


Can’t find a solution to this system of equations. Try a different guess value or check that a solution really exists.

Sometimes the solver fails to converge on a solution. This happens when the difference between successive apporximations to the solution is greater than TOL and:

 The solver reaches a point where it cannot reduce the error any further.

 The solver reaches a point from which there is no preferred direction. Because of this, the solver has no basis on  which to make further iterations.

 The solver reaches the limit of its acuracy. This often happens if you set TOL to a value below 10^-15.

Make sure there really is a solution. Then try:

 Raising the value of TOL

 Using the minerr function instead of the find function

 A different guess value

 Adding an inequality to avoid an undesirable stopping point.


Can’t raise an expression having units to a complex power.

This expression contains units that have been raised to a complex power. An expression with units can only be raised to a real power.


This function is undefined at one or more of the points you specified.

You attempted to evaluate an operator or a function at an inappropriate value. For example, ln(0) will give this error. So will -3! because factorial is undefined for negative numbers.


Can’t define the same variable more than once in the same expression.

You tried to evaluate the same variable twice in the same definition. For example, if you create a vector on the left side of a := and use the same name in more than one element, you will get this error.


Equation too large

This expression is too complicated to evaluate. Break the equation down into two or more smaller expressions.


Can’t understand this number.

This expression contains a digit or a decimal point where it is not allowed. For example, if you accidentally type .452. you will see this error.


Arguments in function definitions must be names.

The indicated function definition contains an invalid list of arguments. A valid function definition begins like this:

functionname(argument list) := ...

The argument list must be a name or a list of names separated by commas. Any other expression is illegal.

You also see this error message if you create an invalid list in another context, for example, in the list of y-axis expressions for a plot.


Something is wrong with the solve block used to define this function. It may need a guess value.

You see this error if you evaluate a user function that is defined in terms of a solve block with an error in it.

To fix the error, fix the problem in the solve block. If you evaluate the solve block directly, instead of defining a function with it, you will see a more specific error message.


Can’t understand something in this data file. If this file came from a spreadsheet, make sure you saved it as ASCII text only.

The file you are trying to access with READ or READPRN does not have the required format:

The file must be ASCII with spaces or tabs separating the numbers.

All lines in the data file must have the same number of values if you are using READPRN. (Lines containing no values are ignored.)

If the file has the required format and you continue to see this error, try removing any text from the file.


Can’t find the data file you’re trying to use.

The function READ, READPRN, READRGB, APPEND, or APPENDPRN could not find the file you specified as the argument to that function.

Make sure you typed the argument as a string. You may need to enter the entire pathname to the data file.


Can’t perform this operation on the entire array at once. Try using “vectorize” to perform it element by element.

One of the functions or operators in this expression has received a vector or matrix when it was expecting a scalar.

For example, you see this message if you try to divide one vector by another.

If you want to apply a function or operator to every element in a vector or matrix, use the vectorize operator.


Illegal context. Press F1 for help.

The most common causes of this error message are:

You entered a semicolon somewhere other than in a legal range definition. (The semicolon appears as two dots.)

You used a WRITE or APPEND function anywhere other than on the left side of a definition. These functions should not be on the right side of a definition.

You used an existing function name as a variable name or an existing variable name as a function name.

You used a [image] in a solve block.

You opened a worksheet that makes use of certain advanced features not available in this application.


The unit placeholder can only have real, non-zero scalars put into it.

You entered an illegal expression in the placeholder at the end of a calculation equation. This placeholder requires real, non-zero, scalar values.


Can’t understand the name of this function. If you’re trying to use multiply, use “*”.

You have:

Used an expression as if it were a function, and

That expression forms an invalid function name.

You would see this error, for example, if you use a number as a function name: 6(x).


Type “ORIGIN=” to see what it’s set to… it should be an integer whose magnitude is less than 16 million. Redefine it if necessary.

You defined ORIGIN to be either non-integer, or an integer whose magnitude is greater than 16,000,000.

Note that the definition itself is not marked by an error message. You'll only see this error message when you actually try to use the illegal ORIGIN with a vector or matrix.


Can’t understand the way this range variable is defined.

You defined a range variable with a range that couldn't be understood. When you define a range, you must use one of the following forms:

Rvar := n1 ..n2 (type Rvar:n1;n2)

Rvar := n1,n2 ..n3 (type Rvar:n1,n2;n3)

You can use at most one comma and one semicolon in the definition of a range for a range variable. If you use the second form, the value of n2 must lie between the values of n1 and n3, but not equal n1.


Type “TOL=” to see what the tolerance is set to… it should be greater than 0 and less than or equal to 1. Redefine it if necessary.

The built-in constant TOL is outside the allowable range.

To fix the error, define TOL with a value

greater than (but not equal to) 0, and...

less than or equal to 1

above the indicated expression.


The units in this expression do not match.

This error message has two likely causes:

You are adding or subtracting two terms with different units.

You have created a matrix in which the elements do not have the same units.

You are trying to solve a system of equations for uknown variables of different units. Here is an example of how to properly do so:


Can’t determine what units the result of this operation should have.

You have raised an expression involving units to a power involving a range variable or a vector. As a result, there is no way to determine the dimensions of the result. If an expression is defined with units, you can raise it only to a fixed real power.


Value of subscript or superscript is too big (or too small) for this array.

This expression uses a subscript or superscript that refers to a nonexistent array element.

The subscript or superscript should not be smaller than the ORIGIN. Type “ORIGIN=” to see what the ORIGIN is set to.


Can only evaluate an nth order derivative when n=0,1..5.

Order is not one of the following numbers: 0,1,2...5. If you want to evaluate a higher order, do so symbolically.


You interrupted calculation. To resume, click here and choose “Calculate” from the “Math” menu.

You pressed [Esc] to halt a calculation. To recalculate the marked equation, put the cursor in the equation and choose Calculate from the Math menu.

If you find yourself frequently interrupting calculations to avoid having to wait for Mathcad to recalculate as you edit your worksheet, you may wish to switch to manual mode.


List too long

You entered too many elements in a list separated by commas. This commonly occurs when you try to plot too many expressions on a plot axis.


There is an extra comma in this expression.

Commas can be used to separate:

the arguments of a function,

the first two elements of a range in the definition of a range variable,

expressions in a plot,

elements in an input table,

subscripts in a matrix.

Any other use of commas will result in this error message. For example, you cannot use commas in a number such as 4,000.  You should simply type 4000.


This expression is incomplete. You must fill in the placeholders.

You have not filled in the indicated placeholders. You should place numbers or expressions in these placeholders.


missing operator

This expression is missing an operator at the indicated location.


Cross product is defined only for vectors having exactly three elements.

The vector cross product is defined only for vectors having three elements.


This array must have more than one row or column.

You performed an operation that requires a matrix. For example, when creating surface plots or contour plots, the array plotted must be a matrix, an array having at least two rows or two columns. Certain built-in functions also require matrix arguments.


This operation can only be performed on an array. It can’t be performed on a number.

You performed an operation that requires an array on a scalar. For example, you see this error if you define a superscripted variable as a scalar. Since a superscripted variable represents a column of a matrix, you must define it as a vector.

For surface plots or contour plots, the array plotted must have at least two rows or two columns.


Can’t have anything with units or dimensions here.

This expression uses units somewhere units are not permitted.

Units are not permitted:

in the arguments of most functions,

in exponents,

in subscripts and superscripts.


Must be increasing

The values in this vector must be in ascending order. Type the name of the vector and press ‘=’ to verify what values are in the vector.

The first argument of lspline, pspline, cspline, linterp, and hist, as well as the second argument of interp, must be a vector whose elements are strictly increasing.


This must be an integer. The expression you used appears to have a fractional part.

This expression contains a non-integer expression where an integer is required.

Some possible places to look are:

Superscripts and subscripts

Arguments to certain functions such as the identity function or the submatrix function.

Note that although you can define range variables with fractional values, you cannot use these as subscripts or superscripts.


Can’t evaluate this function when its argument is zero.

This function is undefined at zero.


Can use only positive values when log axes are used.

This xy plot or polar plot has a logarithmic axis in which either the limits, or some of the values are not positive.

Negative numbers and zero cannot be placed anywhere on a logarithmic axis.


This variable must be a range variable.

This expression requires a range variable.

If the expression contains either a summation or an iterated product, check to see that the index is in fact a range variable. The index is directly under the sigma or pi. It should have been defined in an earlier statement.


This value must be real. Its imaginary part must be zero.

This expression contains an imaginary or complex valued expression somewhere in which it is not allowed.

Examples are subscripts and superscripts, differential equation solvers in Mathcad PLUS, mod, and angle.


Must be square

This error marks a non-square matrix in an operation or function that requires a square matrix, such as determinants, inverse, raising to a power, or the eigenvals and eigenvec functions.


This value must be a vector. It can be neither a matrix nor a scalar.

This error marks a matrix or scalar in an operation that requires a vector (a one-column array), for example, with the vector sum operator.


You have one solve block inside another. Every “Given” must have a matching “Find” or “Minerr”.

You used two "Given"s in a row with no intervening "Find" or "Minerr". A solve block cannot have another solve block inside of it.

As an alternative, you can define a function in terms of one solve block and use it inside another solve block. In many cases, this will have the same effect.


A “Find” or “Minerr” must be preceded by a matching “Given”.

This error marks a "Find" or "Minerr" function with no matching "Given". Each solve block that ends with "Find" or "Minerr" must begin with a region containing only the name "Given".


You are trying to use an array or range as a scalar. Press F1 for help.

You used a vector or ranged expression where a scalar is required.

For example, you see this message if i is a range variable and you try to enter an equation like x := i. You cannot define one range variable in terms of another.

You will also see this message if you try to define a scalar in terms of a range variable. When you want to define a new variable in terms of a range variable, use the range variable as the subscript on the left-hand side of the definition:

When you want to define a new variable in terms of a subscripted variable, use the subscript on the left-hand side of the definition as well:


This must be the name of a function or variable.

You used a number or other combination of symbols where you should have used a name, for example, as the second argument of the root function.


Can’t converge to a solution. The integrand may have a singularity or the integral may not be finite.

Results involving integrals, derivatives, the root, find, or minerr functions require iteration. If after many iterations successive estimates still differ by more than the required tolerance, you'll see this error message.

Try setting TOL to be larger. If you're working with the root, find, or minerr functions try a different guess value as well.


Not enough memory for this operation.

There is not enough memory to complete this computation. Try to free up some memory by making the array or matrix smaller (Mathcad uses approximately 8 bytes of memory per matrix element) or by deleting any large bitmaps, arrays, or matrices. If you are using Windows 3.x, you can also try increasing the amount of virtual memory Windows is using.


Must be 1 multidimensional array.

You entered more than one array in the placeholder of a contour or surface plot. You can only have one array at a time in that placeholder because contour and surface plots can only represent a single surface at a time.


Found a number with a magnitude greater than 10^307 while trying to evaluate this expression.

Because of limitations inherent in representing numbers in a computer, numbers that are too large cannot be represented. When an expression involves such a number, you'll see this error message.

Sometimes, especially in a complicated calculation, an intermediate result will be too large to represent.


Cannot evaluate this accurately at one or more of the values you specified.

These error messages indicate that you tried to evaluate a function for a value beyond the accurate range for the function.

For example, you see this message if you try to evaluate sin(10^100). Since the value of sin(10^100) depends on the ones digit of 10^100, any value that comes back would have no significant digits. Instead of seeing a value of dubious accuracy, you'll see one of these error message.


Found a singularity while evaluating this expression. You may be dividing by zero.

You evaluated a function or performed an operation at an illegal value. For example, you see this error if you divide by zero or if you try to invert a singular matrix.


Stack overflow

This error message most commonly arises when you try to define a function in terms of itself. This results in a recursive function definition with no terminating condition. Use a new function name to avoid this error. For example, f(x):=f(x) + 5 will result in the “stack overflow” error but can be changed to f2(x):=f(x)+2.

As a rule, you should not have the same function name on both sides of a ":=" unless you intend to define the function recursively.


This subscript is too large.

You tried to use a subscript or superscript that exceeds the limit, 8 million.


Symbolic operator only.

You have tried to evaluate an expression numerically when it must be evaluated symbolically.  When using operators such as the indefinite integral and the limit operators, you must select the expression and choose Simplify from the Math menu.


This function needs more arguments.

This expression contains a function with fewer than the required number of arguments.

For built-in functions, press Shift+F1 and click on the function name to see the correct number and types of arguments. For functions you defined, check the definition.


This system of equations has more uknowns than there are equations.

This error marks a solve block   with fewer constraints than variables to be solved. Add dummy constraints or decrease the number of variables to be solved for.


This vector should have more elements.

This error message marks a Fourier transform, cubic spline, or linear interpolation function applied to a vector with too few elements.

Splines and linear interpolation require vectors with at least two elements. Fourier transform functions and their inverses require at least four elements.


too few subscripts

You used one subscript on a matrix. You must use two subscripts separated by a comma to specify a matrix element.


too large to compute

An expression involving an array could not be evaluated because of insufficient memory. Try to free up some memory by making the array or matrix smaller or by deleting any large bitmaps, arrays, or matrices.


too large to display

You tried to display a vector or matrix bigger than could be displayed. Try breaking it down into pieces before displaying it.


This function has too many arguments.

The indicated expression contains a function with more than the required number of arguments

For built-in functions, press Shift+F1 and click on the function name to see the correct number and types of arguments. For functions you defined, check the definition.


Can’t solve a system having more than fifty equations.

You included more than fifty constraints in a solve block.


too many subscripts

You used two or more subscripts on a vector.


Can’t plot this many points.

You tried to plot more points than could be handled in one plot. Try keeping the number of points below 150,000.


This variable or function is not defined above. (name marked in red)

This variable or function is undefined. To define it, enter the variable or function name, followed by a colon (:) and an expression or number for its definition. Make sure you define the variable or function name above the statements in which you plan to use it.

You also see this message if you use a variable incorrectly in a global definition. If you use a variable on the right side of a global definition, the variable must be globally defined above the definition in which it is used. If you use a locally defined variable or a variable whose global definition is below the place where it is used, the variable will be undefined.

NOTE: An undefined error is often an indication that another equation further up in the worksheet is in error. If this is the case, all expressions that use the expression in error will be displayed in red.


Underflow

Because of limitations inherent in representing numbers in a computer, numbers that are too small cannot be represented. When an expression involves such a number, you'll see this error message.

Sometimes, especially in a complicated calculation, an intermediate result will be too small to represent.


This expression has a “(“ without a matching “)”.

This expression does not contain equal numbers of ('s and )'s.


This vector has the wrong number of elements.

This error marks a Fourier transform function whose argument has the wrong number of elements.

fft requires a vector with 2^n elements.

ifft requires an argument vector with 2^n+1 elements, where n is a whole number greater than 0.

Use cfft and icfft for arrays and vectors of any size.


End of file

You've tried to read more data values from a datafile than there are values in that file. For example, if your datafile has only ten numbers in it, and you type...

i:1;100

x[i:READ(file)

You'll see this message.


Can’t use a range variable in a solve block.

You'll see this message when you use a range variable in an inappropriate place, for example a solve block

If you want to iterate with a solve block, try defining the function in terms of the solve block and using that function for iteration.


Live symbolics not available.

The right arrow is a "symbolic equal sign" and is used for live symbolic evaluation of expressions similar to the live numerical evaluation you see when you use a "=".

Live symbolic evaluation is not available in this particular version of this software.


Can’t put a “:=” inside a solve block. Use the “=” button on the “Inequalities” palette instead.

There should be no assignment statements of any kind inside a solve block. The solve block should contain only Boolean expressions.


(Rows - 1) must be power of 2.

This matrix must have 2^n rows.


Too many iterations.

The function has passed through as many iterations as possible trying to find a solution. If you see this message when using the polyroots function the degree of the polynomial may be quite high. Try solving for the roots symbolically instead.


Degree of the polynomial must be between 1 and 99.

The vector passed to the polyroots function must have at least two elements and no more than ninety-nine.


Dimensions must be >4

This matrix must have at least four rows and columns.


End points cannot be the same.

The endpoints of the interval on which the solution will be evaluated must be different. This message commonly occurs with the differential equation solvers in Mathcad PLUS.


Floating point error.

You are evaluating a function at a point which is not allowed. For example, the fifth argument to the relax function in Mathcad PLUS cannot have zeros in the non-boundary positions of the coefficient matrix.


Illegal dimensions.

This matrix does not have the rows or column you’re referring to. Type the matrix name and press the = sign to verify the number of rows and columns the matrix contains.


Illegal constraint.

You cannot have an inequality inside a symbolic solve block in Mathcad PLUS. Try using a numerical solve block or removing the inequality.


Input must be 1 or 2 dimensional.

The first matrix argument in the cubic spline functions must have either one or two columns. Two columns are necessary for multivariate cubic spline  interpolation.


Integer too large.

This value is too large to work with. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Integer too small.

This value is too small to work with. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Invalid expansion point

Mathcad can’t expand the expression around the point you’ve specified. Make sure you’re using the series keyword for symbolic expansion in Mathcad PLUS correctly.


Invalid format

The arguments to this function may not be correct. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Invalid matrix dimension. The number of rows is less than the number of columns.

The svd function in Mathcad PLUS requires that the argument be an m x n array, where m [image] n.


Loess cannot extrapolate.

You are trying to interpolate on a value larger than the maximum value in your data set. You must interpolate for values that lie strictly between your data points.


Must be <= 10000

This value must be less than or equal to 10000. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be >= 10^-16

This value must be greater than or equal to 10^-16. If you are using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be 1 complex matrix or 2 real matrices.

To create a vector field plot, you must supply either one matrix of complex numbers or two real matrices having the same number of rows and columns.

If you use a complex matrix, it should be one in which:

   The rows and columns represent the x and y coordinates.

   The real part of each matrix element is the x-component of the vector associated with that row and column.

   The imaginary part of each element is the y-component of the vector associated with that row and column.

If you use two m x n matrices of real numbers:

   The first matrix should have the x-components of the vectors.

   The second matrix should have the y-components of the vectors.


Must be integer >=1

This value must be 1 or higher. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be function.

This argument must be a function. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be less than the number of data points.

This argument must be smaller than the number of data points you have. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be odd integer.

This argument must be an odd integer. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be positive.

This value must be positive. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be real scalar.

This value cannot be complex or imaginary. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be real vector.

This vector cannot have complex or imaginary elements. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


This matrix must be square. It should have the same number of rows as columns.

Some of Mathcad’s built-in functions require square matrices. Press Shift+F1 and click on the function name for additional information.


Must have fewer than five factors.

The first argument of the loess function in Mathcad PLUS should be a real matrix having no more than 4 columns, each of which represent the data corresponding to a particular factor.


Must have more than 3 observations.

This function requires a vector having least 4 elements.


 Must have more data points than parameters.

The genfit function in Mathcad PLUS requires that you have more data points than unknown parameters. Click on the function name in your worksheet and press Shift+F1 for additional information about genfit.


Need more data points than parameters.

The regress function requires that the number of data points you have be higher than the order of the polynomial which you are fitting to your data.


No solution found.

Mathcad could not found a solution. If you’re using a built-in function, press Shift+F1 and click on the function name to make sure you are using the function correctly. It is possible, however, that no solution exists.


Non-positive definite matrix.

This matrix must positive definite. A matrix A is positive definite if all its eigenvalues are real, positive numbers.


Number of rows must be a power of 2.

This error marks a wavelet transform function whose argument has the wrong number of elements. Both the wave and the iwave functions in Mathcad PLUS require vectors with 2^n real elements.


Root finder failed.

Results from some differential equation solvers such as sbval (a function which finds missing initial conditions), require iteration. If, after many iterations successive iterations, estimates still differ substantially, you'll see this error message. Try using different guess values.


Singular matrix.

This matrix must be neither singular nor nearly singular. A matrix is singular if its determinant is equal to zero. A matrix is nearly singular if it has a high condition number.


Unequal array dimensions.

This message flags a function or operator that requires two matrices having the same number of rows and columns.


Vector elements cannot all be the same.

The elements in this vector should not all be the same. If you’re using a built-in function, press Shift+F1 and click on the function name to make sure you are using the function correctly.


The matrix dimensions are incompatible.

This message flags a function or operator that requires two matrices having a certain number of rows and columns. If you’re using a built-in function, press Shift+F1 and click on the function name to determine what size matrices are necessary.


Too many integrator steps.

The algorithm for this differential equation solver did not find a solution. Try changing your guess values for the unknown initial conditions. However, there may be no solution for the boundary values you’ve provided.


This operation can only be performed on a number or an array.

The function or operator you are using requires a single constant, a matrix, or a vector.


This operation can only be performed on a function.

This argument must be a function. If you’re using a built-in function, press Shift+F1 and click on the function name for additional information.


Must be a string

The function or operator you are using requires a string argument.


Must have 3 vectors or one matrix

You must specify the names of three vectors separated by commas or one name or a matrix. For example, you must do this when creating a vector field plot.


Must be 1 multidimensional array.

You entered more than one array in the placeholder of a contour or surface plot. You can only have one array at a time in that placeholder because contour and surface plots can only represent a single surface at a time.


No bitmaps were found in the worksheet.

You will see this error if you chose Color / Optimize Palette from the Format menu. This command should be use only when you have bitmaps embedded in a worksheet.


All evaluations resulted in either an error or a complex result.

Mathcad cannot plot any points because there are no real values to plot. This error may appear if there is an error or if all the values are imaginary.


FOURIER TRANSFORMS

Click on function and argument names for more detail:

fft(v)	cfft(A)

ifft(u)	icfft(B)

FFT(v)	CFFT(A)

IFFT(u)	ICFFT(B)

Related Topics:

Frequency axis

Aliasing

Two dimensional fft's

Power and phase spectrum

fft/ifft vs. cfft/icfft


fft's of real data
REAL FOURIER TRANSFORM

fft(v)	Returns the Fourier transform of a vector. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

v must have [image] elements (m>2).

All elements in v are real.

For vectors with complex values or with any number of elements, use cfft instead.

For 2 dimensional Fourier transforms, use cfft instead.


This condition is required because the fft/ifft pair takes advantage of the fact that, for real data, the second half of the transform is just the conjugate of the first. Mathcad discards the second half of the result vector to save time and memory.


This condition is required because the fft/ifft pair uses a highly efficient fast Fourier transform algorithm which requires 2^m elements.


The elements in the vector returned by the fft function correspond to different frequencies. To recover the actual frequency, you must know the sampling frequency of the original signal. If v is an n element vector passed to the fft function, and the sampling frequency is f sub s, the frequency corresponding to c sub k is:

This makes it impossible to detect frequencies above the sampling frequency. This is a limitation not of Mathcad, but of the underlying mathematics itself. In order to correctly recover a signal from the Fourier transform of its samples, you must sample the signal with a frequency of at least twice its bandwidth.


v is a vector having [image] elements (m>2), all of which are real.

For vectors not satisfying these criteria, use cfft instead.


v is a vector having [image] elements (m>2), all of which are real.

For vectors not satisfying these criteria, use CFFT instead.


Inverse fft's of real data
INVERSE FOURIER TRANSFORM OF REAL DATA

ifft(u)	Returns the inverse Fourier transform corresponding to fft. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

u is a vector with [image] elements (m>2).

Use this only when the original data was purely real. If the original data was complex, use icfft instead.


u is a vector having [image] elements where m>2.


fft's of complex data
FOURIER TRANSFORM

cfft(A)	Returns the Fourier transform of a vector or matrix. The result has the same number of rows and columns as A. If A is a vector, the result is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

A can be a vector or a matrix.

If...

A is a vector that has [image] elements (m>2), and...

All elements in the vector are real.

...use fft instead. For such vectors, the second half of the spectrum is the mirror image of the first and need not be computed.

For matrix arguments, cfft returns the two dimensional Fourier transform.


A is a vector or matrix of any size, although the function will work faster when the number of elements in the vector is 2^m. A vector whose length is a large prime number will slow down the Fourier transform algorithm.


Inverse fft's of complex data
INVERSE FOURIER TRANSFORM

icfft(B)	Returns the inverse Fourier transform corresponding to cfft.

Arguments:

B can be a vector or a matrix.


B is a vector or a matrix.


FREQUENCIES CORRESPONDING TO COEFFICIENTS

Both fft and cfft return vectors whose elements are the complex amplitudes of the various frequencies in the original signal.

To recover the actual frequencies, you must know:

The sampling frequency of the original signal.

The number of samples in the original signal.

Given these parameters, the frequency associated with the jth element is given by:


ALIASING

Because the fft is a discrete approximation to a continuous transform, you may encounter misplaced harmonics. This is called aliasing. To avoid aliasing:

Make sure the signal has finite bandwidth.

Make sure the sampling frequency is at least twice the bandwidth (the Nyquist frequency.)


POWER AND PHASE SPECTRUM

The fft and cfft functions return the real and imaginary parts of the Fourier transform. You can recover the power spectrum and phase spectrum from these by using the vectorize operator:

To apply the vectorize operator,

Enclose the entire expression between editing lines.

Press Ctrl+-

The vectorize operator causes the magnitude operator to return the magnitude of every element in v instead of the magnitude of the vector v itself.


Power spectrum

The frequency distribution of power. This is given by:


Phase spectrum

The frequency distribution of phase. This is given by:


Complex vs. Real fft's
fft/ifft vs. cfft/icfft

Use the fft/ifft pair if both of the following statements are true:

The time domain data is real.

The data vector has [image] elements (m>2).

Use the cfft/icfft pair if any of the following statements are true:

The time domain data is complex

The data vector does not have [image] elements

The data is in a matrix, not a vector.

For real data in the time domain, the Fourier transform has conjugate symmetry. Because of this, fft will drop the redundant second half of the result. This is why the vector returned by fft is half the size of the original vector.

The ifft function reconstructs this redundant half. For this reason, you should use fft and ifft together.

The cfft/icfft pair makes no such assumptions about symmetry. Although these functions are not as efficient for real data, they can nevertheless be used.


FFT's of real data (alternate form)
REAL FOURIER TRANSFORM

FFT(v)	Returns the Fourier transform of a vector. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

v must have [image] elements (m>2).

All elements in v are real.

For vectors with complex values or with any number of elements, use CFFT instead.

For 2 dimensional Fourier transforms, use CFFT instead.


Inverse FFT's of real data (alternate form)
INVERSE FOURIER TRANSFORM OF REAL DATA

IFFT(u)	Returns the inverse Fourier transform corresponding to FFT. The result is a [image] element vector whose kth element is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

u is a vector with [image] elements (m>2).

Use this only when the original data was purely real. If the original data was complex, use ICFFT instead.


FFT's of complex data (alternate form)
FOURIER TRANSFORM

CFFT(A)	Returns the Fourier transform of a vector or matrix. The result has the same number of rows and columns as A. If A is a vector, the result is given by:

Where n is the number of elements in v and i is the imaginary unit.

Arguments:

A can be a vector or a matrix.

If...

A is a vector has [image] elements (m>2), and...

All elements in the vector are real.

...use FFT instead. For such vectors, the second half of the spectrum is the mirror image of the first and need not be computed.

For matrix arguments, CFFT returns the two dimensional Fourier transform.


Inverse FFT's of complex data (alternate form)
INVERSE FOURIER TRANSFORM

ICFFT(B)	Returns the inverse Fourier transform corresponding to CFFT.

Arguments:

B can be a vector or a matrix.


MATH STYLES

Each name or number in an equation is assigned a math style, and each tag is assigned a font, size and style. This lets you change the font characteristics of many names at once. Click on one of the following topics to use math font styles in a particular context:

Changing the font for all variables

Changing the font for all constants

Changing the font of a particular variable

Inserting Greek variables


CHANGING THE FONT FOR ALL VARIABLES

To change the font for all variables in the worksheet at once:

Choose Equation from the Format menu.

In the dialog box, make sure the Style Name is "Variables."

Click on "Modify" and choose from among the various font characteristics available.

Click "OK" to assign the font characteristics to all the variables in your worksheet.

You may want to consider changing the font for all constants for aesthetic reasons.

If you want to change the font of a particular variable rather than the font of all variables at once, you must give that variable its own user-defined style.


CHANGING THE FONT FOR ALL CONSTANTS

To change the font for all constants in the worksheet at once:

Choose Equation from the Format menu.

In the dialog box, make sure the Style Name is "Constants."

Click on "Modify" and choose from among the various font characteristics available.

Click "OK" to assign the font characteristics to all the constants in your worksheet.

You may want to consider changing the font for all variables for aesthetic reasons.

If you want to change the font of a particular constant rather than the font of all constants, you must give that constant its own user-defined style.


CHANGING THE FONT OF A PARTICULAR VARIABLE OR CONSTANT

To change the font of a particular variable or constant, you have to change its style. There are two steps to this procedure. The first is required and the second is optional.

Apply a different math style to the selected variable or constant

Change the font properties associated with that math style

Note that variable names are font sensitive. For example, if you have a statement like "x := 1" in your worksheet and you change its tag so that it looks like "x := 1", any x's further down in the worksheet will be undefined. You'll need to retag them to look like "x".


APPLYING A DIFFERENT MATH STYLE

To change the math style associated with a particular name or number:

Click in the name or number.

Choose Equation from the Format menu.

In the dialog box, choose a style from the drop-down list. You'll see several predefined math styles. You can create a new style using the User math styles.

If necessary, alter the font characteristics associated with these styles by clicking on "Modify".

Click "OK" to assign the selected style to the selected name.

Note that variable names are font sensitive. For example, if you have a statement like "x := 1" in your worksheet and you change its style so that it looks like "x := 1", any x's further down in the worksheet will be undefined. You'll need to apply the same style to them so to look like "x".


MODIFYING A MATH STYLE

To edit the font characteristics associated with a particular math style:

Choose Equation from the Format menu.

In the dialog box, choose the style whose properties you want to change. You'll see the name of the selected style in the "Style Name" text box. Unless you want to change the font of all variables or all constants, you should edit User math styles.

Change the style name if necessary by typing it into the "New Style Name" text box. Changing the style names makes it easier to remember what font characteristics are associated with it.

Click the "Modify" button.

In the dialog box, choose from among the available font properties.

When you find a combination of properties you like, click "OK" in the font dialog box and "OK" in the Equation Format dialog box.

Note that changing the characteristics associated with a math style will change the font of all variables or constants having that style.


INSERTING GREEK LETTERS

To insert a Greek letter:

Type the roman equivalent from the chart below.

Make sure the insertion point is directly in front of the letter you want to turn into a Greek letter.

Type Ctrl+G.

Ctrl+G toggles between Greek and roman letters. If you place the insertion point directly in front of a Greek letter and press Ctrl+G, the Greek letter will turn into an equivalent roman letter.


FORMAT BAR

The Format Bar contains scrolling lists and buttons used to specify font characteristics in equations and text. Click on a feature listed below to learn more about how to use that feature in the Format Bar.

Style

Font family

Type size

Bold text

Italicize text

Underline text

Normal text

Subscript text

Superscript text

Left-aligned text

Right-aligned text

Center-aligned text


Style

If your cursor is in a math region, between numbers or variables, this window specifies the math style your cursor is currently on. The math style listed will be a math variable, a math constant, or one of any additional math styles you have defined.

If your cursor is in a text region, this window specifies the text style associated with the text region. The Font Family and Type Size windows will show the specifications for that type of text region.


Font Family

This scrolling list shows the font family name for the text or math region your cursor is currently on.

To specify a new font, scroll through the list of available font family names. Highlight your selection and release the mouse button.


Type Size

This scrolling list shows the type size of the text or math region your cursor is currently on.

To select a new type size, scroll through the list of available type sizes. Highlight your selection and release the mouse button.


Bold text

Click on this button to change all text in that type of region to bold.

Or if you've selected some text, click on this button to change the selected text to bold.


Italicize text

Click on this button to change all text in that type of region to italics.

Or if you've selected some text, click on this button to italicize the selected text.


Underline text

Click on this button to change all text in that type of region to underlined text.

Or if you've selected some text, click on this button to underline the selected text.


Normal text

Click on this button to change selected text to normal text, removing subscripted or superscripted text.


Subscript text

Click on this button to change selected text to subscript.


Superscript text

Click on this button to change selected text to superscript.


Left-aligned text

Click on this button to align all the lines in a text region against the left side of the region.


Right-aligned text

Click on this button to align all the lines in a text region against the right side of the region.


Center-aligned text

Click on this button to center all the lines in a text region.


Highlighting equations
HIGHLIGHTING AN EQUATION

To render an equation more conspicuous by changing the background color underneath it:

Click in the equation

Choose Properties from the Format menu and click on the Display tab. Click “Choose Color” to choose a highlight color other than the default.

Click in the box next to “Highlight Region.”

Click “OK.”

You'll see a box around the equation filled with a color light enough so you can still see the equation itself. This has no effect on the equation other than highlighting it.

To restore the background to its original state, click in the equation, choose Properties from the Format menu and click on the Display tab. Then click in the box next to “Highlight Region.”


CHANGING THE COLOR IN WHICH EQUATIONS ARE HIGHLIGHTED

By default, the background color directly under a highlighted equation is yellow. To change this for all highlighted regions:

Choose Color / Highlight from the Format menu.

Select a color in the resulting dialog box or click "Define Custom Color" to blend your own color.

Note that this will affect all highlighted equations throughout your worksheet. To change the highlight color for just a single equation:

Click in the equation

Choose Properties from the Format menu and click on the Display tab. Click “Choose Color” to choose a highlight color other than the default.

Click “OK.”


PRINTING A HIGHLIGHTED EQUATION

If you print a worksheet containing highlighted equations, the appearance of the highlights will depend on the printer you are using. Some printers will render a color as black, obscuring the highlighted equation. Others will render the same color as the just the right gray so the highlighted equation is not obscured. The color should print in color on a color printer.


Choose a math style from the list. Variables is the style use for all variables in the worksheet. Constants is used for all the numbers in the worksheet. User1, User2, etc. are styles you can modify and apply to particular constants or variables.


Changes the default color for variables and constants.


Type a new name here if you want to change the name of the selected style.


Click here to change the font, style, size, or color of a selected style.


Equation Format Dialog Options


BESSEL FUNCTIONS

J0(x)	Y0(x)

J1(x)	Y1(x)

Jn(m,x)	Yn(m,x)

I0(x)	K0(x)

I1(x)	K1(x)

In(m,x)	Kn(m,x)

Arguments:

x must be a real scalar for I and J.

x must be a positive real scalar for Y and K.

x cannot have units.

m must be an integer between 1 and 100 inclusive.

These functions typically arise as solutions to the wave equation subject to cylindrical boundary conditions.

Bessel functions of the first and second kind (Jn and Yn) are solutions to the differential equation:

Modified bessel functions of the first and second kind are solutions to the slightly different differential equation:

Related Topics:

Arrays as arguments

Numerical issues


Numerical issues involving Bessel functions
Numerical issues

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.


"until" function
FUNCTIONS FOR ITERATION

until(expr1, expr2)	This function allows you to halt an iterative process based on a condition.

Arguments:

expr1 is a test expression (usually involving a single range variable). When this expression becomes negative, the until function halts iteration.

expr2 is the value returned by the until function at each iteration.


Do not use the until function in equations with more than one range variable (for example, multiple summations). Mathcad will halt all iteration on all range variables the first time that the first argument of until is negative. This usually does not produce the desired result.


Be sure the value of the test expression does in fact change somewhere in the iteration. Otherwise, you find yourself in an infinite loop. If this does occur, press Esc to interrupt calculation.


Unit step function
HEAVISIDE STEP FUNCTION

(x)	This returns 0 if x is negative, and 1 otherwise

Arguments:

x must be a real scalar.

Since this function is discontinuous at 0, you should not integrate expressions involving this function over an interval containing 0. Instead, divide the region of integration into two parts, integrate over each separately and add the result.

For the same reason, the derivative of this function is undefined at 0.


KRONECKER DELTA FUNCTION

δ(m,n)	This function returns 1 if m = n. It returns 0 otherwise

Arguments:

Both m and n must be integers without units.

Since this function is discontinuous at 0, you should not integrate expressions involving this function over an interval containing 0. Instead, divide the region of integration into two parts, integrate over each separately and add the result.

For the same reason, the derivative of this function is undefined at 0.


ANTISYMMETRIC TENSOR FUNCTION

ε(i,j,k)	This function returns the completely antisymmetric tensor of rank 3. Result is 0 if any two arguments are the same, 1 for even permutations, −1 for odd permutations.

Arguments:

i, j, and k must be integers between 0 and 2 (or ORIGIN and ORIGIN+2)


Basically, this function determines how many times you have to swap two numbers in order to get back to the sequence [0,1,2] from whatever sequence [i,j,k] you passed to it. If the number of times is even, the function returns 1. If the number of times is odd, the function returns -1.

For example, ε(2,0,1)=1 because to get from [2,0,1] to [0,1,2] you’ll have to swap twice (an even number). On the other hand, ε(0,2,1)=-1 because to get from [0,2,1] to [0,1,2] you only have to swap once (an odd number).


TRIGONOMETRIC FUNCTIONS

sin(z)	cos(z)

tan(z)	csc(z)

sec(z)	cot(z)

Arguments:

z must be in radians.

z must be a scalar (real, complex, or imaginary).

z must be dimensionless.

Related Topics:

Arrays as arguments

Numerical issues

Working with degrees


Complex arguments and results are computed using the identities:


MISCELLANEOUS FUNCTIONS

mod(x, y)

Returns x mod y, the remainder on dividing x by y.

angle(x,y)

Angle from x axis to the point (x,y).


WORKING WITH DEGREES

The trigonometric functions all assume that the argument is in radians. You can define your own trig functions to accept degrees as arguments. The example below illustrates this.

Related Topics:

Converting to degrees


Numerical issues in trigonometric functions

Because the trig functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

Trigonometric functions are especially subject to roundoff error in the following cases:

Large arguments

For real arguments approaching 10**9 in magnitude, these functions begin to lose precision. When this happens, you'll see an error message indicating a loss of precision.

Singularities

The tangent function is undefined at integer multiples of p/2. Arguments near this singularity are subject to precision errors.

Multiples of p

Since the value of p on a computer can only be an approximation of p, sin(p) is very close to, but not exactly 0. Similarly, tan(p/2) is not undefined, but returns a very large number.

If you need more exact values, use symbolic evaluation with a decimal point to force floating point calculations.


INVERSE TRIG FUNCTIONS

asin(z)

acos(z)

atan(z)

Arguments:

z must be a scalar.

z must be dimensionless.

Values returned are angles in radians between 0 and 2p. Values returned are from the principal branch of these functions.

Related Topics:

Arrays as arguments

Numerical issues

Converting to degrees


Converting to degrees

The inverse trigonometric functions and the angle function all return angles in radians. You can use the units placeholder at the end of an equation to convert the result to degrees instead. The example below shows how:


Numerical issues in inverse trig functions
Numerical issues

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.


HYPERBOLIC FUNCTIONS

sinh(z)	cosh(z)

tanh(z)	csch(z)

sech(z)	coth(z)

Arguments:

z must be in radians.

z must be a scalar.

z must be dimensionless.

Related Topics:

Arrays as arguments

Numerical issues

Relation to trig functions

Hyperbolic function definitions


Relationship between trig and hyperbolic functions
Relation to trig functions


Relation to hyperbolic functions
Hyperbolic function definitions


Numerical issues

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

Hyperbolic functions are subject to roundoff error in the following cases:

Large arguments

Small precision errors appear at very large arguments.

Singularities

Both cosh(x) and sinh(x) become unbounded when the argument goes to either + or - infinity.


INVERSE HYPERBOLIC FUNCTIONS

asinh(z)

acosh(z)

atanh(z)

Arguments:

z must be a scalar.

z must be dimensionless

Values returned are from the principal branch of these functions.

Related Topics:

Arrays as arguments

Numerical issues


Numerical issues for inverse hyperbolic functions

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.


Logarithmic and exponential functions
EXPONENTIAL AND LOGARITHMIC FUNCTIONS

exp(z)	The number e raised to the power z.

log(z)	Base 10 log of z.

ln(z)	Natural log (base e) of z.

Arguments:

z must be a scalar (real, complex, or imaginary).

z must be dimensionless.

For log and ln functions, z cannot be zero.

For complex z, the log functions return values from the principal branch of these functions. In other words:

ln(z) = ln(|z|) + i arg(z)

Related Topics:

Arrays as arguments

Numerical issues

Logs to other bases


Complex arguments

Complex arguments to the exponential function are given by:

Complex arguments to the natural log function returns:


Numerical issues

Because functions are evaluated using double precision floating point numbers, roundoff errors will inevitably affect calculations. This is especially true when the function's argument takes on extreme values.

exp and e^x

The exp function uses an algorithm different from simply raising an approximate value for e to a power. For very large or small values in the exponent, the exp function is more robust.

The most accurate values for very large arguments can be found by using symbolic evaluation of exp(x) with a decimal argument for x. For example, exp(300000.)


LOGS TO OTHER BASES

To evaluate logs to an arbitrary base n, define


COMPLEX NUMBER FUNCTIONS

Re(Z)	Real part of Z

Im(Z)	Imaginary part of Z

arg(z)	Argument of z, between -p and p.

Arguments:

Z can be a real or complex scalar or matrix.

z can be a real or complex scalar.

Related Topics:

Arrays as arguments


"if" function
CONDITIONAL BRANCHING

if(cond, tval, fval)	This function returns one of two values depending on the value of a logical condition.

Arguments:

cond is usually an expression involving a logical operator. For example you can use:

 (i < 2)

(x<1)*(x>0)  for an “and” gate

(x>1)+(x<0) for an “or” gate

tval is the value returned when cond is true.

fval is the value returned when cond is false.


TRUNCATION FUNCTIONS

floor(x)	greatest integer [image] x

ceil(x)	smallest integer [image] x

Arguments:

x must be real.


MANTISSA OF A NUMBER

To get just the decimal part of a positive number, define:

mantissa(x) := x - floor(x)


ROUNDING A NUMBER

To round a number to the nearest integer, define:

round(x) := if(x - floor(x) < .5,floor(x),ceil(x))


MODULO FUNCTION

mod(x,y)	This function returns the remainder on dividing x by y. Result has same sign as x.

Arguments:

x and y should both be real scalars.

y must be nonzero.


POLAR ANGLE

angle(x,y)	This function returns an angle (in radians) between the positive x-axis, and the point (x,y). The value returned is always between 0 and 2p.

Arguments:

Both x and y must be real.

Related Topics:

Converting to degrees


Insert Function Dialog Options


When you select a function from the list on the left, a description of the function will show here.


Select a function from the list and click this button to insert it (together with placeholders for its arguments) into your worksheet.

To apply a function to an expression you have already entered, surround the expression with the editing lines and then click this button.


Multivalued functions
MULTIVALUED FUNCTIONS AND OPERATORS

As a general rule, when a function or operator is multivalued, Mathcad always returns the principal value. For example, when asked to evaluate the cube root of -1 using the exponentiation operator, Mathcad will return the principal value which is 5 + .866i, despite the fact that we commonly think of the cube root of -1 as being 1.

The single exception to this rule is the nth root operator. This operator always returns a real root whenever one is available.


The value 5 +.866i is the principal value because it makes an angle of only 60 degrees from the positive real axis. The number - 1, on the other hand, is all the way on the other side, 180 degrees from the positive real axis.


Built-in math functions
BUILT-IN FUNCTIONS

You can insert any built-in function from the list below by choosing Function from the Insert menu to open the Insert Function dialog box. Alternatively, you may type the names of the built-in functions exactly as they are shown on the Help pages in which they are described.

Click on a function name or its arguments to get more info...

Bessel

Complex functions

Conditional functions

Curve-fitting functions

Differential equation solvers

Discontinuous functions

Discrete transforms

Distribution functions

Equation solving

Error function

Exponential and logarithmic

File access

Histogram functions

Hyperbolic

Interpolation

Image reading functions

Image writing functions

Inverse hyperbolic

Inverse trig

Miscellaneous functions

Population statistics

Prediction

Regression

Round-off and truncation

Smoothing

Sorting

String functions

Symbolic functions

Trigonometric

Vector and matrix functions


Array functions
VECTOR AND MATRIX FUNCTIONS

Joining arrays

augment(A,B)

stack(A,B)

Unjoins arrays

submatrix(M, ir, jr, ic, jc)

Creating arrays

matrix(m,n,f)

Size of an array

cols(A)

rows(A)

length(v)

last(v)

identity(n)

Extrema of an array

max(A)

min(A)

Special types of matrices

diag(v)

geninv(A)

rref(A)

Special characteristics of a matrix

tr(M)

rank(M)

norm1(M)

norm2(M)

norme(M)

normi(M)

cond1(M)

cond2(M)

conde(M)

condi(M)

Eigenvalues and eigenvectors

eigenvals(M)

eigenvecs(M)

eigenvec(M,z)

genvals(M,N)

genvecs(M,N)

Matrix decomposition

cholesky(M)

qr(A)

lu(M)

svd(A)

svds(A)


Discrete transform functions
DISCRETE TRANSFORMS

fft(v)

Fourier transform of real valued data in vector v.

ifft(u)

Inverse of fft. Returns v if u=fft(v).

cfft(A)

Fourier transform of real or complex valued data in array A.

icfft(B)

Inverse of cfft. Returns A if B=cfft(A).

FFT(v)

Identical to fft(v) except with a different normalizing factor and sign convention.

CFFT(A)

Identical to cfft(v) except with a different normalizing factor and sign convention.

IFFT(u)

Identical to ifft(v) except with a different normalizing factor and sign convention.

ICFFT(B)

Identical to icfft(v) except with a different normalizing factor and sign convention.

wave(v)

Discrete wavelet transform of real-valued data in vector v.

iwave(u)

Inverse of wave. Returns v if u=wave(v).


INTERPOLATION AND PREDICTION FUNCTIONS

linterp(vx, vy, x)

Interpolated value at x when points in vx and vy are connected with straight lines.

lspline(vx, vy)

Cubic spline interpolation with linear end conditions. Returns vs vector for use with interp function below.

pspline(vx, vy)

Cubic spline interpolation with parabolic end conditions. Returns vs vector for use with interp function below.

cspline(vx, vy)

Cubic spline interpolation with cubic end conditions. Returns vs vector for use with interp function below.

interp(vs, vx, vy, x)

Returns interpolated value of x using cubic spline interpolation.

predict(v,m,n)

Returns n predicted values based on m consecutive elements in v.


DISCONTINUOUS OR CONDITIONAL FUNCTIONS

if(cond, tval, fval)

Returns tval if cond is true, otherwise returns fval.

until(expr1, expr2)

Returns expr2 until expr1 is negative.

δ(m, n)

Kronecker delta. Returns 1 if m=n and 0 otherwise.

ε(i,j,k)

Completely antisymmetric tensor function.

φ(x)

Heaviside step function. Returns 0 when x<0 and 1 otherwise.


EIGENVALUES AND EIGENVECTORS

eigenvec(M,z)	Returns an eigenvector associated with eigenvalue z of the matrix M. The eigenvector is normalized to unit length.

eigenvals(M)	Returns a vector whose elements are the eigenvalues of M.

eigenvecs(M)	Returns a matrix containing the normalized eigenvectors corresponding to the eigenvalues of the matrix M. The nth column of the matrix returned is an eigenvector corresponding to the nth eigenvalue returned by eigenvals.

Arguments:

M must be a square matrix.

z should be an eigenvalue of M.

z can be complex.

(eigenvec and eigenvals)

(eigenvecs)

To find generalized eigenvalues and eigenvectors, use genvals and genvecs.


All the functions available to you are listed here. Mathcad’s set of built-in functions can change depending on whether you’ve installed additional function packs or whether you’ve written your own built-in functions.


Mathcad Electronic Books
MATHSOFT'S ELECTRONIC BOOKS

The MathSoft series of Electronic Books and Function Packs contains mathematical and engineering formulas, physical constants, properties of various materials and other useful information you would ordinarily look up in a reference book. A Mathcad Electronic Book is like any book, but it has some features that make it especially useful when you’re working with Mathcad:

Every page is a live Mathcad worksheet so you can change values and calculate results right in the Electronic Book.

You can copy and paste data and formulas from an Electronic Book into your own Mathcad worksheet.

If you double-click on a section title or index entry, the appropriate section will open. You can also browse the book page by page or section by section.

You can search an Electronic Book for all occurrences of a particular word.

You can make changes to an Electronic Book and have the option of saving them.

Electronic Books cover various topics in fields ranging from Electrical Engineering to Image Processing.

To open an Electronic Book:

Choose Open from the File menu.

Set the “Files of Type” box to “Mathcad Electronic Book (*.hbk).”

Browse to find one of the available Electronic Books you have installed, or type the name of a Mathcad Electronic Book.


ADDITIONAL ELECTRONIC BOOKS

MathSoft supports a growing library of Electronic Books.

For more information, or to receive a catalog of our products, contact MathSoft at 1-800-MATHCAD, or email sales-info@mathsoft.com. For the latest product information, visit the MathSoft WWW Home Page at http://www.mathsoft.com.


BROWSING THROUGH AN ELECTRONIC BOOK

There are two ways to move around a Book:

Use the buttons on the Book control palette along the top of the window.

Click on indicated regions with the mouse button. Books contain hypertext links just like this help file. These regions are usually underlined or otherwise marked to suggest their function.


SEARCHING THROUGH AN ELECTRONIC BOOK

You can find information on a topic by clicking on the Start button on the Book's control palette along the top of the window.

You can also search for every occurrence of a text string as follows:

Click the Search button in the control palette along the top of the window.

Type a word in the text box. As you type, the scrolling list displays words that closely match the letters you type.

Click the Search button. Mathcad shows how many occurrences of that word are in the Book, what sections they are in, and how many there are in each section.

To open a section, click on its title in the scrolling list and click on the Goto Section button.

Click the Next button. Mathcad scrolls down until the next occurrence of the string is visible in the Book window. This button grays out when you reach the last occurrence.

Clicking the Previous button scrolls up until the previous occurrence of the string is visible in the Book window. This button grays out when you reach the first occurrence.


COPYING INFORMATION FROM AN ELECTRONIC BOOK

Most regions in a Book can be dragged directly into your worksheet. To do so:

Select the Book region(s) you want to drag.

Move the mouse pointer into one of the regions enclosed by a dashed selection rectangle. The pointer turns from an arrow into a small hand.

Press and hold down the mouse button.

With the mouse button still held down, move the mouse pointer. Outlines of all selected regions will follow your movements.

Drag the outlines into your worksheet.

When the outlines are on the desired spots, let go of the mouse button.


MAKING NOTES IN AN ELECTRONIC BOOK

You can make changes in an Electronic Book just as you can in any Mathcad worksheet. However, any changes you make are lost when you close the book.

To make your changes permanent, choose Annotate Book from the Books context menu. When you do so:

Mathcad creates an extra copy of your Electronic Book in which to save your changes.

Any changes you make are highlighted in a different color.

Once Mathcad creates a copy of your Electronic Book, it opens that copy rather than the original every time you open that Electronic Book.


HIGHLIGHTING YOUR ANNOTATIONS

By default, Mathcad shows any changes you make to your Electronic Book in a different color.

To disable this feature:

Choose Highlight Changes from the Books context menu.

Mathcad removes the checkmark from beside the menu command and displays the changes you've made in the regular text color.

To turn this feature back on:

Choose Highlight Changes from the Books context menu.

Mathcad will place a checkmark beside the menu and display any changes you've made in a different color.


CHANGING THE COLOR OF HIGHLIGHTED EDITS

By default, Mathcad highlights any changes you make to your Electronic Book in a different color.

To specify this color:

Choose Color / Annotation from the Format menu.

Mathcad shows a palette of colors to choose from.


SAVING CHANGES IN YOUR ELECTRONIC BOOK

Whenever you save changes to an Electronic Book, you have the option of:

Saving changes made to the section that's currently open, or ...

Saving all changes you've made, even those made in other sections.

To save only those changes made to the currently open section:

Choose Save Section from the Books context menu.

To save all changes you've made, even those made in other sections:

Choose Save All Changes from the Books context menu.

Once you've saved a change to an Electronic Book section, you'll see an asterisk on the title bar when that section is open.


RESTORING THE ORIGINAL COPY OF YOUR ELECTRONIC BOOK

To replace the currently open section with the original section from the unmarked copy of your Electronic Book:

Choose Restore Section from the Books context menu.

To replace the currently open Electronic Book with the original, unmarked copy of your Electronic Book:

Choose Restore All from the Books context menu.

Note that these will cause you to lose all changes you've ever made to either the currently open section or the currently open Electronic Book.


VIEWING THE ORIGINAL COPY OF YOUR ELECTRONIC BOOK

To temporarily view the currently open section from the unmarked copy of your Electronic Book:

Choose View Original Section from the Books context menu.

To return to viewing the edited copy of the currently open section:

Choose View Edited Section from the Books context menu.

Note that these commands do not make any permanent changes to any Book files on your disk.


The Mathcad Tutorial

An interactive, step-by-step guide to Mathcad's features.


Electronic Book control palette


Start Page

Jumps to Electronic Book's table of contents


Backtrack

Jumps to whichever section was last viewed regardless of its location within the book.


Previous section

Jumps to the beginning of the previous section.


Next Section

Jumps to the beginning of the next section.


History

Shows a listing of all sections you've visited so far and gives you a chance to revisit any one of them by clicking on the list.


Search

Searches the entire book for a particular word or phrase.


Copy

Copies the selected regions to the clipboard. If nothing is selected, this button copies the entire section to the clipboard.


Print

Prints the current section.


Open Book

Shows a listing of available Electronic Books.


Save As

Saves the current section as a worksheet you can open later by choosing Open from the File menu.


Books context menu

To see the Books context menu, click on the open Electronic Book window with the right mouse button.


DELETING A GRAPHICS REGION

To delete a graphics region:

Click on the graphics region. This encloses it in a selection rectangle. You will see three handles.

Choose Cut from the Edit menu. This removes the graphics region from the worksheet and places it on the clipboard.

To delete several graphics regions:

Hold down the Shift key and click on each region you want to select.

Choose Cut from the Edit menu. This removes all selected graphics regions from the worksheet and places them on the clipboard.


SELECTING GRAPHICS REGIONS

To select one graphics region:

Click on the region. This encloses it in a selection rectangle. You will see three handles.

To select multiple graphics regions:

Click the mouse just outside one of the graphics region. This anchors one corner of the selection rectangle.

Press and hold down the mouse button. With the button still held, drag the mouse. A selection rectangle framed by dashed lines emerges from the anchor point.

When the selection rectangle encloses the graphics regions you want to select, release the mouse button. The regions should each be enclosed by a dashed rectangle.

Another way to select multiple graphics regions is to hold down the Ctrl key and click on each region you want to select or use the Shift key to select several regions at a time.


RESIZING A GRAPHICS REGION

To change the length and width of a graphics region:

Click on the graphics region. This encloses it in a selection rectangle. You will see three handles.

Move the pointer to one of the handles at the bottom or right border of the region. It should change to a double-headed arrow.

With the mouse button pressed, move the mouse. The graphics region will be stretched in the direction of motion.

Once the graphics region is the right size, let go of the mouse button.


MOVING A GRAPHICS REGION

You can move a graphics region: by cutting and pasting it to a new spot or by dragging it over:

Cutting and pasting

Select the region(s) you want to move.

Choose Cut from the Edit menu.

Click where you want to move the region(s).

Choose Paste from the Edit menu.

Dragging one region

Select the region by clicking on it.

Move the mouse pointer to one of the borders of the selection rectangle. The pointer turns from an arrow into a small hand.

Press and hold down the mouse button while dragging the mouse. An outline of the region moves with the mouse.

When the outline of the region is where you want it, release the mouse button.

Dragging several regions

Select the regions with the dashed rectangle.

Move the mouse pointer onto the middle of one of the regions. The pointer turns from an arrow into a small hand.

Press and hold down the mouse button while dragging the mouse. An outline of the region moves with the mouse.

When the outline of the region is where you want it, release the mouse button.


Inserting hyperlinks to other worksheets
INSERTING HYPERLINKS

To insert a hyperlink to another worksheet or any file:

Select the region you want to turn into a link. It is recommended that you select text but you can select any region.

Choose Hyperink / New from the Insert menu to display the dialog box.

In the dialog box, click the “Browse” button to locate and select a Mathcad worksheet or another file. Alternatively, you may type the complete path or Internet address (URL) to a worksheet in the empty text box.

Click the box next to “Use relative path for hyperlink” if you want a relative path. Click in the box next to “Display as pop-up” if you want the target worksheet to open in a small pop-up window when you double-click on the region containing the link.

If you want a message to appear on the status line at the bottom of the Mathcad window when the mouse hovers over the region containing the hyperlink, type a message in the text box at the bottom of the Insert Hyperlink dialog box.

Click “OK.”

Once you complete these steps, you'll see that if you selected text to create a link, it is now underlined and bold. This indicates that a link has been created. Any other regions holding a link won’t look any different. Double-clicking on the text or other region will open the linked worksheet.


For example, you would type c:\Program Files\MathSoft\Mathcad\conform.mcd to create a hyperlink to the file conform.mcd located in the Mathcad folder. Or you could type  http://www.mathsoft.com/coeffs.mcd to create a hyperlink to a file located on the World Wide Web.


Relative path

Use a relative path if you want the location of the linked file to be stored relative to the Mathcad worksheet containing the link. This allows the link to be valid even if you move the liked file and the main worksheet, but keep the relative directory structure between the two the same. To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, the path may display as a full path but Mathcad uses a relative path internally. If you move the files, the displayed path will change accordingly.


You can create a hyperlink not only from one Mathcad worksheet to another, but also from a Mathcad worksheet to any other file type such as an AVI file. When you create a hyperlink to a file other than a Mathcad workshet, you do not have the option of displaying such hyperlinked files within a pop-up window in the Mathcad application frame.


DELETING A HYPERLINK

To delete an existing hyperlink:

Click anywhere in the region containing the link.

Choose Hyperlink / Erase from the Insert menu.

If selected text contained the link, you'll see that the text you selected is no longer underlined and bold. This indicate that the link no longer exists.


Hyperlink

A hyperlink is a region or a group of selected text which, when double-clicked on, opens another worksheet or another file.

By default, bold underlined text indicates the presence of a link. If a region other than text is used to create the hyperlink, there will be no indication of the presence of a link. It is therefore recommended that you use selected text to create a hyperlink.


Linked worksheet

This must be a worksheet that already exists. Once the worksheet has been linked to, do not rename it or move elsewhere. If you do, the link will not know where to find it. If you plan to move the Mathcad worksheet containing the link as well as the linked worksheet, make sure you keep the relative directory structure between the two and make sure the link uses a relative path.


Specifies that the linked worksheet should open in its own pop-up window.


This message will appear on the status line when mouse is over hyperlink.


Hyperlinks to worksheets from non-text regions
HYPERLINKS FROM NON-TEXT REGIONS

Although you can create hyperlinks from any region, there are two significant disadvantages to using something other than selected text as a gateway for a link.

When you create a link using text as the gateway, Mathcad automatically makes the font bold and underlined to indicate that a link exists there. No such indication is possible when you use a region other than selected text as the gateway.

The link preempts the normal response to double-clicking. For example, if you choose a plot as a gateway, you will no longer be able to double-click on that plot to open a formatting dialog box.

For these reasons, we recommend that you create hyperlinks using only selected text.


Related Topics:

Creating a hyperlink

Deleting a hyperlink

Inserting a hyperlink

Hyperlinks from non-text regions


FILE ACCESS FUNCTIONS

READ(“file”)

Read a single value from a data file.

READPRN(“file”)

Read an array of values from a data file.

WRITE(“file”)

Write a single value to a data file.

WRITEPRN(“file”)

Write an array of values to a data file.

APPEND(“file”)

Append a single value to an existing data file.

APPENDPRN(“file”)

Append an array of values to an existing data file.


Reading and writing data to a an ASCII data file
READING AND WRITING DATA FROM DISK

Reading and writing files in other directories

Describes how to control which file to read from and which file to write to.

Reading and writing tabular data

Describes how to use the READPRN(”file”) and WRITEPRN(”file”) functions to read and write numbers arranged in rows and columns.

Reading and writing lists of numbers

Describes how to use the READ(”file”) and WRITE(”file”) functions to read and write streams of numbers.

Appending existing data to a datafile

Describes how to use the APPEND(”file”) and APPENDPRN(”file”) functions to add data to existing data.

Complex data

Describes how to read and write data with real and imaginary parts.

Controlling how data gets written

Describes how to control the precision you use when you write data to disk and how to control the layout of the ASCII datafile you create.


Structured data file

A file in which the data is arranged in rows and columns separated by spaces and tabs. For example:

2  2  3

2  8  6

3  6  9

A text header is allowed in the beginning of a file. However, once the READPRN function encounters a number, it assumes the data has begun. Because of this, the text header should contain no numbers, i.e. dates etc.

Data files can contain numbers in E format. For example:

16E-2  -16.125E-15  200  50

are all valid numbers in a datafile.

Data may not be hexadecimal, octal or binary.


Unstructured data file

A file consisting of a stream of numbers separated by spaces and/or tabs.

Data files can contain numbers in E format. For example:

  16E-2  -16.125E-15  200 50

are all valid in a datafile.

Data may not be hexadecimal, octal or binary.


READING AND WRITING FILES IN OTHER DIRECTORIES

By default, all the file I/O functions assume that the file is located in the default directory. The argument to a file I/O function is the filename. If the file is in a directory other than the default, the argument should be the full pathname to the file of interest.

For example:

READPRN(“data.prn”) reads in the file data.prn located in the default directory.

READPRN(“c:\mydata\final\output.prn”) reads in the file output.prn located in c:\mydata\final.


File I/O Functions

These are

READPRN	READ

WRITEPRN	WRITE

APPENDPRN	APPEND

Note that the names are in UPPERCASE.


Default extensions

The default extension is 'PRN' for

READPRN

WRITEPRN

APPENDPRN

The default extension is 'DAT' for

READ

WRITE

APPEND


APPENDING DATA TO AN EXISTING FILE

Structured data:

To append structured data to an existing structured data file:

Make sure the number of columns of data to append matches the number of columns in the datafile.

Use the APPENDPRN function as follows:

APPENDPRN(“file”) := A

The APPENDPRN function will append the contents of the array A to the end of the file identified by file.

Unstructured data:

To append a list of numbers to an existing list of numbers stored as an ASCII file, use the APPEND function with a range variable as follows:

i := 1 to N

APPEND(“file”) :=


Reading and writing tabular data to ASCII data files
READING AND WRITING TABULAR DATA

Reading a file from disk

To read an ASCII file consisting of rows and columns, use the READPRN function as follows:

A := READPRN(“file”)

Writing a file to disk

To write an ASCII file consisting of rows and columns, use the WRITEPRN function as follows:

WRITEPRN(“file”) := A

Note that the names of the functions must be in UPPERCASE.


Reading and writing lists of numbers to ASCII data files
READING AND WRITING LISTS OF NUMBERS

Reading a file from disk

To read an ASCII file consisting of a simple list of numbers, use the READ function with a range variable as follows:

i := 1 to N

 := READ(“file”)

Writing a file to disk

To write an ASCII file consisting of a simple list of numbers, use the WRITE function with a range variable as follows:

i := 1 to N

WRITE(“file”) :=


Reading and writing complex data to ASCII data files
READING AND WRITING COMPLEX DATA

It is generally good practice to write the real and imaginary parts of a complex number to separate files.

For example, let Z be a complex matrix. Then

WRITEPRN(“z_real.prn”) := Re(Z)

WRITEPRN(“z_imag.prn”) := Im(Z)

To read the data stored this way, do the following:

Z := READPRN(“z_real.prn”) + 1i * READPRN(“z_imag.prn”)


Controlling how data gets written using file access functions
CONTROLLING HOW DATA GETS WRITTEN

Significant digits:

By default, WRITEPRN writes 4 significant digits to disk. You can change this by changing the value of PRNPRECISION. To do so, choose Options / Built-In Variables tab from the Math menu.

Column width:

By default, WRITEPRN writes data in columns that are 8 digits wide. You can change this by changing the value of PRNCOLWIDTH. To do so, choose Options / Built-In Variables tab from the Math menu.


file

This is the filename of an ASCII file from which READPRN will read data. It is entered as a string.

READPRN assumes that this file is in the default directory. If you want to read from a file located elsewhere, you must type the full pathname to the file of interest.


file

This is the filename of an ASCII file to which WRITEPRN will write data. It is entered as a string.. If such a file already exists, WRITEPRN will overwrite it.

WRITEPRN assumes that this file is in the default directory. If you want to write to a file located elsewhere, you must type the full pathname to the file of interest.


file

This is the filename of an ASCII file to which APPENDPRN will append the data. It is entered as a string. This file should have the same number of rows as the matrix you are appending to it.

APPENDPRN assumes that this file is in the default directory. If you want to append to a file located elsewhere, you must type the full pathname to the file of interest.

Note that the file must already exist for APPENDPRN to work. You cannot use APPENDPRN to create a file. It can only append to an existing file.


file

This is the filename of an ASCII file from which the READ function will read data. It is entered as a string.

The READ function assumes that this file is in the default directory. If you want to read from a file located elsewhere, you must type the full pathname to the file of interest.


file

This is the filename of an ASCII file into which the WRITE function will place the data. It is entered as a string. If such a file already exists, the WRITE function will overwrite it.

The WRITE function assumes that this file is in the default directory. If you want to write to a file located elsewhere, you must type the full pathname to the file of interest.


file

This is the filename of an ASCII file to which the APPEND function will append the data. It is entered as a string

The APPEND function assumes that this file is in the default directory. If you want to append to a file located elsewhere, you must type the full pathname to the file of interest.


READPRN function
READING DATA FROM DISK

READPRN(“file”)	Returns an array containing whatever is in file.

Arguments:

file is either the filename of a structured ASCII file located in the default directory or the full pathname to structured ASCII file.

file is entered as a string.


WRITEPRN function
WRITING DATA TO DISK

WRITEPRN(“file”)	Writes an array to file.

Arguments:

file is either a filename of a file located in the default directory or the full pathname to file.

file is entered as a string.

WRITEPRN arranges the ASCII file in rows and columns like the original matrix. By default, WRITEPRN will write four significant digits in columns eight digits wide. To change this, choose Options / Built-In Variables from the Math menu and change PRNPRECISION and PRNCOLWIDTH.


APPENDPRN function
APPENDING DATA TO AN EXISTING FILE

APPENDPRN(“file”)	Appends an array to file. This file must already exist for APPENDPRN to work. Unlike WRITEPRN, APPENDPRN can not create a file, it can only append to an existing file.

Arguments:

file is either the filename of a structured ASCII file file located in the default directory or the full pathname to structured ASCII file.

file is entered as a string.

The number of columns in file must match the number of columns in the array.

APPENDPRN arranges the ASCII file in rows and columns like the original matrix. By default, APPENDPRN will append four significant digits in columns eight digits wide. To change this, choose Options / Built-In Variables tab from the Math menu and change PRNPRECISION and PRNCOLWIDTH.


READ function
READING FROM A FILE

READ(“file”)	Returns a single entry from file.

Arguments:

file is either the filename of an ASCII file located in the default directory or the full pathname to an ASCII file.

file is entered as a string.

file must contain numbers arranged in columns and separated by tabs or spaces.

READ is usually used in conjunction with a range variable as in:

i := 1 .. N

 := READ(“file.dat”)

This creates an array v containing whatever numbers are in file.dat.

The file being read must be an ASCII file containing a list of decimal numbers separated by tabs or spaces. Exponential notation such as

16E-2-16.125E-15

is permitted.


WRITE function
WRITING FILES TO DISK

WRITE(“file”)	Writes a number to file.

Arguments:

file is either the filename of an ASCII file located in the default directory or the full pathname to an ASCII file.

file is entered as a string.

WRITE is usually used in conjunction with a range variable as in:

i := 1..N

WRITE(“file.dat”) :=

The above example writes the list of numbers in the vector v into file.dat.


APPEND function
APPENDING ONE FILE TO ANOTHER

APPEND(“file”)	Appends a number to file.

Arguments:

file is either the filename of a file located in the default directory or the full pathname to a file.

file is entered as a string.

APPEND is usually used in conjunction with a range variable as in:

i := 1 to N

APPEND(“file.dat”) :=

The above example appends the list of numbers in the vector v to those already in file.dat.

Note that the file must already exist for APPEND to work. You cannot use APPEND to create a file. It can only append to an existing file.


Array to be appended to file.prn.

This array should have as many columns as there are in the file file.prn.


The number of elements in the vector v.


Array into which contents of file are placed.


Array whose contents are to be placed in file.


Related Topics:

File access functions

Reading and writing tabular data

Reading and writing lists of numbers

Reading and writing files in other directories

Appending existing data to a datafile

Complex data

Controlling how data gets written

Other ways to export data

Other ways to Import data


Related functions

READPRN	READ

WRITEPRN	WRITE

APPENDPRN	APPEND


Index of keystrokes
DIRECTORY OF KEYSTROKES

This Help topic lists all the keystrokes by function. If you want to know what a particular keystroke does, you can search for it by pressing the Search button.

Greek letters

Operators

Worksheets and Windows

Editing

Cursor movement

Creating regions


GREEK LETTERS

To type a Greek letter:

Press the Symbol font equivalent from the table below:

Press Ctrl+G


KEYS FOR WORKSHEET AND WINDOW MANAGEMENT

The following keys are used for manipulating windows and worksheets as a whole.

Ctrl+F4	Close worksheet

Ctrl+F6	Make next window active

Ctrl+O	Open worksheet

Alt+F4	Quit

Ctrl+Q	Quit

Ctrl+R	Redraw screen

F1	Open Help window

F5	Open worksheet

F6	Save worksheet

F7	Create new worksheet

F9	Recalculate screen

Shift+F1	Enter or exit context sensitive Help

Esc	Exit context sensitive Help


KEYS FOR EDITING

Enter	Insert blank line

Delete	Delete blank line

Ctrl+F5	Search for string

Shift+F5	Replace string

Alt+BkSp	Undo last edit

Ctrl+C	Copy selection to clipboard

Ctrl+V	Paste clipboard contents into worksheet

Ctrl+X	Cut selection to clipboard

Ctrl+U	Insert unit dialog box

Ctrl+Shift+P	Allows you to insert characters which would otherwise insert operators if typed directly.

Ins	Enter insert mode


ARROW AND MOVEMENT KEYS

In the table below, [image], [image], [image] and [image] refer to the four arrow keys on your keyboard.

In blank space...

In math...

In text...

In blank space...

In math...

In text...

In blank space...

In math...

In text...

In blank space...

In math...

In text...

Shift+	In blank space...

In math...

In text...

Shift+	In blank space...

In math...

In text...

Shift+	In blank space...

In math...

In text...

Shift+	In blank space...

In math...

In text...

Ctrl+	In blank space...

In math...

In text...

Ctrl+	In blank space...

In math...

In text...

Ctrl+	In blank space...

In math...

In text...

Ctrl+	In blank space...

In math...

In text...

Tab	In blank space...

In math...

In text...

Shift+Tab	In blank space...

In math...

In text...

Home	In blank space...

In math...

In text...

End	In blank space...

In math...

In text...

Ctrl+Home	In blank space...

In math...

In text...

Ctrl+End	In blank space...

In math...

In text...

Enter	In blank space...

In math...

In text...

Space	In blank space...

In math...

In text...

PgUp	Moves up about 80% of the window height.

PgDn	Moves down about 80% of the window height.

Shift+PgUp	Moves up to the previous page break.

Shift+PgDn	Moves down to the next page break.


Moves the crosshair up. If another region lies immediately above, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Moves the editing lines up. If they are already at the top of the expression, it jumps out of the math expression altogether and becomes a crosshair in the blank space just above it.


Moves the text insertion point to previous line. If it is already in the first line, it jumps out of text altogether and becomes a crosshair just above it.


Moves the crosshair down one space. If another region lies immediately below, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines..


Moves the editing lines down. If they are already at the bottom of the expression, they jump out of the math expression and into the blank space below it.


Moves the text insertion point to the next line. If it is already on the last line, the insertion point jumps out of the text and into blank space.


Move the crosshair one space to the left. If another region lies immediately to the left, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Moves the insertion line one character to the left. If it's already at the beginning of an expression, the editing lines move out of the expression and turn into a crosshair in the empty space to the left.


Move the insertion point one character to the left. If it's already at the beginning of the text, the insertion point moves out of the text and into the empty space to the left.


Moves the crosshair one space to the right. If another region lies immediately to the right, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Moves the insertion line one character to the right. If it's already at the end of an expression, the editing lines move out of the expression and turn into a crosshair in the empty space to the right.


Moves the insertion point one character to the right. If it's already at the end of the text, the insertion point moves out of the text and turns into a crosshair in the empty space to the right.


Moves the crosshair up. If another region lies immediately above, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Turns the pair of editing lines into a crosshair outside and just above the expression.


Moves the insertion point one line up and selects all text between the old and the new locations of the insertion point.


Moves the crosshair down. If another region lies immediately below, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Turns the pair of editing lines into a crosshair outside and just below the expression.


Moves the insertion point one line down and selects all text between the old and the new locations of the insertion point.


Moves the crosshair one space to the left. If another region lies immediately to the left, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Selects the operand behind the insertion line. If the operand is already selected, this selects the nearest operators to the left as well as its accompanying operand.


Selects the next character to the left of the insertion point.


Move the crosshair one space to the right. If another region lies immediately to the right, the crosshair penetrates that region and turns into either a text insertion point or a pair of editing lines.


Selects the operand to the right of the insertion line. If the operand is already selected, this selects the nearest operators to the right as well as its accompanying operand.


Selects the next character to the right of the insertion point.


Moves crosshair to the right.


Jumps to the next placeholder. If there are no more placeholders, the editing lines jump out of the expression and turn into a crosshair in the empty space to the right.


Inserts a tab.


Inactive in blank space.


Jumps to the previous placeholder. If there are no more placeholders,  the editing lines jump out of the expression and turn into a crosshair in the empty space to the left.


Moves the cursor one space to the right.


Moves the crosshair up one space.


Inactive in math.


Moves the insertion point to the beginning of the current line. If it is already at the beginning, this moves the insertion point to the beginning of the previous line. If it is already at the beginning of the first line, the insertion point jumps out of the text and becomes a crosshair in the empty space just above the text.


Moves the crosshair down one space.


Inactive in equations.


Moves the insertion point to the end of the current line. If it is already at the beginning, this moves the insertion point to the end of the next line. If it is already at the end of the last line, the insertion point jumps out of the text and becomes a crosshair in the empty space just below the text.


Move crosshair one space to the left.


Moves the insertion line to next operand to the left.


Moves the insertion point to the beginning of the previous word. If it is already at the beginning of the text, the insertion point jumps out of the text and turns into a crosshair in the empty space to the left.


Move the crosshair one space to the right.


Moves the insertion line to the next operand to the right.


Moves the insertion point to the end of the next word. If it is already at the end of the text, the insertion point jumps out of the text and turns into a crosshair in the empty space to the right.


Moves the crosshair beside the previous region. If the crosshair is already at the first region, this does nothing.


Moves the editing lines to the beginning of the expression. If the editing lines are already there, this does nothing.


Moves the text insertion point to the beginning of the line. If the insertion point is already there, this does nothing.


Moves the crosshair beside the next region. If the crosshair is already at the last region, this does nothing.


Moves the editing lines to the end of the expression. If the editing lines are already there, this does nothing.


Moves the text insertion point to the end of the line. If the insertion point is already there, this does nothing.


Moves the crosshair beside the first region in the worksheet. If the crosshair is already at the last region, this does nothing.


Moves the  editing lines  to the beginning of the expression. If the editing lines are already there, this does nothing.


Moves the text insertion point to the beginning of the first line of text in the current text region. If the insertion point is already there, this does nothing.


Moves the crosshair beside the last region in the worksheet. If the crosshair is already at the last region, this does nothing.


Moves the editing lines to the end of the expression. If the editing lines are already there, this does nothing.


Moves the text insertion point to the end of the last line of text in the current text region. If the insertion point is already there, this does nothing.


Moves the crosshair one space down and all the way back to the left edge of the worksheet.


Makes the insertion point jump out of the expression and turn into a crosshair in the empty space below.


Starts a new line.


Moves the crosshair one space to the right.


Extends insertion line and the underline so as to enclose more of the expression within them.


Inserts a space.


KEYS FOR CREATING REGIONS

@	Create X-Y plot.

Ctrl+5	Create contour plot.

Ctrl+7	Create polar plot.

Ctrl+2	Create surface plot.

Ctrl+G	Toggle previous character between Greek and roman.

Ctrl+M	Create matrix or vector.

Ctrl+P	Insert Greek letter pi.

Ctrl+Z	Insert infinity symbol.

Ctrl+Shift+O	Create a region within which any expression you type is treated as a single variable name.


Operator keys
KEYS FOR CREATING OPERATORS

The following keys are used to insert operators. With one exception (the " key) they behave the same way in blank space as they do in an equation.

Keystroke	Operator

!	factorial

"	complex conjugate

#	range product

$	range sum

&	integration

'	Matched pair of parentheses

(	Left parenthesis

)	Right parenthesis

*	multiplication or inner (dot) product

+	addition

,	Separates arguments in a function

Separates expressions to be plotted on the same axis

Precedes 2nd number in range

;	Precedes last number in range

−	negation or subtraction

/	division

<	less than

>	greater than

?	differentiation

[	vector subscript or matrix subscript

\	square root

^	exponentiation

|	magnitude or determinant

Ctrl+1	transpose

Ctrl+3	not equal

Ctrl+4	sum of elements in vector

Ctrl+9	less than or equal

Ctrl+0	greater than or equal

Ctrl+8	cross product

Ctrl+−	vectorize

Ctrl+=	equal to

Ctrl+6	superscript

Ctrl+Shift+4	summation

Ctrl+Shift+3	product

Ctrl+Shift+?	nth derivative

Ctrl+\	nth root

Ctrl+Enter	addition with linebreak

Symbolic Operators

Ctrl+I	Indefinite integral

Ctrl+L	Limit

Ctrl+A	Right-hand limit

Ctrl+B	Left-hand limit

Ctrl+Period	Symbolic equal sign

Ctrl+Shift+Period	Keyword symbolic equal sign


SEPARATING OVERLAPPING REGIONS

The regions containing equations and text in your worksheet are bigger than they look. To see how big a region really is:

Choose Regions from the View menu.

If the regions overlap, you can either:

select them and drag them out of the way, or

choose Separate Regions from the Format menu.


SELECTING REGIONS

To select one region:

Click on the region. This encloses it in a selection rectangle. You will see three handles.

To select more than one region:

Click the mouse just outside a corner of the area enclosing the region(s) you want to select.

Press and hold down the mouse button. With the button still held, drag the mouse. Dashed lines will indicate the extent of the selection rectangle.

When the selection rectangle touches all the regions you want to select, let go of the mouse button. All selected regions are enclosed by dashed selection rectangles.

After you’ve selected one ore more regions, you can move or delete them.  You can also change what you’ve selected if necessary.


Adding a region to a selection
ADDING OR REMOVING A REGION FROM A SELECTION

If you want to add or remove a region from a set of regions you've already selected:

Move the pointer over the region.

Press Ctrl and click the mouse.

Do not click the mouse without pressing Ctrl. Doing so will deselect the regions you've already selected.


SELECTING EVERYTHING BETWEEN TWO REGIONS

If you want to select everything between two regions:

Select the first region by clicking on it.

Move the pointer over the last region.

Press Shift and click the mouse button.

Do not click the mouse without pressing Shift. Doing so will deselect the region you've already selected.


DRAGGING REGIONS

Once you've selected one or more regions, you can drag them either to another part of your worksheet or to a different worksheet.

Move the mouse pointer into one of the regions enclosed by a dashed selection rectangle. The pointer turns from an arrow into a small hand.

Press and hold down the mouse button.

With the mouse button still held down, move the mouse pointer. Outlines of all selected regions will follow your movements.

When the outlines are on the desired spots, let go of the mouse button.


DELETING REGIONS

To delete one or more regions:

Select the regions you want to delete by enclosing them in a selection rectangle.

Choose Cut from the Edit menu.


Dragging regions to another worksheet

When dragging regions to another worksheet, drag them decisively. If you linger near the window frame you'll start to autoscroll instead.


INSERTING AND DELETING BLANK LINES

To insert one or more blank lines...

To delete one or more blank lines...


INSERTING A BLANK LINE

To insert a blank line...

Click in a blank space above which you want to insert a blank line. You should see the crosshair.

Press Enter as many times as there are blank lines you want to insert.


DELETING A BLANK LINE

To delete a blank line...

Click in a blank space above the line you want to delete. You should see the crosshair.

Press Del as many times as there are blank lines to delete.


ALIGNING REGIONS

To align regions horizontally...

To align regions vertically...


ALIGNING REGIONS HORIZONTALLY

To align two or more selected regions along a horizontal line midway between the highest and lowest region.

Select the regions you want to align.

Choose Align Regions / Across from the Format menu.

Note that this action makes it possible to inadvertently cause regions to overlap.


ALIGNING REGIONS VERTICALLY

To align two or more selected regions along a vertical line midway between the leftmost and rightmost region.

Select the regions you want to align.

Choose Align Regions / Down from the Format menu.

Note that this action makes it possible to inadvertently cause regions to overlap.


LOCKING AN AREA IN YOUR WORKSHEET

You can designate a portion of your worksheet to be "locked". This prevents anyone from making changes to any of the regions inside the locked area.

To designate what area to lock...

To lock the area...

To unlock the area...

To delete a lockable area…


DESIGNATING AN AREA TO LOCK

To designate an area to lock:

Click in a blank space near the area you want to lock. You should see the crosshair.

 Choose Lock Regions / Set Lock Area from the Format menu. Mathcad inserts two lines as shown:

To designate the upper and lower boundaries of the locked area, select and drag these lines just as you would any other Mathcad region.

You should position the boundaries so that there’s enough space in between them for whatever equations you want to lock. You can have any number of lockable areas in your worksheet. The only restriction is that you cannont have one lockable area inside another.


LOCKING THE AREA YOU'VE DESIGNATED

To lock an area:

Click between the lines designating the boundaries of the area you want to lock.

 Choose Lock Regions / Lock Area from the Format menu. You'll see a dialog box asking you if you want to set a password.

Click "No" if you want to be able to unlock this area without a password.

Click "Yes" and type in the password otherwise.

A worksheet can contain several locked regions, each with its own separate password. If you use a password, make sure you don't forget what it is.


UNLOCKING A LOCKED AREA

To unlock a locked area:

Click between the lines designating the boundaries of the area you want to unlock.

 Choose Lock Regions / Unlock Area from the Format menu. You may see a dialog box prompting you for a password.


Locked area

A locked area is an area enclosed by the two padlocks shown below. You create, lock and unlock such areas by choosing from among the commands under Lock Regions on the Format menu.


DELETING A LOCKABLE AREA

Once you’ve unlocked an area, you may delete it just as you would any other region. To do so:

Select either of the two lines indicating the extent of the lockable area.

 Choose Cut from the Edit menu.


Related Topics:

Designating an area to lock

Locking the area

Unlocking the area

Deleting a lockable area


BOOLEAN OPERATORS

Boolean operators are unlike other operators in that they only return a zero or a one. Despite this, they can be very useful.

greater than	>

less than	<

greater than or equal	Ctrl+0

less than or equal	Ctrl+9

not equal	Ctrl+3

equal	Ctrl+=


Greater than operator
GREATER THAN	Press >

x > y	Returns 1 if x > y, 0 otherwise.

Operands:

x and y must be real scalars.


Less than operator
LESS THAN	Press <

x < y	Returns 1 if x < y, 0 otherwise.

Operands:

x and y must be real scalars.


Greater than or equal to operator
GREATER THAN OR EQUAL TO	Press Ctrl+0

x [image] y	Returns 1 if x [image] y, 0 otherwise.

Operands:

x and y must be real scalars.


Less than or equal to operator
LESS THAN OR EQUAL TO	Press Ctrl+9

x [image] y	Returns 1 if x [image] y, 0 otherwise.

Operands:

x and y must be real scalars.


Equal to operator
EQUAL TO 	Press Ctrl+=

x [image] y	Returns 1 if x = y, 0 otherwise.

Operands:

x and y can be real or complex scalars or arrays.


Not equal to operator
NOT EQUAL TO	Press Ctrl+3

x [image] y	Returns 1 if x [image] y, 0 otherwise.

Operands:

x and y can be real or complex scalars or arrays.


Compatible mail system

An electronic mail program is compatible if it a MAPI-compliant program such as Microsoft Exchange, Microsoft Mail, or Eudora.


MAILING YOUR WORKSHEET

Before you can use this feature, you must be connected to a compatible mail system.

To mail the currently open worksheet:

Choose Send from the File menu.

You'll be prompted for a password if necessary. Then you'll see a dialog box supplied by your mail system.


Edit / Undo

Undoes your most recent edit command or keystroke within a particular region.


Edit / Redo

Undoes your most recent undo.


Edit / Cut

Deletes whatever has been selected and places it on the clipboard.

Note that only the most recently cut selection is on the clipboard.


Edit / Copy

Copies whatever has been selected to the clipboard. Following this command, you should usually choose Paste from the Edit menu.


Edit / Paste

Places whatever is in the clipboard into the worksheet.

This operation does not change the contents of the clipboard.


Edit / Go to Page...

Jumps to a particular page. This command puts the top of the page you jump to at the top of your window.


Edit / Delete

Deletes whatever has been selected but does not place it in the clipboard.


Edit / Paste Special...

Use this instead of Paste to paste whatever is on the clipboard in a format other than the default. For example, to paste a picture taken from an OLE server as a bitmap rather than as an embedded or linked object, choose this from the menu and choose 'bitmap' from the Paste Special dialog box.


Edit / Select All

Encloses all regions in dashed rectangles. You can then cut, copy, or delete these selected regions.


Edit / Find...

Prompts you for a text string. This command moves the cursor to the next (or previous) occurrence of this string.

You can use this command to search for strings in both text and in variable and function names.


Edit / Replace...

Prompts you for two text strings. Enter the string you want to find in the text box labeled “Find.” Enter the string you want to replace it with in the text box labeled “Change to.”  You now have four choices:

“Find Next” - finds and selects the next instance of your target string.

“Change” - replaces the currently selected instance of the string.

“Change & Find Next” - replaces this instance and finds the next one.

“Change All” - replaces all instances without further prompting.


Edit / Check Spelling...

Checks spelling of selected text. If no text is selected, this checks spelling of all text in current text region.

Note that this will check spelling only of text. It will not check spelling in equations.


Edit / Links...

Edits OLE links in the worksheet. Links are created by choosing Object from the Insert menu or by choosing Paste Special from the Edit menu. If there are no linked objects in the worksheet, this option is not available.


Edit / Object

Allows you to edit or open an OLE object inserted into a worksheet. Click once on the object to make this menu item available.


File / New

Opens a dialog box of templates to choose from. Choose Blank Worksheet to create an empty, untitled worksheet.


File / Open...

Displays a scrolling list of worksheets in the current directory. Double-click on the name of the worksheet to open it.

Use the Files of Type box to open a Mathcad template, an electronic book, or another kind of file.


File / Save

If a worksheet is new, this command prompts you for a name. If the worksheet was previously saved, this replaces the copy on disk with whatever is in the window.

Gives you the option to save a file as a Mathcad 7 worksheet, a Mathcad 6 worksheet, a Mathcad 7 template, or in RTF (Rich Text Format).


File / Save As...

Prompts you for a new name under which to save the current worksheet. Gives you the option to save a file as a Mathcad 7 worksheet, a Mathcad 6 worksheet, a Mathcad 7 template, or in RTF(Rich Text Format).


File / Close

Closes the active worksheet.

If any changes have been made since the worksheet was last saved, you'll be asked if you want to save the current worksheet.


File / Collaboratory...

Opens a dialog box you can use for managing files on MathSoft's Collaboratory site on the Internet. Use this dialog box to:

Load a worksheet from the Collaboratory, or

Open a worksheet located on the Internet, or

Save your worksheet in the Collaboratory.


File / Internet Setup...

Opens a dialog box used for setting various protocol options as well as default URLs.


File / Send...

Mails active worksheet using any compatible mail system. You must be connected to a mail server to use this command.


File / Page Setup...

Brings up a dialog box that lets you control:

All four margins.

Whether or not to print regions beyond the right margin.

Paper size, source, and orientation.


File / Print Preview...

Changes the screen to show the current page of your worksheet as it will appear when printed. You can scroll through your worksheet using the “Next Page” and “Prev Page” buttons at the top of screen, or print your worksheet using the “Print” button.


File / Print...

Brings up a dialog box from which you select:

Whether to print the entire worksheet, the current page, or only the regions you have selected.

The page range to print.

If you have selected a plotter as your output device, you will only be able to print one page.

The settings you choose affect only the current print job.


File / Exit

Exits the program.

To close just the worksheet you are working on without exiting the program completely, choose Close from the File menu.


File / Recent Files

Listed at the bottom of the File menu are recently opened worksheets. Clicking on one of the worksheets listed here will open that worksheet.


File / Update

Changes are reflected in the copy of the Mathcad worksheet that is contained in another application. This command is only available when you are editing a Mathcad object that is embedded in another application and you are editing in separate window as opposed to in-place.


File/ Save Copy As

Prompts you for a new name under which to save the current worksheet. Gives you the option to save a file as a Mathcad 7 worksheet, a Mathcad 6 worksheet, a Mathcad 7 template, or in RTF(Rich Text Format). This command is only available when you are editing a Mathcad object that is embedded in another application and you are editing in separate window as opposed to in-place.


File / Close & Return

Closes the active worksheet displaying a Mathcad object. If any changes have been made since the worksheet was last saved, you'll be asked if you want to save the current worksheet. This command is only available when you are editing a Mathcad object that is embedded in another application and you are editing in separate window as opposed to in-place.


New Worksheet

Opens an empty, untitled worksheet based on the Blank Worksheet template.


Format / Paragraph...

Brings up a dialog box where you can change the alignment and indentation for a selected text region.


Format / Separate Regions

Separates any overlapping regions in your worksheet. Note that this command cannot be undone.


Format / Align Regions / Across

Aligns selected regions to a horizontal line midway between the highest and lowest region.

Note that this action makes it possible to inadvertently cause regions to overlap.


Format / Align Regions / Down

Aligns selected regions to a vertical line midway between the rightmost and leftmost region.

Note that this action makes it possible to inadvertently cause regions to overlap.


Format / Headers/Footers...

Brings up a dialog box for defining headers and footers. In addition to just text, headers and footers can have page numbers, the current date and time and the name of the file you're working on.


Format / Graph / X-Y Plot...

Controls the default characteristics of all graphs in the worksheet. Use this to control:

tick marks

gridlines

type of curve (bar, line, etc...)

markers used for each point (+, x, etc...)

color of curve

how thick the line is

legends

type of axis (linear or log)


Format / Graph / Polar Plot...

Controls the default characteristics of all polar plots. Use this to control:

tick marks

gridlines

type of curve (bar, line, etc...)

type of marker on each curve(none, +, etc...)

color of curve

how thick the line is

legends

type of radial axis (linear or log)


Format / Graph / 3D Plot...

Controls the characteristics of the selected 3D plot. Use this to control:

the type of plot: contour, surface, scatter or bar chart

titles

gridlines and numbers on axes

For all but contour and vector field plots, you can control:

viewing angle

vertical scale (how "bumpy" the plot is)

back planes

The remaining plot characteristics are tied to the particular type of 3D plot you're formatting:

type of line used to connect the points (solid, dashed, etc...)

markers used for each point (+, x, etc...)

color and thickness of parametric curves in a scatter plot.

shading of surfaces and contours

how thick the lines or bars are

the layout of bars in a bar chart

the order in which the points are connected in a scatter plot


Format / Graph / Trace...

Allows you to read coordinates directly from the selected plot. This menu item appears only when you have previously clicked in an X-Y or polar plot.


Format / Graph / Zoom...

Allows you to zoom in on the selected plot for a close-up view. This menu item appears only when you have previously clicked in an X-Y or polar plot.


Format / Color / Background...

Brings up a palette of colors for changing the background color of the application window.


Format / Color / Highlight...

Brings up a palette of colors for changing the color used to highlight equations when you choose Format / Properties and click on Highlight Region in the Display tab.


Format / Color / Annotation...

Brings up a palette of colors for setting the color used to highlight any changes you've made to an Electronic Book.


Format / Color / Use Default Palette

A check next to this option tells Mathcad to use a single default 256-color palette to display the contents of the worksheet if your display driver supports 256 colors.

If there is no check next to this option, Mathcad will use whatever color palette is best for each picture in the worksheet. This may cause the screen to flash as you scroll through the worksheet and each 256-color bitmap loads a new palette.


Format / Color / Optimize Palette

Tells Mathcad to optimize its default color palette so that it chooses the best possible 256-color palette to display all bitmaps in the worksheet. Make sure Color / Use Default Palette in the Format menu has a check next to it. Then Mathcad will use the new default palette it generates.


Format / Style

Brings up a dialog box allowing you to create or modify a text style. If you click on a text region and choose this command, the dialog box allows you to apply a text style to the text region.

As an alternative to choosing Style from the Format menu, you can apply a text style to a text region simply by clicking in the text region and choosing a style from the left-most drop-down list in the Format Bar.


Format / Properties

This command brings up a tabbed dialog box where you can:

Highlight a region in a color you choose.

Insert or remove a border around a picture.

Display a picture in its original size.

Turn an equation or other region on or off by clicking the “Disable Equation” button.

Turn Optimization on or off for an equation. Optimization is on for all equations if the Optimize option in the Math menu has a check next to it. Optimization allows the symbolic processor to simplify an expression before the numerical processor evaluates it.


Format / Number...

Controls how a particular numerical result is displayed.

To change the way all numbers are displayed, click in an empty region, choose this, and click on “Set as worksheet default” in the dialog box.

You can control

The number of decimal places displayed.

How big or small a result must be before it's displayed in exponential form.

How small a result must be before it's displayed as zero. (Global only)

How small the real or imaginary part must be before it's suppressed.

Whether to use i or j to display results involving imaginary numbers. (Global only)

Whether the number is hex, octal or decimal.

Whether trailing zeros are used to indicate the precision of the number displayed.

Whether a matrix is displayed as a matrix or in  a scrolling output table.


Format / Equation...

Displays a list of available math styles. A math style is just a shorthand way to refer to a collection of font properties like size, color, font and so on. To change font, click on a name or number, and choose a math style from the list.

To change the font associated with an existing math style, select the style and click “Modify.” Note that when you modify a math style, you change the font of every variable using that style.


Format / Text...

Brings up a dialog box for changing the font, size, color and style of selected text.

This command only affects text. To change fonts in equations, choose Equation from the Format menu.


Format / Lock Regions / Set Lock Area

Inserts two lines indicating the extent of the area to be locked. Specify a horizontal band to lock by selecting and dragging these lines as you would any other region.

Any regions between these two lines will not be editable once you lock this area.


Format / Lock Regions / Lock Area...

Locks the horizontal band between the two lines created by using the Set Lock Area pullright from the Lock Regions command. Click in the area you want to lock before using this command.

You'll be able to lock the area with or without a password. If you choose to use a password, be sure not to forget it.


Format / Lock Regions / Unlock Area...

Unlocks the horizontal band between the two lines created by using the Set Lock Area pullright from the Lock Regions command. Click on one of these lines before using this command.

If the area was locked with a password, you'll be prompted for it.


Properties Dialog Options: Display Tab


Highlights a region with a color when checked.


Selects a highlight color for the selected region when Highlight Region is checked. To choose a highlight color for all the regions in a worksheet, choose Color / Highlight from the Format menu.


Adds or removes a border around a selected picture. or bitmap.


Toggles between showing a picture or bitmap at its original or at its adjusted size.


Properties Dialog Options: Calculation Tab


Turns off a region so that it is not processed.


Turns Optimization on or off for a selected expression. Optimization allows the symbolic processor to simplify an expression before the numerical processor evaluates it.


Help / Mathcad Help

Opens a window containing an index for on-line help.


Help / Using Help...

Opens a window containing instructions for using the Help system.


Help / About Mathcad...

This shows the version number for your copy of Mathcad.


Help / Resource Center...

Opens the Resource Center, a collection of multimedia electronic books containing information on a variety of scientific and technical topics.


Help / Tip of the Day...

Brings up the Tip of the Day dialog box showing one Tip of the Day. Allows you to go through each of the Tips of the Day that are available.

To prevent the Tip of the Day dialog box from appearing when you start Mathcad, click on the Show Tips on Start up box so that the check mark disappears.


Help / Open Book...

Brings up a dialog box. Use the dialog box to browse to an *.hbk file (an electronic book file).


Insert / Reference

Lets you save space in your worksheet by making all variable and function definitions from another worksheet available in your current worksheet.

Brings up a dialog box for you to specify the file to be referenced. Use the “Browse” button to locate a select a worksheet or type the complete pathname or URL then click “OK.” Upon doing so, you'll see an icon marking the spot after which the included definitions will be available.

This command inserts the worksheet reference wherever the cursor is located. To delete a reference to a worksheet, select the icon and choose Delete from the File menu.


Insert / Page Break

Inserts a page break wherever the cursor is located.

To delete a page break, click where the line indicating the page break touches the left edge of your worksheet. Then choose Cut from the Edit menu.


Insert / Hyperlink / New...

Causes a jump to another worksheet or opens a pop-up window when the selected text or region is double-clicked on.

When you select a region and choose this command, Mathcad brings up a dialog box allowing you to specify a Mathcad worksheet to jump or pop-up located on a hard drive or on the Internet. Specify the worksheet you want to jump to by using this dialog box.


Insert / Hyperlink / Erase

Deactivates any link associated with the selection. Once you choose this, double-clicking on the selection will no longer cause a jump or pop-up to another worksheet.


Insert / Hyperlink / Edit

Deactivates any link associated with the selection. Once you choose this, double-clicking on the selection will no longer cause a jump or pop-up to another worksheet.


Insert / Graph / X-Y Plot

Creates a graph with either linear, log, or semilog axes. The plot will contain placeholders for x and y values as well as endpoints of the axes.


Insert / Graph / Polar Plot

Creates a polar plot with placeholders for an angle variable and a radial expression.


Insert / Graph / Surface Plot

Plots the elements of the array you enter in the placeholder. The rows and columns will correspond to the x and y axes. The value of the array element itself represents the height above the xy plane.


Insert / Graph / Contour Plot

Plots the level curves of the elements of a matrix. Enter the matrix in the placeholder. The rows and columns will correspond to the x and y axes.


Insert / Graph / 3D Scatter Plot

Plots an arbitrary collection of points in three dimensions. In the placeholder, type the name of a three-column matrix. Each row in that matrix would contain the x, y and z coordinates of a point to plot.

You can also use this to plot the elements of the array you enter in the placeholder. The rows and columns will correspond to the x and y axes. The value of the array element itself represents the height above the xy plane. No surface will be drawn to connect the points.


Insert / Graph / Vector Field Plot

Creates a two dimensional vector field plot of the matrix you put into the placeholder. The rows and columns of the matrix correspond to the x and y axes. The matrix elements themselves are complex numbers whose real and imaginary parts correspond to the x and y components of a vector associated with a particular value of x and y.


Insert / Graph / 3D Bar Chart

Creates a three-dimensional bar chart of the elements in a matrix. The rows and columns of the matrix correspond to x and y values.


Insert / Picture

Creates a picture region into which you can place a bitmap image in one of three ways:

By typing the name of a Windows bitmap (BMP format) file representing an image in the placeholder.

By typing the name of a matrix into the placeholder. This will show the matrix in up to 256 shades of gray.

By typing into the placeholder the names, separated by commas, of three matrices of the same size, containing the individual red, green, and blue values corresponding to a color image. This will display a color image.


Insert / Matrix...

Brings up a dialog box for creating a vector or matrix wherever the crosshair is located.

If the cursor is in a vector or matrix, choosing this allows you to insert or delete a row or column.


Insert / Unit...

Brings up dialog box with a scrolling list of built-in units.

To express a result in terms of a built-in unit:

Click on the unit placeholder to the right of a result.

Highlight the unit in the scrolling list of units.

Click Insert to insert the unit.


Insert / Function...

Brings up a dialog box with a scrolling list of built-in functions.

To see what a particular function does, click on the function name and read the text that appears in the box on the right.

To insert a built-in function, together with the necessary placeholders:

Highlight the function name in the scrolling list of units.

Click Insert.


Insert / Object...

Brings up dialog box with a list of OLE servers. Use this command to insert an OLE object into your worksheet. You can create a new object or insert one from an existing file. Choose Display as Icon to display an icon in place of the object in your worksheet.


Insert / Text Region

Creates a region of text wherever the crosshair is. The crosshair will change into a thin vertical line. A box appears showing the extent of the text region. This box disappears when you click outside the region.

You can change the width of a text region by selecting it and dragging on the right edge of the selection rectangle with the mouse.


Insert / Math Region

Creates a math region inside text or in a blank spot in your worksheet. You edit this math region just like any other math region.

Math regions in text are live. They can affect and be affected by all other math regions in the worksheet. To disable a math region, use the Properties command in the Format menu.


Insert / Component

Brings up the Insert Component dialog box. Choose a component to insert and click “OK.”

This menu option is available only when you click in a blank spot in the worksheet.


Math / Calculate

Updates all visible plots and numerical results. You'll know the results need updating when you see the word "calc" on the message line at the bottom of the window.

If you want to update all plots and numerical results throughout the worksheet, choose Calculate Worksheet from the Math menu instead.


Math / Calculate Worksheet

Updates all plots and numerical results throughout the worksheet.

If you want to update only the plots and numerical results currently displayed, choose Calculate from the Math menu instead.


Math / Automatic Calculation

Toggles between manual and automatic mode.

If checked, all visible results are automatically updated whenever you make a change in the worksheet.

If unchecked, results aren't updated until you choose Calculate from the Math menu.

When editing a worksheet that involves lengthy calculations, you may find it more efficient to work in manual mode.


Math / Optimization

This menu command turns the optimize feature on and off. When the optimize feature is turned on, you'll see a checkmark beside this command.

When this feature is turned on, the symbolic processor attempts to simplify any expression to the right of a ":=" or a "=". If it succeeds in doing so, it marks the region with an asterisk and evaluates the simpler form instead. To see the simpler form, double-click on the asterisk.

To turn off this feature, choose this menu command again.


Math / Options

Brings up a tabbed dialog box for changing the built-in variables, the unit system being used, and dimension names used for the units being displayed.


Math / Options / Built-In Variables tab

Changes the values of the built-in variables:

TOL

PRNPRECISION

ORIGIN

PRNCOLWIDTH

Seed value for random numbers


Math / Options / Unit System tab

Changes the default system of units. By default, you'll see results displayed in terms of the SI units: m, kg, s, K, A, cd, and mole (for length, mass, time, temperature, current, luminosity, and substance). Use this tab of the Options dialog box to force results to display in terms of units from another unit system.


Math / Options / Dimensions tab

Brings up a dialog box to control whether to display results in terms of the fundamental dimension names rather than in terms of the fundamental units (for example kg, m, sec, etc.).

You can also use this to change the names of the fundamental dimensions themselves.


Menus
MENU COMMANDS

File

Edit

View

Insert

Format

Math

Symbolics

Window

Help


FILE MENU

New

Open

Update

Close

Close & Return

Save

Save As...

Save Copy As...

Collaboratory...

Internet Setup...

Send...

Page Setup...

Print Preview...

Print...

List of Recently Opened Worksheets

Exit


EDIT MENU

Undo

Redo

Cut

Copy

Paste

Paste Special...

Delete

Select All

Find...

Replace...

Go to Page...

Check Spelling...

Links...

Object


INSERT MENU

Graph / X-Y Plot

Graph / Polar Plot

Graph / Surface Plot

Graph / Contour Plot

Graph / 3D Scatter Plot

Graph / 3D Bar Chart

Graph / Vector Field Plot

Matrix...

Function...

Unit...

Picture

Math Region

Text Region

Page Break

Hyperlink / New...

Hyperlink / Erase

Hyperlink / Edit

Reference...

Component...

Object...


VIEW MENU

Toolbar

Format Bar

Math Palette

Regions

Zoom...

Refresh

Animate...

Playback...


FORMAT MENU

Number...

Equation...

Text...

Paragraph...

Style...

Properties...

Graph / X-Y Plot...

Graph / Polar Plot...

Graph / 3D Plot...

Graph / Trace...

Graph / Zoom...

Color / Background...

Color / Highlight...

Color / Annotation...

Color / Use Default Palette

Color / Optimize Palette

Separate Regions

Align Regions / Across

Align Regions / Down

Lock Regions / Set Lock Area

Lock Regions / Lock Area...

Lock Regions / Unlock Area...

Headers/Footers...


MATH MENU

Calculate

Calculate Worksheet

Automatic Calculation

Optimization

Options / Built-In Variables tab

Options / Unit System tab

Options / Dimensions tab


SYMBOLICS MENU

Evaluate / Symbolically

Evaluate / Floating Point...

Evaluate / Complex

Simplify

Expand

Factor

Collect

Polynomial Coefficients

Variable / Solve

Variable / Substitute

Variable / Differentiate

Variable / Integrate

Variable/ Expand to Series...

Variable / Convert to Partial Fraction

Matrix / Transpose

Matrix / Invert

Matrix / Determinant

Transform / Fourier

Transform / Inverse Fourier

Transform / Laplace

Transform / Inverse Laplace

Transform / z

Transform / Inverse z

Evaluation Style...


WINDOW MENU

Cascade

Tile Horizontal

Tile Vertical

Arrange Icons

List of open windows

More windows


HELP MENU

Mathcad Help

Resource Center

Tip of the Day...

Open Book...

Using Help...

About Mathcad...


Symbolics / Evaluate / Symbolically

Carries out symbolic evaluation of definite integrals, derivatives, summations, products, functions and other algebraic and matrix expressions.


Symbolics / Evaluate / Floating Point...

Carries out symbolic evaluation, returning a number as the result whenever possible.


Symbolics / Evaluate / Complex

Carries out symbolic evaluation and returns result in complex form whenever possible.


Symbolics / Simplify

Simplifies the selected expression, performing arithmetic, canceling common factors and using basic trigonometric and inverse function identities.


Symbolics / Expand

Expands all powers and products of sums in the selected expression.


Symbolics / Factor

Factors the selected expression into a product if the entire expression can be written as a product. To factor a subexpression of a larger expression, select the subexpression. Use this command to combine a sum of fractions into a single fraction.


Symbolics / Collect

This collects terms containing like powers of the selected subexpression. The subexpression may be a single variable or a function together with its argument. The result is a polynomial in the selected subexpression.


Symbolics / Polynomial Coefficients

Finds coefficients of an expression when rewritten as a polynomial in a selected subexpression.


Symbolics / Variable / Solve

Finds the value of the selected variable that makes the expression containing it equal to zero.

If you select a variable in an equation or inequality, this command solves the equation or inequality for the selected variable.


Symbolics / Variable / Substitute

Replaces all occurrences of the selected variable with whatever is on the clipboard.

To use this menu command:

Cut or copy the expression you want to replace the variable with.

Click on the variable you want to replace and choose this menu command.


Symbolics / Variable / Differentiate

Differentiates the entire expression with respect to the selected variable. Other variables are treated as constants.


Symbolics / Variable / Integrate

Integrates the entire expression with respect to the selected variable.


Symbolics / Variable / Expand to Series...

Derives a power series for an expression with respect to a variable you select in that expression. A dialog box allows you to choose the order of the series.


Symbolics / Variable / Convert to Partial Fraction

Generates a partial fraction expansion for an expression. If such an expansion is found, the denominators are linear or quadratic in the selected variable.


Symbolics / Matrix / Transpose

Swaps rows and columns of the selected matrix.


Symbolics / Matrix / Invert

Returns inverse of the selected square matrix.


Symbolics / Matrix / Determinant

Returns determinant of the selected square matrix.


Symbolics / Transform / Fourier

Evaluates Fourier transform of an expression with respect to the variable you select within it.


Symbolics / Transform / Inverse Fourier

Evaluates inverse Fourier transform of an expression with respect to the variable you select within it.


Symbolics / Transform / Laplace

Evaluates Laplace transform of an expression with respect to the variable you select within it.


Symbolics / Transform / Inverse Laplace

Evaluates inverse Laplace transform of an expression with respect to the variable you select within it.


Symbolics / Transforms / Z

Evaluates z-transform of an expression with respect to the variable you select within it.


Symbolics / Transform / Inverse Z

Evaluates inverse z-transform of an expression with respect to the variable you select within it.


Symbolics / Evaluation Style...

Controls where symbolic results are placed. Options are:

Place result below selected expression, with or without a commentary.

Place result to the right of the selected expression, with or without a commentary.

Replace the selected expression with the result.


View / Regions

Encloses all regions in boxes so you can see how big they are and where their anchor points fall.

To restore the normal worksheet view, choose this again.


View / Zoom...

Zooms in for a close-up view by making this number larger than 100%.

To bring unseen portions of a worksheet into view or to display an entire worksheet, make this number smaller than 100%.


View / Refresh

Redraws the screen.


View / Animate...

Opens a dialog box for creating an animation. To use it:

Create anything that depends on the FRAME variable. This would generally be an expression or plot involving FRAME.

Choose this menu command.

Drag the mouse to enclose that portion of the worksheet you want to animate.

Set the starting and ending values of FRAME in the dialog box.

Click the "Animate" button.

Once the animation is created, you'll see a new window to be used for playing it back.


View / Playback...

Opens a window for playing existing animation clips.


View / Math Palette

Hides the Math Palette. If the palette is already hidden, this command displays it.


View / Toolbar

Hides the toolbar. If the toolbar is already hidden, this command displays it.


View / Format Bar

Hides the Format Bar. If the font bar is already hidden, this command displays it.


Window / Cascade

Hides inactive worksheet windows behind the active window without obscuring any title bars.


Window / Tile Vertical

Arranges all worksheet windows so that they:

completely cover the application window.

are laid out side by side.


Window / Tile Horizontal

Arranges all worksheet windows so that they:

completely cover the application window.

are laid out one above the other.


Window / Arrange Icons

When you minimize a worksheet, it appears as a small title bar in the lower left corner of the application window. Choose this to arrange all these title bars neatly.


Window / List of open windows

List of the open worksheets. The one with the check next to it is the active worksheet. Click on any of the worksheets listed to make it the active worksheet.


Window / More windows

Brings up a dialog containing a list of all the open worksheets. This menu item is available only when you have more than 10 open worksheets. Click on any of the worksheets listed to make it the active worksheet.


ENTERING VARIABLE AND FUNCTION NAMES

Variable and function names can be any length and can contain a variety of characters. There are, however, some restrictions.

Characters allowed in variable and function names…

Restrictions on variable and function names…


Charatcers allowed in variable and function names
CHARACTERS ALLOWED IN VARIABLE AND FUNCTION NAMES

Variable and function names can consist of:

Upper and lowercase letters

Numbers 0 through 9

The infinity symbol

The prime symbol `

Greek letters

Underscores ( _ )

Percent symbols ( % )

Subscripts


RESTRICTIONS ON VARIABLE AND FUNCTION NAMES

A name cannot start with one of the numbers 0 through 9, an underscore ( _ ), a prime symbol `, or a percent ( % ).

The infinity symbol can only appear as the first character in a name.

All characters in a name must be in the same font, have the same pointsize, and be in the same style.

Mathcad does not distinguish between variable names and function names. Thus, if you define f(x), and later you define the variable f, you will find that you cannot use f(x) anywhere below the definition for f.

Certain names are already used by Mathcad for built-in constants, units, and functions. Although you can redefine these names, keep in mind that their built-in meanings will no longer exist after the definition.

Mathcad distinguishes between uppercase and lowercase letters.

Mathcad distinguishes between names in different fonts.


For example, diam is a different variable from DIAM.


For example, AREA is a different variable than AREA.


For example, if you define a variable mean, Mathcad’s built-in function mean(v) can no longer be used.


Alphabetic characters

Names are case and font sensitive. Names are also size and style sensitive. For example, a bold f and italic f refer to different variables.

Every character in a name must be in the same font. You can, however, mix Greek and roman letters in the same name.


Numbers in variable names

The numbers 0 through 9 can appear anywhere in a name except as the leading character. For example, the name 'x2' is legal, but not the name '2x'.


Infinity symbol

To insert the infinity symbol, type Ctrl+z.


Greek letters

To insert a Greek letter,

Type the appropriate letter from the chart below.

Type Ctrl+G

Alternatively, you may click on the appropriate letter on the Greek letter palette.  The Greek letter p can also be typed by pressing Ctrl p.


Literal subscripts

To type a literal subscript like

Type the first part of the name, the part that comes before 'sub' when you pronounce it out loud (v).

Type a period (v.) The insertion point extends down half a line

Type the second half of the name, the part you want in the subscript (v.init)

Be sure not to confuse literal subscript with array subscripts. Although they appear identical, they are quite different.


Homepage

This is the URL to a webpage maintained by MathSoft and containing worksheets and related documents submitted by users of MathSoft products worldwide.


Related Topics

Using the Collaboratory

Sending a worksheet to the Collaboratory

Sending a file to the Collaboratory

Sending a text message to the Collaboratory

Deleting a topic from the Collaboratory

Internet setup

Connecting to the Internet


USING THE COLLABORATORY

The Collaboratory is a group of World Wide Web forums where you can contribute papers and exchange ideas with other users.

To open a worksheet or other document stored in the Collaboratory:

Choose Collaboratory from the File menu to open the Collaboratory dialog box.

Double-click on the appropriate forum from the list of forums in the upper left corner of the dialog box.

Once you've selected a forum, click on one of the topics shown in the scrolling list at the upper right corner of the dialog box.

You'll see some additional information on that topic in lower half of the dialog box. Examine this information to see if you want to go ahead and open the topic.

Click the "Get" button. Depending on the type of file, one of three things will happen:

if the file is text...

if the file is a worksheet...

if the file is binary...


If the file is text...

You'll see the text in a message box as shown below. Use the "Reply" button to reply to the message.


If the file is a worksheet...

It will appear in its own worksheet window.


If the file is binary...

You'll be prompted for a place to save the file.


SENDING A WORKSHEET TO THE COLLABORATORY

To send a worksheet to the Collaboratory:

Open the worksheet.

Choose Collaboratory from the File menu to open the Collaboratory dialog box.

In the upper left corner of the dialog box is a list of forums. Double-click on the forum to which you want to send your worksheet.

Click the "Send" button to see the Send dialog box.

Click on the "Send my Current File" button.

Enter a title in the Title text box. This is the text that will appear whenever anyone clicks on your worksheet.

Click the "Send" button. You'll see your worksheet appear in the Topics window on the upper right corner of the dialog box.


SENDING A FILE TO THE COLLABORATORY

To send a file to the Collaboratory:

Choose Collaboratory from the File menu to open the Collaboratory dialog box.

In the upper left corner of the dialog box is a list of forums. Double-click on the forum to which you want to send your file.

Click the "Send" button.

Click on the "Send Another File" button.

In the File text box, enter the pathname to the file. Alternatively, you can click the "Browse" button to locate the file.

Enter a title in the Title text box. This is the text that will appear whenever anyone clicks on this file.

Click the "Send" button. You'll see your file appear in the Topics window on the upper right corner of the dialog box.


SENDING A TEXT MESSAGE TO THE COLLABORATORY

To send a text message to the Collaboratory:

Choose Collaboratory from the File menu to open the "Collaboratory" dialog box.

In the upper left corner of the dialog box is a list of forums. Double-click on the forum to which you want to send your text message.

Click the "Send" button to see the Send dialog box.

Click on the "Send a Message" button.

Type your message into the Message text box.

Enter a title in the Title text box. This is the text that will appear whenever anyone clicks on this file.

Click the "Send" button. You'll see your message appear in the Topics window on the upper right corner of the dialog box.


DELETING A TOPIC FROM THE COLLABORATORY

To delete a topic that you sent to the Collaboratory:

Choose Collaboratory from the File menu to open the "Collaboratory" dialog box.

In the upper left corner of the dialog box is a list of forums. Double-click on the forum containing the topic you want to delete.

Once you've selected the forum, click on the topic you want to delete. The topics are in the scrolling list at the upper right corner of the dialog box.

Press Del. You'll see your topic disappear from the Topics window on the upper right corner of the dialog box.


CONNECTING TO THE INTERNET

To connect your computer to the Internet, you must have software that creates a TCP/IP stack on your system. If you don't have such a stack, you may see an error similar to "Cannot find WINSOCK.DLL"

Software for creating such a stack is available from a variety of sources. Contact your Internet access provider or your system administrator for details.


INTERNET SETUP

To set up a proxy server:

Choose Internet Setup from the File menu to see the Internet Setup dialog box.

If you don't have a direct Internet connection, enter a proxy server name for http.

If you intend to use a protocol other than http, enter a proxy server name for each protocol you intend to use.

If necessary, enter the port numbers corresponding to each proxy server. Leave these fields blank to accept the default values.


Collaboratory dialog box


You must specify a proxy server under two conditions:

If you do not have a direct Internet connection, or

if you intend to use a protocol other than http.


Internet setup dialog box


Protocol

The "language" you're going to use for communicating with the outside world. Choices are:

http

ftp

gopher


Proxy server's name

The name of the machine on which the worksheet you want to open is stored.


Pathname

The full pathname to the worksheet you want to open.


Machine name

The name of the machine you're going to use as a proxy for the corresponding protocol.


Port (or socket) number

This is an integer greater than zero specifying the actual port the corresponding proxy server will use to communicate with the outside world.

Leave this blank to accept the default number.


Collaboratory

This is the URL to which you'll be connected upon choosing Collaboratory from the File menu. By default, you'll see a URL to a Collaboratory server maintained by MathSoft. You can upload and download worksheets and other documents to this server by choosing Collaboratory from the File menu.


EMail

This is your E-Mail address.


User Name

This is the name you typed when you first ran the installation program.


Forums

A listing of available forums. Each forum contains one or more topics. Double-click on the forum to display the available topics in the "Topics" scrolling list.


Topics

A listing of all topics contained within the currently selected forum. If a topic is indented, it means it's a reply to the previous topic.


File

This is the filename corresponding to the currently selected topic.


Type

This tells you the file format for the file you've selected.


Date

This is the date on which the currently selected topic was first posted to the Collaboratory.


URL

This is the filename corresponding to the currently selected topic.


Title

This is a description of the selected topic.


From

This is the name you typed when you first ran the installation program.


Get

Click this button to retrieve the selected file. If the file is a worksheet, it will appear in its own worksheet window. If it's text, it will appear in its own text box. If the selected file is in any other format, you'll be prompted for a location in which to save it.


Send

Click this button to post a file to the Collaboratory. You can post:

the active worksheet

a file stored elsewhere on your system.

a text message

Note that this file is always grayed out until you type something in the Title text box.


Reply

Click this button to reply to the current topic.  You can reply by sending:

the active worksheet

a file stored elsewhere on your system.

a text message

Note that this file is always grayed out until you type something in the Title text box.


Refresh

Click this button to redisplay the list of topics and forums.


Close

Click this button to close the dialog box.


From

This is the name you entered when you first ran the installation program.


Title

This is the text that will appear in the Title box whenever anyone clicks on this topic in the Collaboratory dialog box's scrolling list of topics.


Message

This text box appears whenever the "Send a Message" button is filled. Use this to compose text messages before sending them to the Collaboratory.


Date

Today's date based on your system's internal clock.


Send a Message

Click this to send a text message to the Collaboratory.


Send my Current File

Click this to send the active worksheet to the Collaboratory.


Send another File

Click this to send any file to the Collaboratory.


File

Type the complete pathname to the file you want to send to the Collaboratory. If you don't know the pathname, click on the "Browse" button to locate the file.


Browse

Click this to bring up a dialog box you can use to locate a particular file. Once you find the file you are looking for, double-click on it to place its name in the text box to the left.


File

This text box is always grayed out when you have chosen to send the active worksheet. Since you've already identified the worksheet you want to send, there is no need to identify it further using this text box.


Browse

This button is always grayed out when you have chosen to send the active worksheet. Since you've already identified the worksheet you want to send, there is no need to look for it by using this button.


IMPORTING A GRAPHICS IMAGE FROM THE CLIPBOARD

To import a graphics image from another application via the clipboard:

Copy the image to the clipboard.

Click the mouse wherever you want to place the image.

Choose Paste or Paste Special from the Edit menu to paste the image into the worksheet.


IMPORTING GRAPHICS BY DRAGGING AND DROPPING

To import a graphics image directly from another application:

Open the source application.

Arrange Mathcad window and the source application window side by side on the screen.

Select the graphic in the source application.

Hold the mouse button down and drag the cursor to the Mathcad worksheet.

Let go of the mouse button to drop the graphic into the worksheet.


EDITING AN IMPORTED GRAPHICS IMAGE

To edit a graphics image after inserting it into your worksheet:

Double-click on the graphic.

If the graphic is from an application which supports in-place activation, a hatched border surrounds the graphics object and the menus and toolbars change to the source application’s menus and toolbars. If the graphic is from an application that does not support in-place activation, a separate window for editing appears.

Make any necessary edits.


Paste Special Dialog Options


Display As Icon

Displays the object as an icon.


Options available in this list depend on the object you have most recently copied to the clipboard. You may see any of the following choices:

Bitmap

Mathcad

Picture

Rich Text Format

Text

A document from the application in which the object was copied.


Paste Link

Links an object from an OLE server into your worksheet. When you make changes to a linked graphic, you change both the copy in Mathcad as well as the original.

This option is available only when an object was copied from a saved file.


Paste

Embeds an object from an OLE server into your worksheet. When an object is embedded, changes you make to the object will affect only the copy in the Mathcad worksheet. The original object is unchanged.


Links Dialog Options


Update Now

Updates a manual link.


Open Source

Opens the application in which the linked object was created.


Change Source

Links the object with a different source file. The new source file must have been created in the same application as the original source file.


Break Link

Breaks the link between an object’s original source and the copy of the object in the worksheet.


Automatic

The link will update whenever you open the worksheet and any time the source information changes while the worksheet is open.


Manual

The link will update only when you update it by pressing “Update Now.”


EDITING LINKS

Once you’ve linked an object into a worksheet using Insert Object or Paste Special, you can update the link, change it, or eliminate it. To do so:

Choose Links from the Edit menu to bring up the Links dialog box.


Entering and displaying numbers
ENTERING NUMBERS

Mathcad interprets anything beginning with a digit as a number. As a general rule, you enter numbers by simply typing the digits from the keyboard, using a period as the decimal point. Click on any of the following topics to learn about special rules applicable to that topic:

Numbers > 999

Exponential notation

Imaginary numbers

Complex numbers

Numbers to other bases


ENTERING NUMBERS TO OTHER BASES

You can enter numbers in octal or hexadecimal rather in decimal form. Click on the appropriate topic below to learn how to enter a nondecimal number.

Entering hexadecimal numbers

Entering octal numbers

Octal and hexadecimal numbers must be integers. If you attempt to enter one with a decimal point you'll see an appropriate error message.


ENTERING HEXADECIMAL NUMBERS

To enter a hexadecimal number:

If the first digit of the number is one of the letters a through f, you must start that number with a "0". If you don't, whatever you type will be interpreted as a variable and not as a number.

Type the digits making up the number. Valid digits are the numbers 0 through 9 and the letters a through f. Do not type a decimal point.

Type the letter "h" (or "H") immediately following the last digit in the number.

For example:

2ba3ch 	0a32H

Hexadecimal numbers must be integers. If you attempt to enter one with a decimal point you'll see an error message.


ENTERING OCTAL NUMBERS

To enter an octal number:

Type the digits making up the number. Valid digits are the numbers 0 through 7. Do not type a decimal point.

Type the letter "o" (or "O") immediately following the last digit in the number.

For example:

23o 	2O

Octal numbers must be integers. If you attempt to enter one with a decimal point you'll see an error message.


CONTROLLING THE DISPLAY OF ALL RESULTS

To change the default display of all numerical results in a worksheet you need to change the default format for the worksheet. To do so:

Choose Number from the Format menu to see the Number Format dialog box.

Make sure that the button labeled "Set as worksheet default" at the bottom of the dialog box is filled.

To learn about the changes you can make to the display of a number, click on the various fields in the Number Format dialog box.

If you click on the "Set for current region only" button at the bottom of the dialog box, the settings shown in the dialog box will apply only to the currently selected result. If there is no currently selected result, this button will be gray.

Changing the default result format affects only worksheet you were in when you made the change. Any other worksheets that may have been open at the time retain their own default result formats.


CONTROLLING THE DISPLAY OF A PARTICULAR RESULT

To change the display of a particular number you need to change the local format. To do so:

Double-click on the number to see the Number Format dialog box.

Make sure that the button labeled "Set for current region only" at the bottom of the dialog box is filled.

To learn about the changes you can make to the display of a number, click on the various fields in the Number Format dialog box.

If you click on the "Set as worksheet default" button at the bottom of the dialog box, the settings shown in the dialog box will become the default settings throughout the worksheet.


FORMATTING RESULTS

The way Mathcad displays numbers is called the result format. You can control the result format for all the results in a worksheet or for a particular result.

To control the display of all results…

To control the display of a particular result…

The result format affects only the display of a result. Mathcad continues to carry out all calculations in full precision regardless of formatting options.


The result format determines:

The number of decimal places displayed.

How big or small a result must be before it's displayed in exponential form.

How small a result must be before it's displayed as zero. (default formatting option only)

How small the real or imaginary part must be before it's suppressed.

Whether to use i or j to display results involving imaginary numbers. (default formatting option only only)

Whether the number is hex, octal or decimal.

Whether trailing zeros are used to indicate the precision of the number displayed.

Whether a matrix is displayed as a matrix or in  a scrolling output table.


To view a result in full precision as it is stored internally:

Click anywhere in the result.

Press Ctrl+Shift+N.

Mathcad displays the number in full precision on the message line at the bottom of the window.


Imaginary unit

This controls whether computed results having an imaginary part are displayed using 'i' or 'j'.

This setting controls only the display of computed results. You can continue to use either 'i' or 'j' when you enter an imaginary number.

You can set this only when the "Set as worksheet default" option button is clicked in the dialog box.


Radix

Controls whether a number is displayed as octal (base 8), hexadecimal (base 16), or decimal (base 10).

Hexadecimal and octal numbers are followed by the letter "h" or "o" so you can readily distinguish them from decimal numbers. (Mathcad does not reliably show hexadecimal or octal numbers of magnitude greater than 2^31.)

Only decimal numbers are displayed with a decimal point. When you display a result in hexadecimal or octal form, the decimal point and all digits to the right of it are truncated.


Single result or all results

When "Set for current region only" is filled, whatever you specify in this dialog box will apply only to the currently selected result. The "Zero Tolerance" and "Imaginary Unit" groups will be grayed out since these can only be changed for the entire worksheet.

When "Set as worksheet default" is filled, whatever you specify in this dialog box will apply to all results that have not been otherwise formatted.

If there is no currently selected result, the "Set for current region only" button will be gray.


Trailing Zeros

Controls whether trailing zeros are used to display results with as many digits to the right of the decimal point as required by the current choice of Displayed Precision.

For example, if Displayed Precision = 3, then 3/2 will display as:

1.5	if Trailing Zeros is unchecked, and

1.500	if Trailing Zeros is checked.


Display as Matrix

Check this box to display an array having more than nine rows or columns as an array rather than as a scrolling output table. Checking this box does not affect the display of arrays having less than nine rows or columns. By default, this box is unchecked. This means that arrays having more than nine rows or columns will be isplayed as shown below.

A scrolling output table (like the one above) displays a portion of an array. You can look at all the other array elements by either using the scroll bars or by enlarging the table.


Displayed Precision

This setting places an upper limit on the number of displayed decimal digits. This affects only the display. Any calculations will occur with full precision no matter how you decide to display the number.

For example, the number p is displayed as follows:

Displayed	Displayed

Precision	result

0	3

1	3.1

4	3.1416

9	3.141592654

The displayed precision must be between 0 and 15 inclusive. By default, it is set to 3.


Exponential Threshold

This setting controls how large a number's absolute value must be before you start to see it displayed in exponential notation.

Examples:

The exponential threshold must be between 0 and 15 inclusive.

By default the threshold is set to 3. This means that all numbers outside the intervals [.001, 1000] and [-1000,-.001] are shown in exponential notation.


Complex Tolerance

This number controls how much larger the real or imaginary part of a number must be before display of the smaller part is suppressed.

For example, the number 1+0.002i would appear as follows when displayed with different complex tolerance values.

Complex	Displayed

Tolerance	result

2	1

3	1+0.002i

4	1+0.002i

Complex tolerance must be an integer between 0 and 63. By default, it is set to 10. This means that

z is shown as pure real if

z is shown as pure imaginary if


Zero Tolerance

This number controls how close a result must be to zero before it is displayed as zero. For example, the number 0.0001215 displayed with different zero tolerance values appears as follows:

Zero	Displayed

Tolerance	result

2	0

3	0

4	.0001215

5	.0001215

The zero tolerance must be between 0 and 307. By default it is set to 15. This means that numbers smaller than [image] will be displayed as zero.

You can set this only when the ‘Set as worksheet default’ option button is clicked in the dialog box.


VIEWING A NUMERICAL RESULT IN FULL PRECISION

All arithmetic is carried out with full precision regardless of how the number appears in your worksheet. You can display a particular result in full precision either permanently, by changing its format, or temporarily as follows:

Click in the number you want to view in full precision.

Press Ctrl+Shift+N.

You'll see the number, in full precision, in the message line at the bottom of your window.


ENTERING NUMBERS > 999

When entering numbers greater than 999, do not use either a comma or a period to separate digits into groups of three. Simply type the digits one after another.

For example, to enter ten thousand, type"10000". Do not type either "10,000" or "10.000".

A comma is used only in the context of range variables and array subscripts. A period is used only to indicate a decimal point or a literal subscript.


ENTERING NUMBERS IN SCIENTIFIC NOTATION

To enter a number in scientific notation:

Type the number you're going to raise to a power of 10.

Type "*10^".

In the empty placeholder, type the appropriate power of 10.


ENTERING IMAGINARY NUMBERS

To make a number imaginary, type i or j immediately following it. For example,

2i	-33.4j

1i	1j

Note that if you type either i or j by itself, it will be treated as a variable name and not as the imaginary unit. To enter the imaginary numbers i and j in your worksheet, you must type "1i" or "1j". The digit "1" will  disappear as soon as you click outside the number.

Although you can enter imaginary numbers followed by either I or j, Mathcad normally displays them followed by i. To have Mathcad display imaginary number with j, choose Number from the Format menu to see the Number Format dialog box.


ENTERING COMPLEX NUMBERS

To enter a complex number:

Type the real part.

Type "+" (or "-").

Type the imaginary part.

Type i or j. There should be no space between the imaginary part and the i or j.

For example:

1 + 2i 	1 - 33.4j

3 + 1i 	2 - 1j

When using complex numbers, you may find Mathcad’s special functions and operators for working with complex numbers useful.


RESIZING A SCROLLING OUTPUT TABLE

To resize a scrolling output table:

Click on the scrolling output table. You should see a selection box surrounding the table with anchors on the sides.

Move the cursor to an anchor until it changes to a double-headed arrow.

Hold the mouse button down and move the mouse. The scrolling output table will be stretched in the direction of motion.

Once the scrolling table is the right size, let go of the mouse button.


Copying results of calculation (generally)
COPYING RESULTS OF CALCULATION

Copying a numerical result

Copying a matrix

Copying from a table of numbers

Copying from a scrolling table of numbers

Limitations on copying numerical results


COPYING A NUMERICAL RESULT

To copy a single numerical result:

Click on the result. This will place it between the editing lines.

Choose Copy from the Edit menu. This copies the numerical result to the precision displayed.

After copying a numerical result, you can paste it someplace else in your worksheet or into another application.


A numerical result is one that appears to the right of the equals sign "=".


COPYING A MATRIX OF NUMERICAL RESULTS

If the result to the right of an equal sign is a matrix or vector, you must copy the entire matrix or vector at once. To copy only part of it, you must first display it as a scrolling output table.

To copy the entire displayed matrix or vector:

Click on the result. This will place it between the editing lines.

Choose Copy from the Edit menu. This copies the numerical result to the precision displayed.

After copying a matrix or vector, you can paste it someplace else in your worksheet or into most other applications.


You can view the current display settings by double-clicking on the result you want to copy and examining the Number Format dialog box.


COPYING VALUES FROM AN OUTPUT TABLE

It is not possible to copy either one or more numerical results from an output table. You must first redisplay the results as either a matrix or as a scrolling output table.

Select the value or group of values.

Choose Copy from the Edit menu. This copies the numerical result to the precision displayed.


COPYING VALUES FROM A SCROLLING OUTPUT TABLE

To copy one or more values from a scrolling output:

Select the value or group of values.

Choose Copy from the Edit menu. This copies the numerical result to the precision displayed.

After copying one or more values from a scrolling output table, you can paste them into your worksheet or into most other applications.


Selecting a group of values from a scrolling output table

To select all the values in a scrolling output table:

Click in the upper left corner of the table.

To select a section of values from a scrolling output table:

Click on the first number you want to copy.

While holding the mouse button down, drag the mouse in the direction of the other values you want to copy.

To select all the values in a row or column:

Click on the row or column number shown to the left of the row or at the top of the column.

Select adjacent rows or columns by dragging the mouse across the row or column indices while holding the mouse button down.

After you have selected the values, they will be highlighted in reverse video.


Select one value from a scrolling output table by clicking once on it. The selected value will be highlighted in reverse video.


Limitations on the copying of numerical results
LIMITATIONS ON COPYING RESULTS

When you copy a result of a calculation to the clipboard, the result placed on the clipboard will differ from the original result in the following ways:

All numbers on the clipboard will contain only as many digits of precision as were displayed in the original result.

Any units associated with the result will not be copied to the clipboard.

Any trailing zeros will not be copied.

Nested arrays in a result will be copied as zeros.


Nested arrays

Nested arrays in results are illustrated below.


ARITHMETIC OPERATORS

You can type any operator using its keystroke. Most operators are also available on the operator palette buttons.

addition with linebreak	Ctrl+Enter

addition	+

complex conjugate	"

division	/

exponentiation	^

factorial	!

magnitude	|

multiplication	*

negation	-

nth root	Ctrl+\

product	Ctrl+Shift+3

range product	#

range sum	$

square root	\

subtraction	-

summation	Ctrl+Shift+4


Addition operator
ADDITION	Press +

x + y	Returns the sum of x and y.

If you find an expression so long that it scrolls off the right of the screen, you may prefer to use Ctrl+Enter instead. This inserts

Operands:

x and y are scalars.

x and y must have the same dimensions.


Subtraction operator
SUBTRACTION	Press −

x - y	Subtracts y from x.

If you find an expression so long that it scrolls off the right of the screen, you may prefer to negate the y and use Ctrl+Enter instead. This inserts

Operands:

x and y are scalars.

x and y must have the same dimensions.


Multiplication operator
MULTIPLICATION	Press ∗

This returns the product of y and x.

Operands:

x and y are scalars.

Mathcad also supports implied multiplication meaning that you do not necessarily have to use the multiplication operator between constants and variables. For example, you can type 5x and Mathcad understand it as 5*x. Implied multiplication is not supported for the variables o and h, however, because those are reserved for typing octal and hexadecimal numbers.


Division operator
DIVISION	Press /

This returns y divided by x. If x=0, this returns an error message indicating there is a singularity If y is an array, the division operator divides each element by x.

Operands:

x and y are scalars.

x cannot be 0.

Note that the indeterminate form 0/0 always yields 0.


Negation operator
NEGATION	Press −

-x	This returns the negative of its operand.

Operands:

x is a scalar.


Exponentiation operator
EXPONENTIATION	Press ^

This returns y raised to the x power.

Operands:

x and y are scalars.

x must be dimensionless.


Factorial operator
FACTORIAL	Press !

n!	Returns n(n-1)(n-2)...1

Operands:

n must be a nonnegative integer.

Factorials for n>170 will overflow when evaluated numerically. Large factorials can nevertheless be evaluated by the symbolic processor.


Complex conjugate operator
COMPLEX CONJUGATE	Press "

Returns the conjugate of x:

Re(x) - i Im(x)

Operands:

x must be a scalar.


Square root operator
SQUARE ROOT	Press \

Returns the positive square root of x.

Operands:

x must be a scalar.

When x is negative or complex, returns the square root having the smallest argument.


Nth root operator
NTH ROOT	Press Ctrl+\

Returns the nth root of x.

Operands:

x must be a scalar.

n must be a positive integer.

This returns a real valued root whenever one is available. To return the principal value of the nth root of x, raise x to the power 1/n instead.


Principal value

In general, every number has n nth roots. For example, there are two equally valid square roots of 4, namely 2 and −2.

Since only one of these values can be returned, there must be a way to choose between them. This is done by picking the principal value, the one with the smallest complex argument. Since the argument of 2 is 0, and that of −2 is π/2, the result is 2. By coincidence, this is also a real valued root.


Summation with range variables
SUM WITH RANGE VARIABLES	Press $

Returns the sum over i of the expression X.

Operands:

i must be a range of integers.

X is any expression.

Define the range variable i before using this operator. For example:

To make a sum with a variable upper limit of summation, use the following example:

If the summand has several terms, be sure to enclose them in parentheses to keep them inside the summation operator.


Summation without range variables
SUM WITHOUT RANGE VARIABLES	Press Ctrl+Shift+4

Returns the sum over i as i goes from m to n of the expression X.

Operands:

i must be an integer.

X is any expression.

m and n must be integers with m < n.

If the summand has several terms, be sure to enclose them in parentheses to keep them inside the summation operator.

Note that the variable i is defined only within the summation operator and therefore has no effect on, and is not influenced by, variable definitions outside the product operator.


Product with range variables
PRODUCT WITH RANGE VARIABLES	Press #

Returns the product over i of the expression X.

Operands:

i must be a range of integers.

X is any expression.

If X consists of several terms, be sure to enclose them in parentheses to keep them inside the product operator.

You must define the range variable i before using this operator. For example:


Product without range variables
PRODUCT WITHOUT RANGE VARIABLES	Press Ctrl+Shift+3

Returns the product as i goes from m to n of the expression X.

Operands:

i must be an integer.

X is any expression.

m and n must be integers with m < n.

If X consists of several terms, be sure to enclose them in parentheses to keep them inside the product operator.

Note that the variable i is defined only within the iterated product operator and therefore has no effect on, and is not influenced by, variable definitions outside the product operator.


Addition with linebreak operator
ADDITION WITH LINEBREAK	Press Ctrl+Enter

Same as addition, except the two terms are on different lines.

Operands:

x and y are scalars.

x and y must have the same dimensions.

Use this to avoid expressions that scroll off the edge of the screen.


Magnitude operator
MAGNITUDE	Press |

|x|	Returns the magnitude (or absolute value) of x.

Operands:

x must be scalar.

To return the magnitude of the individual elements of an array, use the vectorize operator in conjunction with this operator.


Related Topics:

Arithmetic operators

Array operators

Logical operators

Calculus operators

User-defined operators


User defined operators
USER-DEFINED OPERATORS

You can think of operators and functions as really being the same. Both take “arguments” and return results. Mathcad therefore allows you to define your own operators, just as you can define your own functions. You can define operators which accept one “argument” or two arguments.

Defining a custom binary operator

Defining a custom unary operator

Using a custom binary operator

Using a custom unary operator

Using QuickSheets to save custom operators


Binary operator

An operator with two operands. For example, "+" is a binary operator because you would always see "x + y". Here, x and y are the two operands.


Unary operator

An operator with a single operand. For example, the factorial operator, "!" is a unary operator because you would always see "n!". Here, n is an operand.

Other examples of unary operators are the square root and the complex conjugate.


USING QuickSheets TO INSERT AN OPERATOR NAME

Although an operator can have any name at all, operator names commonly involve math symbols not readily available from the keyboard. The simplest way to get these symbols is to drag them from a QuickSheet window as follows:

Open QuickSheets from the Resource Center.

Click on "Math Symbols". You'll see a collection of math symbols not readily available from the keyboard.

When you see the math symbol you want, drag it to your worksheet.

You can also paste in a symbol from another application or if you know the ANSI code, you can hold down the Alt key while typing the ANSI code using the numeric keypad.


DEFINING A CUSTOM BINARY OPERATOR

If an operator doesn't come with Mathcad, you can define your own the same way you would define a function. To define a binary operator:

Type the name of the operator.

Type a "(", followed by two operands separated by a comma, and a ")".

Type a ":".

In the placeholder, type an expression involving the operands.


DEFINING A CUSTOM UNARY OPERATOR

If an operator doesn't come with Mathcad, you can define your own the same way you would define a function. To define a unary operator:

Type the name of the operator.

Type a "(", followed by an operand and a ")".

Type a ":".

In the placeholder, type an expression involving the operand.


USING A CUSTOM UNARY OPERATOR

To insert a unary operator you've defined previously, click wherever you want to insert the operator and do the following:

Open the palette containing the boolean operators.

Click either the prefix button to use prefix notation or the postfix button to use postfix notation.

For prefix notation, type the name of the operator in the left placeholder. For postfix notation, type it in the right placeholder.

In the remaining placeholder, type the operand.


Prefix notation

Prefix notation is a way to display a unary operator. In prefix notation, the operator appears before the operand. For example:


Postfix notation

Postfix notation is a way to display a unary operator. In postfix notation, the operator appears after the operand. For example:


USING A CUSTOM BINARY OPERATOR

To insert a binary operator you've defined previously, click wherever you want to insert the operator and do the following:

Open the palette containing the boolean operators.

Click either the infix button to use infix notation or the treefix button to use "treefix" notaion.

Type the name of the operator in the middle placeholder.

In the remaining two placeholders, type the operands.


Click on [image].


Infix notation

Infix notation is a way of displaying binary operators. In infix notation, the operator appears between the operands. For example:


Treefix notation

Treefix notation is another way of displaying binary operators. In treefix notation, the operator and its associated operands are arranged in a tree-like structure as shown below.


USING QuickSheets TO SAVE CUSTOM OPERATORS

If you've defined an operator that you want to use in other worksheets, it's convenient to save it in a QuickSheet. That way, you can simply drag it from a QuickSheet whenever you need it. To save an operator in a QuickSheet:

Open QuickSheets from the Resource Center  .

Click on "Personal QuickSheets". Then click on "My operators".

Drag the definitions or other expressions you want to drag into this QuickSheet.

Close QuickSheets and click "Yes" when Mathcad asks you if you want to save your changes.

The next time you need this operator, you'll be able to drag it back off this QuickSheet.


Related Topics:

Defining a custom binary operator

Using a custom binary operator

Defining a custom unary operator

Using a custom unary operator

Using QuickSheets to insert an operator name

Using QuickSheets to save custom operators


POLAR PLOTS

Use Mathcad’s polar plots to plot angle-dependent mathematical expressions, functions, and sets of data (stored in vectors). Once you’ve created a polar plot, you can format it to your liking. Mathcad also allows you to zoom in on parts of a polar plot or extract the coordinates from a particular spot.

Creating a plot

Deleting a plot

Moving a plot

Changing the size of a plot

Axis limits

Axis settings

Trace settings

Legends

Zooming in

Reading coordinates

Titles on plots

Default settings

Animating a polar plot


CREATING A POLAR PLOT

To create a polar plot,

Choose Graph / Polar Plot from the Insert menu to create a polar plot region.

Fill in the bottom placeholder with an angle variable to plot against. For example, type ‘A’ if you had previously defined ‘A’ as a range variable. (Do not define ‘A’ if you want to create a Quickplot..)

Fill in the left placeholder with a radial expression to plot. For example, type ‘cos(A)’ to plot the cosine of ‘A’.

Mathcad creates polar plots by mapping r and θ onto x and y using the standard transformations x=r*cos(θ) and y=r*sin(θ). r and θ can assume positive or negative values. If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

You can plot more than one polar curve on a graph.

See Mathcad Quicksheets for an example.


CONTROLLING WHICH POINTS TO PLOT

By default, the values of the angle variable are automatically generated. You can, if you prefer, control exactly which angles to plot by using range variables. To do so:

Define a range variable that takes on values corresponding to those angles at which you want to plot.

Choose Graph / Polar Plot from the Insert menu to create a polar plot region.

Fill in the bottom placeholder with the range variable corresponding to the angle you want to plot against.

Fill in the left placeholder with a radial expression to plot.


Default axis limits on the radial axis

For a linear scale:

The upper limit is set to the maximum radial value of the function plotted.

The lower limit on a linear scale is zero.

For a logarithmic scale:

The upper limit is set to the next higher integer power of ten above the maximum of the data.

The lower limit is set to the next integer power of ten below the minimum of the data.


Changing axis limits of polar plots
CHANGING RADIAL AXIS LIMITS OF POLAR PLOTS

To override the default radial axis limits:

Click in the polar plot to select it. You'll see two additional numbers on the right of the polar plot.

To set the origin of the polar plot, click on the lower number and type a new number.

To set an axis limit for the perimeter of the plot, click on the number in the top placeholder and type in a new number.

Click outside the plot region.

You cannot override the default angular axis limits. These are always set to 0 degrees and 360 degrees.


LABELING AXES ON A POLAR PLOT

To label an axis of a plot:

Double-click on the plot to open a tabbed dialog box.

Click on the Labels tab.

In this dialog box, type in a label for either or both axes. You can use upper and lower case letters in the label.

Click "OK" to display the labels you've specified.

To remove the label from the text boxes, click on "Cancel" to restore the label text boxes to their original state.

To delete the labels altogether, backspace over them.


ZOOMING IN ON A POLAR PLOT

Click in the polar plot to select it, then choose Graph / Zoom to bring up the Zoom dialog box.

In the plot region, press and hold down the mouse button. Drag the mouse until a dashed selection circle just encloses the region you want to magnify.

Let go of the mouse button. The radius of the selected region is listed in the "Radius:" box of the Polar Zoom dialog box.

Press the "Zoom" button to redisplay the plot. The axis limits are temporarily set to the coordinates specified in the Polar Zoom dialog box. To make these axis limits permanent, click "OK."

Press "Unzoom" to restore the plot to its state before zooming. Press "Full View" to restore the original plot when you've zoomed in on a plot more than once.


GETTING A READOUT OF POLAR PLOT COORDINATES

To see a readout of plot coordinates on any point in a plot:

Click in the plot to select it, then choose Graph / Trace from the Format menu to bring up the Polar Trace dialog box.

In the plot region, click and drag the mouse along the trace whose coordinates you want to see. A dotted crosshair jumps from one point to the next as you drag it along the trace.

You'll see the coordinates corresponding to the location of the crosshair in the "Radius" and "Angle" boxes. These coordinates change as you move the mouse.

When you release the mouse button, you'll see the radial and angular values of the last point you selected shown in the dialog box.

To copy a coordinate value to the clipboard:

Click the "Copy Radius" or "Copy Angle" button to place the corresponding coordinate in the clipboard.


Axis settings (polar plots)
AXIS SETTINGS ON POLAR PLOTS

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the Polar Axes tab.

The radial axis has the following check boxes associated with it:

Log scale (radial axis only)

Grid lines

Numbered

Autoscale (radial axis only)

Show markers (radial axis only)

Auto grid

Axes style

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Trace settings (polar plots)
TRACE SETTINGS ON POLAR PLOTS

To select the characteristics of each trace:

Double-click on a plot to open a tabbed dialog box.

Click on the Traces tab.

Click on the trace's name under the Legend Label column of the scrolling list in the middle of the dialog box. The characteristics assigned to that trace appear in the six text boxes under the corresponding columns. These are:

Legend label

Symbol

Line

Color

Type

Weight

To change any of these characteristics, click on the arrow beside the appropriate text box to see a drop-down list of options.

To change the characteristics for another trace, click on its name in the scrolling list in the middle of the dialog box. Then assign its characteristics as described above.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Legend settings (polar plots)
LEGEND SETTINGS ON POLAR PLOTS

To create a legend for identifying each trace:

Double-click on a plot to open a tabbed dialog box.

If necessary, click on the Traces tab.

Assign names to each trace by clicking the default names listed in the Legend label column of the scrolling list in the middle of the dialog box. You'll see the name reproduced in the text box below this column.

To change the name of the trace, type the new name in the text box under the Legend label column.

To control whether the legend is displayed or hidden, use the "Hide Legend" check box.

To control whether the expressions that created the plot are also displayed, use the "Hide Arguments" check box.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


Default settings (polar plots)
DEFAULT SETTINGS FOR POLAR PLOTS

To reset a plot to the default settings:

Double-click on the plot to open a tabbed dialog box.

If necessary, click on the Defaults tab.

Click on the "Change to Defaults" button.

To make the default settings be those of a particular plot:

Double-click on the plot to open a tabbed dialog box.

If necessary, click on the Defaults tab.

Click on the "Use for Defaults" check box.

To set defaults without using a graph:

Make sure that you don't have any graphs selected.

Choose Graph / Polar Plot from the Format menu to invoke the Setting Default Formats of Polar Plots dialog.

Change the appropriate settings on the Polar Axes and Traces pages.

Click "OK" to accept your changes and close the dialog box.


ADDING A TITLE TO A POLAR PLOT

To add a title to a polar plot:

Double-click on the plot to open a tabbed dialog box.

Click on the Labels tab.

In the text box, type the title for your plot. You can use upper and lower case letters in the title.

Click on either the "Above" or "Below" button.

Click on “Show Title.” Then click "OK" to display the title of the plot region.

To remove the title in the text box, click on "Cancel" to restore the title text box to its original state.

To hide the title, uncheck the "Show Title" check box to toggle it off. To delete the title altogether, backspace over it.


Log scale

When this box is checked, the selected axis is logarithmic. The axis limits must be positive. This setting applies only to the radial axis.


Grid lines

When this box is checked, the tick marks on the selected axis are replaced by gridlines.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 2 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Autoscale

By default, a plot you create is autoscaled. With "Autoscale" on, each axis limit is set to the first major tick mark beyond the end of the data.

With "Autoscale" off, the axis limits are set right at the data limits. To turn off "Autoscale" and have your plot drawn to the ends of the plot region:

Click on the "Autoscale" check box for the appropriate axis to toggle it off.


Show markers

This lets you add radial reference lines to a plot. To do so:

Click on the "Show Markers" check box in the Radial Axis column. You'll see two additional placeholders on the upper-left side of the plot.

Click on one of the placeholders and type in the value at which you want a line drawn. Repeat this process with the other placeholder to add the second radial reference line.

Choose Calculate from the Math menu to redisplay the plot.


Legend label

This is the name of the trace as it appears on the legend.


Symbol

This controls whether each point on the curve is marked with a symbol. If you have a lot of points packed closely together, you should probably select 'none.'


Axes style

This controls whether the axes intersect in the center of the plot (crossed), whether they enclose the plot in a circle (perimeter), or whether they appear at all.


Line

This controls whether the line is solid, dotted, dashed, or whether it consists of alternating dashes and dots. This provides a useful way to distinguish unmarked curves in black and white printouts.


Color

This controls whether the selected trace is red, blue, green, magenta, cyan (a light blue), brown, black, or white.


Weight

This controls how thick the curve is. Use 1 for fine curves and 9 for thick curves. Use "p" to make the finest possible curve, a single pixel wide. Keep in mind that a "p" curve may not print on printers with inadequate resolution.


Trace type

This controls whether the selected trace is shown as a bar chart, as a curve, as a stepped curve, a stem plot, or error bars.


Hide Arguments

Check this box to hide the math expressions you typed in the middle placeholder of each axis.


Hide Legend

Check this box to hide the legend that appears under the plot.


Use for defaults

Make the settings of the currently selected polar plot be the default settings for all polar plots created from now on.


Change to defaults

Restore all settings on the currently selected polar plot to whatever the default plot settings are.


Trace

A "trace" is another name for one of the curves or lines you're plotting.


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed on the screen.


PRINTING A WORKSHEET

To Print the currently active worksheet, choose Print from the File menu to bring up the Print dialog box.

Before printing, you may want to see how your worksheet will look by choosing Print Preview from the File menu.


PRINT PREVIEW

To see how your worksheet will look on the page before printing:

Choose Print Preview from the File menu.

The Print Preview screen shows the current page of your worksheet as it will appear when printed.

Page through your worksheet using the “Next Page” and “Prev Page” buttons at the top of screen.

Click on a spot in the worksheet to zoom in on it. You can zoom in at two levels. Once you’ve zoomed in as far as possible, clicking on a spot in the worksheet will zoom all the way out.

Click “Close” to go back to the main Worksheet Window..

Once you see how your worksheet will look, you may want to make changes. Choose Page Setup from the File menu to change margins or add headers and footers.


PAGE NUMBERING IN PRINTOUTS

To add page numbers to your printout:

Choose Headers/Footers from the Format menu.

Click on the button beside "Header" to place the page number in the header. Otherwise, click on the one beside "Footer".

Click in the text box corresponding to where you want to put the page number.

Click on "Page #."


WORKSHEET NAME IN PRINTOUTS

To add the name of the current worksheet to your printout:

Choose Headers/Footers from the Format menu.

Click on the button beside Header to place the page number in the header. Otherwise, click on the one beside Footer.

Click in the text box corresponding to where you want to put the name of the current worksheet.

Click on Filename.

If the worksheet has not yet been saved in a file, the name "Untitled" appears in place of the filename.


DATE AND TIME IN PRINTOUTS

To add the date and time to your printout:

Choose Headers/Footers from the Format menu.

Click on the button beside "Header" to place the page number in the header. Otherwise, click on the one beside "Footer."

Click in the text box corresponding to where you want to put the date and time.

To insert the date, click on "Date."

To insert the time, click on "Time."


HEADERS AND FOOTERS

To add headers and footers to your printout:

Choose Headers/Footers from the Format menu.

Click on either the "Header" or the "Footer" button.

Make sure the "Enable Header" or "Enable Footer" box is checked.

Click in the text box corresponding to where you want to put the header or footer.

Type the appropriate text.

When done, click "OK."

To suppress printing a header or footer, make sure the "Enable Header" or "Enable Footer" box is unchecked.


MARGINS

To set margins:

Choose Page Setup from the File menu.

Click in the text box corresponding to the margin you want to move.

Enter the number of inches from the margin to the edge of the sheet of paper you'll be printing on.

To apply these margin settings to the current worksheet, click "OK."


CHANGING PRINTERS

To redirect your printout to a file or to a different printer:

Choose Print from the File menu to bring up the Print dialog box.

Click on "Print Setup" to bring up the Print Setup dialog box. Specify the printer of your choice. Then click "OK."

To redirect your printout to a file, click on the Print to file checkbox.


PRINTING WIDE WORKSHEETS

Mathcad worksheets can be wider than a sheet of paper. A dashed vertical line indicates the edge of a sheet of paper, but Mathcad allows you to type beyond it. Anything typed beyond the vertical line  will print on separate sheets. Depending on your layout, this may result in one or more blank pages.

To suppress printing of all regions beyond the right margin:

Choose Page Setup from the File menu.

Click on the button beside "Print single page width."

Click "OK."


HARD PAGE BREAKS

A hard page break is a solid line across the worksheet. Everything below this line prints on a new page.

To insert a hard page break:

Click where you want to put a page break. Make sure the line won't cut across any math or text regions.

Choose Page Break from the Insert menu.

To delete a hard page break:

Shift+Click a little to the right of the bend at far left where the line meets the left edge of the window.

When you see a small dashed box beside the bend, choose Cut from the Edit menu.

Do not confuse hard page breaks (solid horizontal lines) with soft page breaks (dashed horizontal lines). Soft page breaks are determined by the printer you have chosen as the default printer for your operating system.


SOFT PAGE BREAKS

A soft page break is a dashed line across the worksheet. Everything below this line prints on a new page.

Soft page breaks are inserted automatically based on your choice of printer. You cannot move soft page breaks other than by changing printers.

For better control over when a new page begins, use hard page breaks instead.


Here's an example of a worksheet which would print with a blank page.


PRINTING SELECTED PAGES

To print selected pages:

Get the page numbers by looking at the indicator on the lower left of the window.

Choose Print from the File menu to bring up the Print dialog box.

Click the button beside "Selected pages."

Type the page range you want to print in the text boxes beside "From" and "To."

Click "OK."


PRINTING SELECTED REGIONS

To print selected regions:

Ctrl+Click on the regions you want to print. This puts a dashed rectangle around each region indicating that they are selected.

If you change your mind about a selected region, Ctrl+Click on it again. This removes the dashed rectangle from around that region.

Choose Print from the File menu to bring up the Print dialog box.

Click the button beside "Selection."

Click "OK."


All

Prints all pages in the worksheet.


Selection

Prints only the selectedregions. If the button is gray, you have not selected any regions with the dashed rectangle.


Pages

Prints a range of pages. Fill in the “from” and “to” boxes to indicate your selection. If you’ve selected a plotter as your output device, you’ll only be able to print one page.


Print Dialog Options


Choose at least 300 dpi if you are printing to a laser printer.


Number of copies

Specifies the number of copies of the worksheet to print. If this option is gray, your printer may not support this option. Check the printer setup in Windows.


Print to file

Directs your output to a file rather than to a printer.


from

Prints pages beginning with this page.


to

Prints pages ending with this page.


Properties

Brings up a dialog box where you can choose a printer from amongst your installed printers and specify paper size, source, and orientation (landscape or portrait). Consult your operating system documentation for details.


Name

By default, Mathcad sends its output to whatever printer you installed as a default printer. Click on the Properties  button to redirect your output to another printer.


Page Setup Dialog Options


Left Margin

This is the distance from the left edge of the physical sheet of paper to the left edge of the print area.


Right Margin

This appears as a solid vertical line in your window. You may have to scroll to the right to see it.

Don’t mistake the dashed vertical line for the right margin. The dashed vertical line is the right page boundary marking the right edge of the physical sheet of paper. Its location depends on your choice of default printer in your operating system.


Top Margin

This is the distance from the top edge of the physical sheet of paper to the top edge of the print area. If your worksheet has a header, it appears just above this margin.


Bottom Margin

This is the distance from the bottom edge of the physical sheet of paper to the bottom edge of the print area. If your worksheet has a footer, it appears just below this margin.


Print Whole Width

Click this button to print all the regions in your worksheet, even those to the right of the right margin. This is useful when you are printing a wide worksheet.


Print to Right Margin
Print single page width

Click this button to suppress the printing of anything to the right of the right margin.


Print Preview Screen Options


Print

Prints your worksheet.


Next Page

Shows the next page of your worksheet in the Print Preview screen. If this button is gray, there are no further pages in your worksheet.


Prev Page

Shows the previous page of your worksheet in the Print Preview screen. If this button is gray, there are no previous pages in your worksheet.


Zoom In

Magnifies a portion of your worksheet. You can zoom in twice.


Zoom Out

Cancels any magnification so that you see your document in the normal size used by Print Preview.


Two Page/One Page

Toggles between “Two Page” and “One Page” buttons. Click “Two Page” to show two pages of your worksheet at a time. Click “One Page” to show only one.


Close

Closes the Print Preview screen and brings up the main Worksheet Window.


Zooming Cursor

Magnifies the portion of your worksheet over which it lies when you click the right mouse button. You can click twice to magnify your worksheet even more. Once you’re at the maximum magnification, clicking the zooming cursor de-magnifies your worksheet.


PROGRAMMING

What is a program

Defining a program

Conditional statements

Program loops

Break statements

Controlling iterations in a loop

Rerturning a value

Trapping errors

Recursion

Evaluating a program symbolically

Programming examples


WHAT IS A PROGRAM?

A program is simply an expression made up of more than one statement. If you click on the examples below, you'll see how they look when written as a program rather than as a single expression.

Despite the underlying equivalence between programs and simple expressions, programs offer two distinct advantages:

When you use control structures like loops and conditional branches, a program can become far more flexible than a simple expression could ever be.

A program made of several simple steps is often much easier to create than an equivalent, but far more complicated expression draped with parentheses.


DEFINING A PROGRAM

To following steps illustrate how to define a sample program:

Type the left side of a function definition followed by the assignment operator ":".

Open the special palette containing the various programming operators.

Click on the "Add Line" button. This creates a vertical bar with a placeholder for an additional program statement (a program can have any number of statements).

Click on the top placeholder, type "z" and click on the local assignment button. Be aware that the definition of z is local to the program. It is undefined outside the program and has no effect anywhere but inside the program.

Complete the local assignment by typing "x/w" in the placeholder to the arrow's right.

The last placeholder should always contain the value returned by the program. Type "log(z)" into this placeholder.

You can now use this function just as you would any other function or evaluate it symbolically.


Keyboard shortcut is "]".


Keyboard shortcut is "{".

Variables defined with this operator are defined only within the program.


EVALUATING A PROGRAM SYMBOLICALLY

Once you’ve defined a program that you want to evaluate symbolically:

Type the name of the function or variable name which is defined in terms of a program.

Press Ctrl +Period to insert the right arrow representing the symbolic equal sign.


Conditional statements in programs
CONDITIONAL STATEMENTS

Use a conditional statement whenever you want a program statement to execute only upon the occurrence of some condition. To insert a conditional statement:

Click on the placeholder into which you want to place the conditional statement.

Open the special palette containing the various programming operators.

Click on the "If" button. Do not just type the word "if".

In the right placeholder, type a boolean expression.

In the left placeholder type the value you want the program to return if the condition is true.

Click in the remaining placeholder and click the "otherwise" button. Do not just type the word "otherwise".

In the remaining placeholder type the value you want the program to return if the condition is false.


Keyboard shortcut is "}".


PROGRAM LOOPS

A loop is a program statement that causes one or more statements (the body of the loop) to execute repeatedly until a particular condition occurs. There are two kinds of loops:

"For" loops are useful when you know exactly how many times the body of the loop should execute.

"While" loops are useful when you want to stop execution upon the occurrence of a condition but you don't know exactly when that condition will occur.

When using loops, you may need to break out of them or control particular iterations.


"WHILE" LOOPS

Use a "while" loop whenever you want a set of statements to keep executing until a condition is met. Make sure you have a statement somewhere that makes the condition false. Otherwise the loop will execute indefinitely and you will need to stop it by pressing Esc.

To insert a "while" loop:

Click on the placeholder into which you want to place the "while" loop.

Open the special palette containing the various programming operators.

Click on the "while" button. Do not just type the word "while".

In the placeholder to the right of the "while", type a boolean expression.

In the placeholder below the "while", enter the statement you want to execute repeatedly. Use the "Add Line" button to insert placeholders for additional statements if necessary.

"While" loops are useful when you want to stop execution upon occurrence of a condition and you don't know exactly when that condition will occur. If you know exactly how many iterations you want, use a "for" loop instead.


"FOR" LOOPS

Use a "for" loop when you know exactly how many times you want the body of the loop to execute. To insert a "for" loop:

Click on the placeholder into which you want to place the "for" loop.

Open the special palette containing the various programming operators.

Click on the "for" button. Do not just type the word "for".

In the placeholder to the left of the "e", enter the iteration variable.

In the placeholder to the right of the "e", enter the range of values to be taken by the iteration variable (although you will most often use a range variable here, you can also use a vector, a list of scalars, and vectors separated by commas).

In the placeholder below the "for", enter the statement you want to execute repeatedly. Use the "Add Line" button to insert placeholders for additional statements if necessary.

If you want the body of the loop to execute until the occurrence of a condition but you don't know exactly how many times this will take, use a "while" loop instead.


"BREAK" STATEMENT

Use a "break" statement in a program whenever you want to halt execution in a program.

When Mathcad encounters a "break" statement in the body of a “for” or “while” loop:

The loop will cease execution and return the most recent value computed.

The program execution will then continue with the next line of the program after the loop.

When Mathcad encounters a "break" statement that is not part of a “for” or “while” loop:

The entire program stops.

The program returns the current value of the last statement executed before the break.

To insert a "break" statement:

Click on the placeholder in which you want to put the "break" statement.

Open the special palette containing the various programming operators.

Click on the "break" button. Do not just type the word "break".


PROGRAMMING EXAMPLES

With only ten buttons on the programming palette, Mathcad's programming environment is easy to use. Nevertheless, this simplicity conceals a surprising amount of programming power. When combined with Mathcad's rich numerical functionality and used in conjunction with the abstract data structures provided by Mathcad's nested arrays, these ten programming operators enable you to write sophisticated programs in Mathcad.

There are several QuickSheets showing more sophisticated programming techniques including subroutine calls and recursion. To find your way into these examples:

Choose Resource Center from the Help menu.

Click on Quicksheets and then “Programming.”


Related Topics:

What is a program?

Defining a program

Conditional statements

“ for” loops

“ while” loops

Controlling iterations in a loop

Break statements

Returning a value

Trapping errors

Recursive definitions

Evaluating a program symbolically

Programming examples


RECURSION

Recursion is a powerful programming language that involves defining a variable in terms of itself as shown in this example:

Recursive function definitions should always have at least two parts:

An initial condition to prevent the recursion from going forever, and

A definition of the function in terms of a previous value of the function.

The idea is similar to that underlying mathematical induction: if you can get f(n+1) from f(n), and you know f(0), then you know all there is to know about f.

Keep in mind however, that although recursive function definitions, despite their elegance and conciseness, are not always the most computationally efficient definitions. You may find that an equivalent definition using one of the iterative loops will evaluate more quickly.


"return" statement
RETURNING A VALUE

By default, a program returns whatever is on the last line. You can return a value located elsewhere in the program by using a “return” statement.

To insert a "return" statement:

Click on the placeholder into which you want to place the "return" statement.

Open the special palette containing the various programming operators.

Click on the "return" button. Do not just type the word "return".

In the placeholder to the right of the "return", type whatever you would like to return.

"Return" statements are useful when you want to return a value from a particular loop.


CONTROLLING ITERATIONS IN A LOOP

Program loops are designed to continue until a certain condition is met or after a certain number of iterations. However, you may want to halt a loop during a certain iteration and continue with the next iteration. To do so, use a “continue” statement.

To insert a "continue" statement:

Click on the placeholder into which you want to place the "continue" statement.

Open the special palette containing the various programming operators.

Click on the "continue" button. Do not just type the word "continue".

When the program encounters a “continue,” it halts the iteration, goes to the nearest outer loop, and continues with the next iteration.


TRAPPING ERRORS

To return an alternative value when an error is encountered in an expression, use the “on error” programming operator:

Click on the placeholder into which you want to place the "on error" statement.

Open the special palette containing the various programming operators.

Click on the "on error" button. Do not just type the words "on error".

In the placeholder to the right of the "on error", type whatever you would like to return, assuming it can be evaluated successfully.

In the placeholder to the left of the "on error", type whatever you would like to return if the default return expression cannot be evaluated.

The right-hand expression is evaluated and returned if no errors occur. If an error occurs, the left-hand argument is returned.


Programming operators:

Add Line

while

otherwise

continue

local assignment (<--)

for

return

if

break

on error


filename

This is the name of an ASCII file (in the current working directory) typed as a string (press “). For example:

READPRN(“heights.prn”) reads from the file heights.prn located in the current working directory.

If you want to perform file I/O operations on a file not in the current default directory, you must enter the pathname to the file as a string. For example:

READPRN(“c:\windows\data\heights.prn”) reads from the file heights.prn located in the c:\windows\data directory.


NUMBER OF ELEMENTS IN A VECTOR

length(v)	Returns the number of elements in the vector v.

last(v)	Returns the index of the last element in the vector v.

Arguments:

v must be a vector.

To get the Euclidean length of v, use the magnitude operator |.


DIMENSIONS OF A MATRIX

rows(A)	Returns the number of rows in A.

cols(A)	Returns the number of columns in A.

Arguments:

A can be a vector or a matrix.

If A is neither a vector or a matrix, both rows and cols will return zero.


Maxima and minima of an array
MAXIMA AND MINIMA OF ARRAYS

max(A)	Returns the largest element in A.

min(A)	Returns the smallest element in A.

Arguments:

A can be a vector or a matrix.

When A has complex elements:

max(A) returns the largest real part plus i times the largest imaginary part.

min(A) returns the smallest real part plus i times the smallest imaginary part.

.


IDENTITY MATRIX

identity(n)	Returns an n x n identity matrix (a matrix of 0's with 1's along the diagonal).

Arguments:

n must be a positive integer.


EXTRACTING A SMALLER MATRIX FROM A MATRIX

submatrix(A,ir,jr,ic,jc)	Returns the matrix consisting of rows ir through jr and columns ic through jc of array A.

Arguments:

A is an array.

ir and jr are the upper and lower indices of the rows to be extracted.

ic and jc are the upper and lower indices of the columns to be extracted.

To extract a single column or a single row, use the superscript operator.


TRACE OF A MATRIX

tr(M)	Returns the sum of the elements along the diagonal of M.

Arguments:

M must be a square matrix.


JOINING ARRAYS

augment(A,B)	Returns an array formed by placing B to the right of A.

stack(A,B)	Returns an array formed by placing A above B.

Arguments:

A and B must be either vectors or matrices.

A and B must have the same number of rows for augment and the same number of columns for stack.


ROW-REDUCED ECHELON FORM OF A MATRIX

rref(A)	Returns the row-reduced echelon form of A.

Arguments:

A must be either a vector or a matrix.

The elements of A should be real.


RANK OF A MATRIX

rank(A)	Returns the rank of A.

Arguments:

A must be either a vector or a matrix.

The elements of A should be real.


Creating an array using a function
CREATING ARRAYS

matrix(m,n,f)	Creates a matrix in which the ijth element contains f(i,j) where i= 0,1..m-1  and j=0,1.. n-1.

Arguments:

m is the number of rows the matrix will have.

n is the number of columns the matrix will have.

f is a function of two variables.


GENERALIZED EIGENVALUES AND EIGENVECTORS

genvals(M,N)	Returns a vector v of computed eigenvalues, each of which satisfies the generalized eigenvalue problem.

genvecs(M,N)	Returns a matrix containing the normalized eigenvectors corresponding to the eigenvalues in v, the vector returned by genvals. The ith column of this matrix is the eigenvector x satisfying the generalized eigenvalue problem.

Arguments:

M and N must be square matrices.

The elements of M and N should be real.

M and N must have the same number of columns.

Use these functions to find generalized eigenvalues and eigenvectors. To find individual eigenvalues and eigenvectors, use the functions eigenvals and eigenvec.


LEFT INVERSE FUNCTION

geninv(A)	Returns the left inverse matrix L of A, such that [image].

Arguments:

A must be an m x n array, where m [image] n..

A must contain real values.


I is the identity matrix having the same number of columns as A.


NORM OF A MATRIX

norm1(M)	Returns the [image] norm of the matrix M.

norm2(M)	Returns the [image] norm of the matrix M.

norme(M)	Returns the Euclidean norm of the matrix M.

normi(M)	Returns the infinity norm of the matrix M.

Arguments:

M must be a square matrix.


CONDITION NUMBER OF A MATRIX

cond1(M)	Returns the condition number of the matrix M based on the [image] norm.

cond2(M)	Returns the condition number of the matrix M based on the [image] norm.

conde(M)	Returns the condition number of the matrix M based on the Euclidean norm.

condi(M)	Returns the condition number of the matrix M based on the infinity norm.

Arguments:

M must be a square matrix.


CHOLESKY DECOMPOSITION

cholesky(M)	Returns the lower triangular matrix L such that [image].

Arguments:

M must be symmetric.

This function uses only the upper triangular part of M.


QR DECOMPOSITION

qr(A)	Returns a matrix whose first n columns contain the square, orthonormal matrix Q, and whose remaining columns contain the upper triangular matrix, R. Use the function submatrix to extract these smaller matrices.

Matrices Q and R satisfy the equation [image].

Arguments:

A must be either a vector or a matrix.

The elements of A must be real.


LU DECOMPOSITION

lu(M)	Returns one matrix containing the three square matrices P, L, and U, all having the same size as M and joined together side by side. Use the function submatrix to extract these smaller matrices.

These three matrices satisfy the equation [image],

where L and U are lower and upper triangular respectively.

Arguments:

M is a square matrix.


SINGULAR VALUE DECOMPOSITION

svd(A)	Returns one matrix containing two stacked matrices U and V. Use the function submatrix to extract these smaller matrices.

Matrices U and V satisfy the equation [image],

where s is the vector returned by svds(A) .

Arguments:

A must be an m x n array, where m [image] n.

The elements of A must be real.


SINGULAR VALUES

svds(A)	Returns a vector containing the singular values of A.

Arguments:

A must be an m x n array, where m [image] n.

The elements of A must be real.

The results from this function can be used to perform the singular value decomposition of a matrix.


WAVELET TRANSFORMS

wave(v)	Returns the wavelet transform of the data in v using Daubechies four-coefficient wavelet filter.

iwave(u)	Returns the inverse discrete wavelet transform corresponding to wave of the data in u.

Arguments:

v and u must have [image] elements, where m is an integer.

All elements of v must be real.


DIAGONAL MATRIX FUNCTION

diag(v)	Returns a diagonal matrix containing on its diagonal the elements of v.

Arguments:

v must be a vector.


CREATING A NESTED ARRAY

The elements of an array can themselves be arrays. You create a nested array in exactly the same way you create any array. The only difference is that you cannot use the Matrices command from the Insert menu when the selected placeholder is already inside a matrix.

The simplest way to define an array element that is itself an array is the following:

Assign the array to a variable name.

Define the matrix element in terms of this variable name.

There are three other ways to define a nested array.


DISPLAYING A NESTED ARRAY

When you display a nested array using the equal sign, you won't actually see every element in every nested array. Such a display would be very cumbersome, especially when you consider that an array inside an array may itself contain arrays within it.

Instead, you'll see:

A number when the array element is a scalar.

An ordered pair "{m,n}" when the array element is an m x n array.

The following example illustrates this:


OPERATORS AND FUNCTIONS FOR NESTED ARRAYS

Many array operators and functions have no reasonable meaning in the context of nested arrays. For example, it is unclear what matrix multiplication should mean, or what the inverse ought to do.

The following operators and functions, however, continue to have reasonable meanings when used with nested arrays.

Operators

Transpose

Matrix subscript

Matrix superscript

Vector subscript

Functions

augment

cols

last

length

rows

stack

submatrix


ITERATION AND LOOPING

Range variables

Shows how to define variables whose value iterates through a range.

Repeatedly evaluating an expression

Shows how to use range variables to evaluate expressions at several values.

Iteration over a range of values

          Shows how to use range variables with arrays and functions to perform simple iteration.

Entering a table of values

Shows how to use range variables to enter a table of values into an array.

Editing a table of values

Adding and removing values from an input table.

Difference equations

Evaluating the solution of a difference equation recursively by using range variables.

Iterated calculations

Evaluating the solution of a system of coupled difference equations recursively by using range variables.

Graphing a function

Shows how to use range variables to determine the domain over which a function will be graphed.

Graphing a vector

Shows how to use range variables to graph the elements of a vector.


DEFINING A RANGE VARIABLE

A range variable is a variable that takes on a sequence of values. To define a range variable:

Type the name of the variable followed by ":" (colon).

In the placeholder, type the first number in the sequence of values.

Type a comma.

Type the second number in the sequence.

Type a ";" (semicolon). Note that it appears as two dots ".."

In the remaining placeholder, type the last number in the sequence.


Related Topics:

Defining a range variable

Limitations on range variables

Repeatedly evaluating an expression

Iteration over a range of values

Entering a table of values

Editing a table of values

Difference equations

Iterated calculations


Sequence of values

Some examples are:

1,2..20	gives 1, 2, 3 ...20

20,19,..1	gives 20, 19, 18 ...1

1,1.1..5	gives 1, 1.1, 1.2 ...5

5,3..-7	gives 5, 3, 1, -1 ...-7

To get the double-period, (..) always type the semicolon (;).


Shortcut for sequences that increment by one

If you're defining a sequence that goes up or down in steps of one, you can skip this step and the next one. For example, the following pairs of sequences are completely equivalent:

1,2..20	1..20

1,0..-5	1..-5


LIMITATIONS ON RANGE VARIABLES

There are certain range variable definitions which are not allowed. These are:

The number just after the comma (if any) should be between the other two numbers.

All numbers in the definition must be real.

The dimensions (if any) of all numbers in the range must match.

A range variable cannot be defined in terms of another range variable.

A range variable cannot be defined in terms of a matrix or vector.


Using range variables to evaluate expressions
REPEATEDLY EVALUATING AN EXPRESSION

Use range variables to repeatedly evaluate an expression over a range of values as shown below.  Mathcad evaluates the expression once for each value of the range variable.


If you use two or more range variables in an equation, Mathcad evaluates the equation once for each value of each range variable. This is useful when defining matrices:


ITERATION OVER A RANGE OF VALUES

Any calculation you can perform once, you can perform over a range of values. For example, suppose you want to create a list of x and y values for points on the polar curve r=cos(q) + 1. The basic idea is as follows:

    q should take on values between 0 and 2p. Define q as a range variable or as a vector.

    For each q, the corresponding r is given by r=cos(q) + 1.

    For each r and q, there is a corresponding x and y given by x=r*cos(q) and y=r*sin(q).

This can be done using functions or by defining vectors.

Using functions:	Using vectors:


ENTERING A TABLE OF VALUES

To enter a set of numbers in a table:

Define a range variable.

Type the name of the table.

Press the left bracket "["to create a subscript.

Enter the range variable in the placeholder.

Type a colon (:).

Type the first value in the table.

Type a comma.

Type the second value in the table followed by another comma.

Repeat until the table is filled.

When you enter a table of numbers, you are actually assigning elements to a vector.


EDITING AN INPUT TABLE

To insert a value in the middle of a table:

    Click on the value immediately above wherever you want to insert the new value.

    Type a comma.

    Enter another value into the placeholder.

To add a value at the end of a table:

    Click on the last value in the table.

    Type a comma.

    Enter another value into the placeholder.

To replace or delete a value from a table:

    Enclose the value you want to replace or delete.

    Press the Delete key on your keyboard.

    Type a new value in the placeholder or press Delete again to delete the value completely.


Values allowed in input tables

Each value in an input table must be one of the following:

    A number (or an expression that returns a number).

    An array (or an expression that returns an array).

Each value in an input table must have the same units, if any.


Make sure you don't enter more numbers than there are values taken by your range variable.

For example, if you define the range variable

m := 0..8

Don't enter more than nine values into the table.


DIFFERENCE EQUATIONS

You can use range variables in conjunction with arrays to evaluate a difference equation. The following example shows how to fill an array with Fibonacci numbers.


SYSTEM OF DIFFERENCE EQUATIONS

The following example shows how to generate a coupled set of difference equations:


GRAPHING A MATH EXPRESSION

To graph a math expression:

Define a range variable for the range of values over which to plot the math expression.

Press @ to create a plot.

Click in the middle placeholder on the x-axis.

Type the range variable.

Click in the middle placeholder on the y-axis.

Type the math expression.

Click outside the plot.

Mathcad graphs one point for each value of the range variable and, unless you specify otherwise, connects them with straight lines.

You can graph any expression against any other expression, as long as they share the same range variables. You can also graph more than one curve on a graph.

You can also graph more than one expression on a plot.


GRAPHING A VECTOR

To graph the elements of a N element vector:

Define a range variable from 1 to N.

Press @ to create an xy plot.

Place the subscripted vector on one axis and the range variable on the other.

Graphing one vector against another is useful for plotting data points.


EVALUATING AN EXPRESSION OVER A RANGE

Mathcad  can do repeated or iterative calculations as easily as individual ones by using a range variable, a variable that takes on a sequence of values.

To compute equations for a range of values:

Define a range variable.

Evaluate an expression involving the range variable.


VECTOR AND MATRIX OPERATORS

The following operators have special meanings for vectors and matrices. Many of these operators are available from the symbol palette, but all have corresponding keystrokes. Note that operators which expect vectors always expect column vectors rather than row vectors.

addition	+

cross product	Ctrl+8

determinant	|

inner (dot) product	*

inverse	^-1

negation	-

powers of matrix	^

magnitude	|

multiplication	*

subscript (vector)	[

subscript (matrix)	[

subtraction	-

sum elements	Ctrl+4

superscript	Ctrl+6

transpose	Ctrl+1

vectorize	Ctrl+-


Matrix inverse operator
MATRIX INVERSE	Press ^-1

This returns the inverse of a matrix. If M does not have an inverse, you'll see an appropriate error message.

Operands:

M is a square matrix having an inverse.

.


Vector subscript operator
VECTOR SUBSCRIPT	Press [

This returns the nth element of v. If v has no nth element, you'll see an appropriate error message.

Operands:

v is a vector (an array with one column).

n is a dimensionless integer.

Keep in mind that all arrays start at 1 by default, not 0. For a vector with 10 elements, n must run between 1 and 10. To change this, choose Options / Built-In Variables tab from the Math menu and change ORIGIN.

Use subscripts when graphing vectors.


Matrix subscript operator
MATRIX SUBSCRIPT	Press [

This returns the mnth element of M. If M has no mnth element, you'll see an appropriate error message.

Operands:

M is an array.

m and n must be dimensionless integers.

Keep in mind that all arrays start at 0 by default, not 1. For a matrix with 10 rows and 5 columns,

m must run between 0 and 9

n must run between 0 and 4

To change this, choose Options / Built-in Variables tab from the Math menu and change ORIGIN.


Array addition operator
ADDITION	Press +

A + B	Adds the elements of A to the corresponding elements of B.

A + x	Adds x to every element in A.

Operands:

A and B are arrays with the same number of rows and columns.

The elements of A and B must have the same dimensions.

x is any scalar, real or complex.

x must have the same dimensions as the elements of A.


Vectorize operator
VECTORIZE OPERATOR	Press Ctrl+ -

Changes the meaning of operators and functions so that they apply to every element of an array. This allows you to perform calculations in parallel.

Operands:

A and B are arrays with the same number of rows and columns.

EXAMPLES

To perform matrix multiplication of A and B, you would see

To multiply each element of A by the corresponding element in B.

To vectorize an expression,

Place the expression between the editing lines.

Press Ctrl+-.


Cross product operator
VECTOR CROSS PRODUCT	Press Ctrl+8

Returns the vector cross product of u and v.

Operands:

Both u and v are three element column vectors.

 is a vector with the following properties:

Its direction is orthogonal to u and v in the direction determined by the right hand rule.

Its magnitude is | u || v |sin( [image]) where [image] is the angle between u and v.


Inner product operator
VECTOR INNER PRODUCT	Press *

Returns the vector inner product (sometimes called a "dot product") of u and v.

Operands:

Both u and v are vectors having the same number of elements.

The inner product (or dot product) is a scalar formed by multiplying corresponding elements of u and v and summing the results. The inner product has the following properties:

=| u || v |cos(q) where q is the angle between u and v.

When u and v are orthogonal, their inner product is zero.

The inner product of u with itself is simply the square of the length of u.


Negation operator for arrays
NEGATE AN ARRAY 	Press -

-A	This returns an array the same size as A containing the negative of each element of A. It is equivalent to multiplying A by -1.

Operands:

A is an array


Matrix exponentiation operator
MATRIX POWERS	Press ^

Depending on n, this returns one of the following:

If n = 0 this returns the identity matrix whose dimensions match those of M.

If n = 1 this just returns M.

If n = -1 this returns inverse of M if it exists.

If n is a positive integer this multiplies M by itself n times.

If n is a negative integer this multiplies the inverse of M by itself n times.

Operands:

M is square.

n is a dimensionless integer.

Matrix powers can be evaluated symbolically. To do so:

Select the expression to evaluate.

Choose Simplify from the Math menu.


Matrix multiplication operator
MATRIX MULTIPLICATION	Press *

Returns the matrix product of A and B.

Operands:

If A is an m x n matrix

B is an n x p matrix

SPECIAL CASES

If A is a matrix and x is scalar, then the product of A and x is a matrix in which each element of A has been multiplied by x.

To get the term by term product of two equal size arrays A and B, select the entire expression and press Ctrl+- to insert the vectorize operator.


Array subtraction operator
SUBTRACTION 	Press -

A - B	Subtracts the elements of B from the corresponding elements of A. A and B must have the same number of rows and columns.

A - x	If A is an array and x is a scalar then A - x is an array formed by subtracting x from every element in A.

Operands:

A and B are matrices having the same number of rows and columns.

x is a scalar.


Sum elements of a vector
SUM ELEMENTS OF A VECTOR	Press Ctrl+4

v	Returns the sum of all the elements in the vector v.

Operands:

v is a vector.


Superscript operator
SUPERSCRIPT OPERATOR 	Press Ctrl+6

This returns the nth column of the array M. If M has no nth column, you'll see an appropriate error message.

Operands:

M must be an array

n is a scalar. It may not be complex

Keep in mind that all arrays start at 1 by default, not 0. For a matrix with 10 columns, n must run between 1 and 10. To change this, choose Options / Built-in Variables tab from the Math menu and change ORIGIN.

EXAMPLE

To get a row from a matrix, use this in conjunction with the transpose operator. For example, to get the first row from a matrix M, type M Ctrl+1 Ctrl+6 1


Transpose operator
TRANSPOSE 	Press Ctrl+1

This returns the n x m array formed by interchanging rows and columns of an m x n array.

Operands:

M is an m x n array.

Although you  can use the matrix transpose operator to find matrix transposes numerically,  you can also find matrix transposes symbolically.


Determinant operator
DETERMINANT	Press |

| M |	Returns the determinant of a square matrix.

Operands:

M is a square matrix.

To take the magnitude of each element in a matrix,

Place the | M | between the editing lines.

Apply the vectorize operator, Ctrl+-.

Although you  can use the determinant operator to find numerical determinants,  you can also find symbolic determinants.


Non-singular matrices

A matrix is non-singular when its rows are linearly independent. In other words, no row can be a linear combination of the other rows.

Sometimes, a matrix can be almost singular. In other words, there exists a linear combination of the other rows which comes very close to reproducing one of the rows. When this happens, significant difficulties can occur in numerically computing an inverse.


Vector magnitude operator
VECTOR MAGNITUDE 	Press |

| v |	Returns the magnitude of the vector v. This is the square root of the sum of the squared magnitude of the elements in v.

Operands:

v is a vector

To take the magnitude of each element in a vector,

Place the | v | between the editing lines.

Apply the vectorize operator, Ctrl+-.


Matrix division operator
MATRIX DIVISION	Press /

Divides every element of A by x.

Operands:

If A is a matrix

x is a nonzero scalar

To divide every element of an m x n matrix A by the corresponding element of another m x n matrix B select the entire expression and press Ctrl+- to insert the vectorize operator.


LINEAR REGRESSION

These functions return the slope and intercept of the line that best fits your data in a least square sense. If you place your x values in the vector vx and your sampled y values in vy, that line is given by:    y = slope(vx,vy)*x + intercept(vx,vy).

slope(vx,vy)	Slope of line that best fits data in vx and vy.

intercept(vx,vy)	Intercept of line that best fits data in vx and vy.

Arguments:

vx is a vector of real data values in ascending order for the intercept function. vx is a vector of real data values for the slope function. The values in vx correspond to the x values.

vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

The example below illustrates how to do linear regression:

Note that the slope and intercept function are useful not only when your data is inherently linear but when it is exponential as well.


LINEAR COMBINATION OF FUNCTIONS

The linfit function is useful when you have a set of measured x and y values and you want to model your data with a linear combination of arbitrary functions.

linfit(vx,vy,F)	Returns a vector containing the coefficients used to create a linear combination of the functions in F which best approximates the data in vx and vy.

Arguments:

vx is a vector of data values. These correspond to the x values.

vy is a vector of data values. These correspond to the y values. The number of elements is the same as vx.

F is a function that returns a vector.

The example below illustrates the use of linfit:


More specifically, if your x and y are related by:

You can apply these the slope and intercept to the log of your data values and make use of the fact that:

In which case:

The resulting fit weighs the errors differently from a least-squares exponential fit but is usually a good approximation.


FITTING ARBITRARY FUNCTIONS TO DATA

The genfit function is useful when you have a set of measured x and y values and you want to fit an arbitrary function to your data.

genfit(vx,vy,vg,F)	A vector containing the parameters that make a function f of x and n parameters best approximate the data in vx and vy.

Arguments:

vx is a vector of data values. These correspond to the x values.

vy is a vector of real data values in ascending order. These correspond to the y values. The number of elements is the same as vx.

vg is an n element vector of guess values for the n parameters.

F is a function that returns an n + 1 element vector containing the function f and its partial derivatives with respect to its n parameters.

n is an integer.

The example below illustrates the use of genfit:


CURVE FITTING

There are five kinds of curve fitting discussed here:

Linear regression: Finding the line that best fits a set of data points.

Polynomial regression: Finding the polynomial that best fits a set of data points.

Multivariate polynomial regression: Finding the polynomial surface that best fits a set of points.

Linear combination of functions: Finding the coefficients that make a linear combination of functions best fit a set of data points.

Fitting arbitrary functions to data: Finding the parameters that make a function best fit a set of data points.


Other regression techniques:

Linear combination of functions

Linear regression

Polynomial regression

Multivariate polynomial regression

Fitting arbitrary functions to data


POLYNOMIAL REGRESSION

The functions described below are useful when you have a set of measured y values corresponding to x values and you want to fit a polynomial to those y values. Regress lets you fit a single polynomial or any order. Loess tries to fit different second order polynomials depending on where you are on the curve.

regress(vx,vy,k)	Returns a vector which interp uses to find the kth order polynomial that best fits the x and y data values in vx and vy.

loess(vx,vy,span)	Returns a vector which interp uses to find a set of second order polynomials that best fit a neighborhood of the x and y data values in vx and vy. span controls the size of the neighborhood.

interp(vs,vx,vy,x)	Returns interpolated y value corresponding to x. You get vs from loess or regress.

Arguments:

vx is a vector of real data values in ascending order. These correspond to the x values.

vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

vs is a vector generated by either loess or regress.

k is a positive integer specifying the order of the polynomial you want to use to fit the data. Usually you'll want k < 5.

span is a positive real number for specifying how big a neighborhood you want to use. Use larger values of span when the data behaves very differently over different ranges of x. A good default value is span=0.75.

x is the value of the independent variable at which you want to evaluate the regression curve.

 (regress)

 (loess)


MULTIVARIATE POLYNOMIAL REGRESSION

You can use regress and loess  when you have a set of measured z values corresponding to x and y values and you want to fit a polynomial surface through those z values.

regress(Mxy,vz,k)	Returns a vector which interp uses to find the kth order polynomial surface that best fits the x, y and z data values specified in Mxy and vz.

loess(Mxy,vz,span)	Returns a vector which interp uses to find a set of second order polynomial surfaces that best fit the x, y and z data values specified in Mxy and vz within a neighborhood of the x and y data values. span controls the size of this neighborhood.

interp(vs,Mxy,vz,v)	Returns the z value corresponding to the x and y values you supply in v.

Arguments:

Mxy is an m x 2 matrix containing x and y coordinates.

vz is an m element vector containing the z coordinates corresponding to the m points specified in Mxy.

vs is the vector generated by either loess or regress.

n is a positive integer specifying the order of the polynomial surface you want to use to fit the data. Usually you'll want k < 5.

span is a positive real number for specifying how big a neighborhood you want to use. Use larger values of span when the data behaves very differently over different ranges of x. A good default value is span=0.75.

v is a two element vector whose elements are the x and y values at which you want to evaluate the corresponding z coordinate on the regression surface.


Using loess and regress in higher dimensional spaces

The description of loess and regress you just saw is slanted toward the problem of fitting a two dimensional surface to a set of data points (x, y and z). You can also fit an n-dimensional polynomial surface to a set of points (x1, x2, ...xn, z) by doing the following:

Each additional independent variable requires another column in Mxy.

Each additional independent variable requires another row in v.

Limitations:

loess

regress


loess

The loess function is restricted to at most four independent variables.


regress

The regress function can have any number of independent variables. However when there are more than four independent variables or when the degree of the polynomial surface exceeds four, regress will take substantially more memory and will calculate more slowly.

Additionally, the number of data values, m must satisfy:


Regress returns a vector in which the first three elements are values used by the interp function. The remaining elements are the coefficients of the best fitting polynomial of degree k.


Related Topics:

MathSoft's Electronic Books

Browsing through an Electronic Book

Copying information from an Electronic Book

Searching through an Electronic Book

Electronic Book palette

Making notes in an Electronic Book

Additional Electronic Books


Related Topics:

MathSoft's Electronic Books

Making notes in an Electronic Book

Highlighting your annotations

Changing the color of highlighted edits

Saving changes in your Electronic Book

Restoring the original copy of your Electronic Book

Viewing the original copy of your Electronic Book


Related Topics:

Creating the animation

Playing the animation

Saving the animation

Playing back a previously saved animation

Animation examples


Related Topics:

Numbers > 999

Exponential notation

Imaginary numbers

Complex numbers

Octal numbers

Hexadecimal numbers


Related Topics:

Creating an X-Y plot

Graphing an expression

Graphing a vector

Controlling which points to plot

Axis limits

Axis settings

Axis labels

Trace settings

Legends

Zooming in on a plot

Getting a readout of plot coordinates

Titles

Deleting a plot

Moving a plot

Changing the size of a plot

Default Settings


Related Topics:

Creating a plot

Controlling which points to plot

Axis settings

Trace settings

Axis labels

Legends

Zooming in on a plot

Getting a readout of plot coordinates

Titles

Deleting a plot

Moving a plot

Changing the size of a plot

Default settings


Related Topics:

Creating a surface plot

Parametric surface plots

Deleting a surface plot

Moving a surface plot

Changing the size of a surface plot

View settings

Axis settings

Color and line setting

Adding a title to a surface plot


Related Topics:

Creating a contour plot

Deleting a plot

Moving a plot

Changing the size of a plot

View settings

Axis settings

Color and line settings

Adding a title to a contour plot


Related Topics:

Creating a 3D bar chart

Deleting a 3D bar chart

Moving a 3D bar chart

Changing the size of a 3D bar chart

View settings

Axis settings

Color and line setting

Adding a title to a 3D bar chart


Related Topics:

Creating a vector field plot

Deleting a plot

Moving a plot

Changing the size of a plot

Axis settings

Adding a title to a vector field plot


Related Topics:

Creating a 3D scatter plot from 3 data vectors

Creating a 3D scatter plot from a matrix of data values

Deleting a 3D scatter plot

Moving a 3D scatter plot

Changing the size of a 3D scatter plot

View settings

Axis settings

Color and line setting

Adding a title to a 3D scatter plot


Related Topics:

Controlling calculation

Automatic calculation mode

Manual calculation mode

Turning equations on and off

Interrupting calculation

Avoiding undefined expressions

Making a pass through your worksheet

Superseding the order of evaluation

Doing calculations in parallel


Related Topics:

Evaluating an expression

Defining a variable

Defining a function

Defining a variable or function globally

Defining variables simultaneously

Evaluating a function

Controlling the display of numbers

Avoiding undefined expressions

Making a pass through your worksheet


Related Topics:

Deleting a graphics region

Moving a graphics region

Resizing a graphics region

Selecting a graphics region


Related Topics:

Controlling the display of all results

Controlling the display of a particular result

Viewing results in full precision


Related Topics:

Changing the font for all variables

Changing the font for all constants

Modifying a math style

Applying a math style to a particular variable or constant

Typing Greek letters


Related Topics:

Copying a numerical result

Limitations on copying numerical results

Copying a matrix

Copying from a table of numbers

Copying from a scrolling output table


Related Topics:

Printing a worksheet

Changing printers

Headers and footers

Margins

Page numbering

Page breaks

Print preview

Printing selected pages

Printing selected regions

Wide worksheets


Related Topics:

Headers and Footers

Current date/time

Worksheet name

Page numbers


Related Topics:

Selecting Regions

Selecting everything between two regions

Separating regions

Aligning regions horizontally or vertically

Moving regions

Deleting regions

Inserting and deleting blank lines


Related Topics:

Characters allowed in variable and function names

Restrictions on variable and function names

Changing a name


Related Topics:

The Mathcad desktop

Entering equations

Entering text

Creating an XY graph

Inserting graphics images


Plot Types:

Two-dimensional

XY Graphs

Polar plots

Three-dimensional

Surface plots

Contour plots

3D bar charts

Scatter plots

Vector field plots


Related Topics:

Matrix powers

Matrix inverse

Symbolic matrix operations


Related Topics:

Matrix addition

Matrix subraction

Matrix multiplication

Matrix division


Related Topics:

Extracting elements, rows, and columns

Extracting arrays

Superscript operator

Matrix subscript

Vector subscript


Related Topics:

Dimensions of a matrix

Length of a vector

Maximum and minimum elements


Related Topics:

Joining arrays

Extracting arrays

Extracting elements, rows, and columns


Related Topics:

Copying values from an output table

Scrolling output tables

Displaying vectors and matrices

Evaluating a function

Iteration over range variables

Converting units on a table


Related Topics:

Integration operator

Symbolic integration- an alternative method

Numerical method accuracy


Related Topics:

Derivative operator

Symbolic derivation- an alternative method

Numerical method accuracy


Related Topics:

Root function

Root function algorithm

Hints on using the root function

Solving one equation in one unknown

Numerical method accuracy


Related Topics:

Division operator

Multiplication operator


Related Topics:

Solving a system of nonlinear equations

Approximate solution to a system of nonlinear equations

TOL constant


Related Topics:

fft and ifft

cfft and icfft

FFT and IFFT

CFFT and ICFFT

fft/ifft vs. cfft/icfft

Frequencies corresponding to coefficents

Aliasing

Two dimensional fft's

Power and phase spectrum


Related Topics:

Sorting in ascending order

Sorting columns

Sorting rows

Reversing the order of elements

Vectors and matrices


Related Topics:

Conditional branching

Iteration

Kronecker delta function

Antisymmetric tensor function

Heaviside step function


Related Topics:

Mantissa of a number

Roundoff

Truncation functions


Related Topics:

Opening the Resource Center

Browsing through the Resource Center

Browsing the Web with the Resource Center

Searching through the Resource Center

Copying information from the Resource Center

Making notes in the Resource Center


Related Topics:

Highlighting an equation

Changing the highlight color

Printing a highlighted equation


Related Topics:

Creating vectors and matrices

Computing with arrays

Changing the size of an array

Joining arrays

Extracting elements, rows, and columns

Beginning arrays at an element other than zero

Extracting arrays

Displaying vector or matrix results

Limits on array sizes

Creating nested arrays


Related Topics:

Symbolic algebra

Symbolic calculus

Solving equations symbolically

Using functions or variables

Symbolic matrix algebra

Symbolic transforms

Display of symbolic results

Live symbolic evaluation

Using keywords for live symbolic evaluation

Using several keywords


Related Topics:

Special functions

Numerical results with symbolics

Solving equations numerically

Solving equations symbolically

Solving a system of equations symbolically

Live symbolic evaluation


Related Topics:

Symbolic differentiation

Numerical differentiation

Symbolic integration

Numerical integration

Large answers

Numerical results with symbolics

Special functions


Related Topics:

QR decomposition

LU decomposition

Singular value decomposition

Cholesky decomposition


Related Topics:

Creating nested arrays

Displaying nested arrays

Creating vectors and matrices

Nested array operators and functions


Related Topics:

Determinant operator

Matrix inverse operator

LU decomposition function


Related Topics:

Ordinary differential equations

Systems of differential equations

Differential equations with special properties

When you want only the last point

Two point boundary value problems

Partial differential equations


Related Topics:

Defining a string variable

Defining a string function

Strings as array elements

Concatenating strings

Finding the length of a string

Converting a string to a number

Converting a number to a string

Converting a vector to a string

Converting a string to a vector

Extracting substrings

Locating substrings

Defining error messages using a string


3D SCATTER PLOTS

Three-dimensional scatter plots allow you to visualize x, y, and z coordinates in space. This makes them useful for drawing parametric curves or for observing clusters of data in 3D space. You can control the symbol and color used for representing the data points and whether the points are connected with a line. You can also change a 3D scatter plot into another type of 3D plot.

Creating a 3D scatter plot from 3 data vectors

Creating a 3D scatter plot from a matrix of data values

Deleting a 3D scatter plot

Moving a 3D scatter plot

Changing the size of a 3D scatter plot

View settings

Axis settings

Color and lines settings

Adding a title to a 3D scatter plot

Animating a 3D scatter plot


Creating a scatter plot from 3 data vectors
CREATING A 3D SCATTER PLOT FROM 3 DATA VECTORS

To create a 3D scatter plot using the x, y and z coordinates contained in three vectors:

Define three vectors, each having as many elements as you have points to plot.

Choose Graph / 3D Scatter Plot from the Insert menu.

Place the names of the vectors in the placeholder.

See Mathcad Quicksheets for an example.

If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.


Creating a scatter plot from a matrix of data values
CREATING A 3D SCATTER PLOT FROM A MATRIX OF DATA VALUES

To create a 3D scatter plot using a matrix of data values:

Define the matrix.

Choose Graph / 3D Scatter Plot from the Insert menu.

Place the name of the matrix in the placeholder.


VIEW SETTINGS (3D SCATTER PLOTS)

To modify the general presentation of your plot:

Double-click on a plot to open a tabbed dialog box.

Click on the View tab.

The View page has the following options. Click on an option to learn more about it.

Rotation

Tilt

Axes style

Show border

Show box

Show back planes

The View page also has options that allow you to change any 3D scatter plot into another type of 3D plot:

Surface plot

Contour plot

3D bar chart

When you view a scatter plot as another type of 3D plot, Mathcad actually interpolates a surface that approximates your scatter data, using a 21x21 mesh by default.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D scatter plot displayed with different view options.


AXIS SETTINGS (3D SCATTER PLOTS)

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the Axes tab.

The Axes page shows each axis having the following check boxes associated with it. Click on an option to learn more about it:

Grid lines

Numbered

Auto grid

Autoscale

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D scatter plot displayed with different axis settings.


COLOR AND LINE SETTINGS (3D SCATTER PLOTS)

To define the shading of the surface:

Double-click on a plot to open a tabbed dialog box.

Click on the Color & Lines tab.

The Color & Lines page has the following options for specifying the markers on the plot. Click on an option to learn more about it:

Symbol

Color

Size

The page has the following options for specifying how the markers on the plot change as their heigts change. Click on an option to learn more about it:

Color

None

Grayscale

The tab also has the following check boxes for any line that might connect the markers. Click on an option to learn more about it:

Style

Color

Weight

Connectivity

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a 3D scatter plot displayed with different color and line settings.


ADDING A TITLE TO A 3D SCATTER PLOT

To add a title to a 3D scatter plot:

Double-click on a plot to open a tabbed dialog box.

Click on the Title tab.

In the text box on the Title page, type the title. You can use upper- and lowercase letters in the title.

Click on either the "Above" or "Below" button. Then click "OK" to display the title of the graph region or "Cancel" to restore the title text box to its original state.

Click on "Show Title" to toggle it off if you don't want the title to appear on your graph. Or backspace over the title to remove it from the text box and to delete it from the graph.


Rotation must be between 0 and 360 degrees.

Rotation = 0

You look directly down the x axis.

Rotation = 90

You look directly down the y axis.


Tilt must be between 0 and 360 degrees.

Tilt = 0

You see the view that you would see if you were standing on the xy plane.

Tilt = 90

You see the view that you would see if you were flying over the xy plane and looking directly down the z-axis.


Contour Plot

When this button is clicked, the 3D scatter plot is converted into a contour plot that shows a visible interpolated representation of the level curves formed by the points you've plotted.


3D Bar Chart

When this button is clicked, the 3D scatter plot is converted into a 3D bar chart with a bar at each x,y value having a height proportional to the corresponding z value.


Surface Plot

When this button is clicked, the 3D scatter plot is converted into a surface plot that shows a three-dimensional representation of the (x,y,z) coordinates you've specified. This appears as a two-dimensional surface in three-dimensional space.


Show Border

When checked, the 3D scatter plot is enclosed in a rectangle.


Show Box

When checked, the 3D scatter plot is enclosed in a bounding box.


Show Back Planes

When checked, the 3D scatter plot has xy, xz, and yz back planes. Use the "Fill Color" and "Edge Color" buttons to add color to the back planes so that the scatter plot stands out more clearly.


Axes Style

This controls whether the axes appear at the front perimeter of the plot (perimeter), whether they intersect in the back left of the plot (corner), or whether they appear at all.


Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by grid lines. Grid lines will have the same color as the edge color of back planes.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 1 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Autoscale

By default, the axis limits are set with the Autoscale option. This causes axis limits to be set according to the data ranges in the three input vectors.

With Autoscale off, the axis limit is set right at the data limits. You can redefine this axis limit by entering values in the Max. Val. and Min. Val. text boxes. If you created a 3D scatter plot from a matrix, however, you can set only the z axis limits.

To turn off Autoscale and have your plot drawn to the ends of the plot region:

Click on the "Autoscale" check box for the appropriate axis to toggle it off.

Enter the maximum and miminum values in the Max. Val. and Min. Val. text boxes.

If you are setting up a 3D scatter animation sequence, you may want to turn Autoscale off.


Symbol

This list controls whether the symbols that mark points in the plot are o's, x's, +'s, boxes, or diamonds. You can also enter "none"; however, if you do and you aren't using a connecting line, your plot will be blank.


Color

This list controls the colors of the symbols used as markers on your plot. Markers can be any of the colors listed on the drop-down list, for example, red, blue, green, magenta, cyan, brown, black, and white.


Size

This list controls the size of the symbols used as markers on your plot. Markers can range in size from 1 (thinnest) to 10 (thickest).


Color

When this button is clicked, the colors on the markers differ according to their height from the xy plane. The lowest points on the scatter plot are blue, with colors progressing through green and yellow to red.


None

When this button is selected, the shading of the markers on the plot doesn't change with their height.


Grayscale

When this button is selected, the markers on the plot are in grayscale that changes according to their height. The lowest points on the scatter plot are black and the highest are white. Those in between are appropriate shades of gray.


Style

This controls whether the line is solid, dotted, dashed, or whether it consists of alternating dashes and dots.


Color

This controls whether the selected trace is red, blue, green, magenta, cyan (a light blue), brown, black, or white.


Weight

This controls how thick the curve is. Use 1 for fine curves and 9 for thick curves. Use "p" to make the finest possible curve, a single pixel wide. Keep in mind that a "p" curve may not print on printers with inadequate resolution.


Connectivity

This controls how the line connects the markers in the plot. Click one of the following options:

No line

In the order in which the points occur in the vectors

By increasing x values

By increasing y values

By increasing z values


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed on the screen.


The values in the matrix are the values of z. The row and column indices are the corresponding values of x and y. The matrix you define must have at least two rows or two columns.


Interpolated Mesh

This option becomes available when 3 vectors are used to create a surface or contour plot. The surface is fitted over a 21x21 grid of points. To change the number of points in the grid, enter new numbers in the No. of Rows and No. of Columns text boxes. Increasing the density of the mesh will often lead to a smoother fit.


IMPORTING GRAPHICS

Although you cannot draw pictures in Mathcad, you can import almost any graphic created in another application into a Mathcad worksheet. You can import a graphic as a bitmap or as an OLE object. Image processing functions provide ways to import a graphics image as a matrix, manipulate it, and export it as a graphics image file.

Importing bitmaps from the clipboard

Importing a graphics image by dragging and dropping

Importing a bitmap from a file

Inserting a graphics object

Editing a graphics image

Deleting a graphics image

Moving a graphics image

Changing the size of a graphics image

Image processing

Framing a graphics image


IMPORTING BITMAPS FROM A FILE

You can insert graphics into your worksheet by referring to a file containing the graphics instead of by pasting from the clipboard. This offers a number of advantages.

To insert a graphic from a bitmap file:

Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

Type the double quotes key (“) to create a string. You will see an insertion point between double quotes.

Type the name of the bitmap file.

If you change the file on disk, you must click in the graphics region and choose Calculate from the Math menu to update your worksheet.

Two alternative methods for importing a bitmap from a file are to:

Read the file in as a matrix of data.

Insert the file as an object.


IMPORTING BITMAPS FROM ANOTHER DIRECTORY

By default, the name you put in the placeholder is the filename of a graphics file in the current directory. To import a graphics file from another directory:

Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

Type the double quotes key (“) to create a string. You will see an insertion point between double quotes.

Enter the full pathname to the bitmap file. Or, if the file is located in the current directory, simple enter the name of the file rather than the full pathname.


FRAMING A GRAPHICS IMAGE

To place a box around an imported graphics image:

Click on the image with the mouse button.

Choose Properties from the Format menu and click on the Display tab.

Click on the box labeled "Show border".


RESTORING A GRAPHICS IMAGE TO ITS ORIGINAL SIZE

If you've resized a graphics image, you can restore it to its original size and aspect ratio as follows:

Click on the image with the mouse button.

Choose Properties from the Format menu and click on the Display tab.

Click on the box labeled "Use original size".

Click outside the graphics image.


IMAGE PROCESSING

Image processing can be broken down into four steps:

Reading the image into a matrix...

Performing mathematical transformations on the matrix...

Displaying the resultant image...

Saving the image...


READING THE IMAGE INTO A MATRIX

The first step in image processing is to have an image to process. You can do this by reading the image from the disk and into a matrix just as you would read in any data file.

There are two options:

Use READRGB or another function to create a matrix corresponding to a file. For example:

M := READRGB(“file”)

Use READBMP or another function to create a matrix corresponding to the grayscale representation of a particular file. For example:

M := READBMP(“file”)

Note that the names of the functions must be in UPPERCASE.


This should be an m x 3n matrix. You can think of this as three m x n matrices placed side by side as follows:

The first n columns represent the red component of the m x n image in "file". The second and third sets of n columns represent the green and blue components of the same image.


This should be an m x n matrix, each element of which corresponds to a pixel. The elements of the matrix are numbers representing the amount of grayness associated with the corresponding pixel.

The meaning of the numbers is as follows:

0 means black and 255 means white.

Numbers between 0 and 255 correspond to levels of gray.

Numbers less than 0 and greater than 255 are treated as modulo 255.

Non-integers are rounded to the nearest integer.


IMAGE TRANSFORMATIONS

Once you've read the image into a matrix using READBMP or READRGB you can use all available math tools to modify that image. The examples below should give you some ideas:

Rotating an image...

Inverting an image...

Turning up the contrast...


Rotating an image


Inverting an image


Enhancing image contrast


Displaying the image in a picture region
DISPLAYING THE IMAGE

There are two options. The one you choose depends on whether you read the image into a matrix using READBMP or READRGB:

If you used READBMP to create the image matrix...

If you used READRGB to create the image matrix...


DISPLAYING AN IMAGE CREATED BY READBMP

If you used READBMP to create the matrix containing the image, you display it as follows:

Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

Type the name of the matrix into the placeholder.


DISPLAYING AN IMAGE CREATED BY READRGB

If you used READRGB to create the matrix containing the image, you display it as follows:

Separate the matrix into its red, green and blue components as shown in the example below:

Click the mouse wherever you want to put the image and choose Picture from the Insert menu.

Type the names of the red, green and blue matrices, separated by commas, into the placeholder. Or, if you want to display only the red components, for example, you must still include the three matrices but the green and blue matrices should contain zeros.

If later you want to recombine the three submatrices, create and use the following function based on the augment function:  augment(X,Y,Z):=augment(X,augment(Y,Z))


Make sure you type the matrices in the right order. If you mix up the order, the colors may be inverted. You can see this at the bottom of the example on this page.


SAVING THE IMAGE TO DISK

The transformed image will generally be in a matrix. To make this image available to other applications, you need to save it as a disk file. There are two ways to do this:

To save the image in color...

To save only grayscale information...


SAVING AN IMAGE IN COLOR

To save a color image to disk file, use the WRITERGB or another function as follows:

Make sure the matrix containing the image is in the proper format.

Type the following, substituting the name of your matrix and the name of the file you're writing to:

WRITERGB(“file”):=A

Note that the names of the functions must be in UPPERCASE.


SAVING A GRAYSCALE IMAGE

To save a grayscale image to disk file, use the WRITEBMP function as follows:

Make sure the matrix containing the image is in the proper format.

Type the following, substituting the name of your matrix and the name of the file you're writing to:

WRITEBMP(“file”):= A

Note that the names of the functions must be in UPPERCASE.


READING A BMP FILE AS A GRAYSCALE IMAGE

READBMP(“file”)	Returns an array of integers between 0 (black) and 255 (white) representing a grayscale version of the image in file.

Arguments:

file is either the filename of a BMP file located in the default directory or the full pathname to a BMP file.

file is entered as a string.

Once you have read a file into Mathcad, you can use the picture operator to view it.


Reading a BMP file as a color image
READING A FILE AS A COLOR IMAGE

READRGB(“file”)	Returns an array consisting of three nxn submatrices. Each element is an integer between 0 and 255. The first n/3 columns represent the red component of image in file. The second and third sets of n/3 columns represent the green and blue components of the same image. The three corresponding matrix elements, when taken together, establish the color of the pixel.

Arguments:

file is either the filename of a BMP, GIF, JPG, or TGA file located in the default directory or the full pathname to a BMP, GIF, JPG, or TGA file.

file is entered as a string.

The separation of the image into three sets of n/3 columns gives you greater flexibility to manipulate the image before displaying it. Before displaying it however, you should separate it into three separate n column matrices which you can then type, separated by commas, into the placeholder.

Once you have read a file into Mathcad, you can use the picture operator to view it.


CREATING A GRAYSCALE BMP FILE

WRITEBMP(“file”)	Writes an array to file. The array must be an array of integers between 0 and 255 inclusive.

Arguments:

file is either the filename of a BMP file located in the default directory or the full pathname to a BMP file.

file is entered as a string.


CREATING A COLOR BMP FILE

WRITERGB(“file”)	Writes an array to file. The array must be an array of integers between 0 and 255 inclusive containing 3n columns. The first n/3 columns represent the red component of image in the file file.bmp in the current directory. The second and third sets of n/3 columns represent the green and blue components of the same image.

Arguments:

file is either the filename of a BMP file located in the default directory or the full pathname to a BMP file.

file is entered as a string.


SPECIALIZED FUNCTIONS FOR READING IMAGE FILES

The specialized functions in the following table are used to read images in the following formats: BMP, GIF, JPG, and TGA.

Functions:

READ_IMAGE(“file”)	Creates an array containing a grayscale representation of the image file.

READ_HLS(“file”)	Creates an array in which the color information in file is represented by the appropriate values of hue, lightness, and saturation.

READ_HSV(“file”)	Creates an array in which the color information in file is represented by the appropriate values of hue, saturation, and value.

READ_RED(“file”)	Extracts only the red component from a color image.

READ_GREEN(“file”)	Extracts only the green component from a color image.

READ_BLUE(“file”)	Extracts only the blue component from a color image.

READ_HLS_HUE(“file”)	Extracts only the hue component from a color image.

READ_HLS_LIGHT(“file”)	Extracts only the lightness component from a color image.

READ_HLS_SAT(“file”)	Extracts only the saturation component from a color image.

READ_HSV_HUE(“file”)	Extracts only the hue component from a color image.

READ_HSV_SAT(“file”)	Extracts only the saturation component from a color image.

READ_HSV_VALUE(“file”)	Extracts only the value component from a color image.

Arguments:

file is either the filename of a BMP file located in the default directory or the full pathname to a BMP file.

file is entered as a string.

Use these functions in the same way you use the READBMP function to read an image.


SPECIALIZED FUNCTIONS FOR WRITING IMAGE FILES

The following specialized functions are used to create color BMP files out of matrices in which the image is stored in HLS or HSV:

WRITE_HLS(“file”)	Creates a color BMP file out of a matrix in which the image is stored in HLS format.

WRITE_HSV(“file”)	Creates a color BMP file out of a matrix in which the image is stored in HSV format.

Arguments:

file is either the filename of a BMP file located in the default directory or the full pathname to a BMP file.

file is entered as a string.

Use these functions in the same way you use the WRITEBMP function to write to a file.


Advantages of doing so are:

If several worksheets refer to the same picture, you only need one copy of that picture.

If you want to change a picture in several worksheets, you only have to change one picture file. You need not change every single worksheet.


This is the name of the bitmap file into which WRITERGB will place the data. If such a file already exists, WRITERGB will overwrite it.

WRITERGB assumes that this file is in the default directory. If you want to write to a file located elsewhere, you must type the full pathname to the file of interest.


This is the filename of the bitmap file into which WRITEBMP will place the data. If such a file already exists, WRITEBMP will overwrite it.

WRITEBMP assumes that this file is in the default directory. If you want to write to a file located elsewhere, you must type the full pathname to the file of interest.


This is the name of the file containing the image.

If this file is located someplace other than the default directory you must type the full pathname to the file of interest.


Aspect ratio

Ratio of length to width.


Related functions

READRGB	READBMP

WRITERGB	WRITEBMP

Specialized reading functions

Specialized writing functions


Related Topics:

Importing graphics from the clipboard

Importing graphics by dragging and dropping

Importing bitmaps from a file

Inserting graphics objects

Editing links

Editing a graphics image

Deleting graphics

Moving graphics

Changing the size of a graphics image

Restoring a graphics image to its original size

Image processing

Framing a graphics image


Related Topics:

Image processing

Reading the image into a matrix

Performing mathematical transformations on the matrix

Displaying the resultant image

Saving the image


INSERTING A GRAPHICS OBJECT

To insert a new graphic into your worksheet as an object:

Choose Object from the Insert menu to bring up the Insert Object dialog box.

Select an application in which to create it and click “OK.”

The graphic will be an embedded object.

To insert a graphic stored in an existing file:

Choose Object from the Insert menu to bring up the Insert Object dialog box.

Click “Create from File” and set the path to the file containing the graphic.

Click “Link” to link the graphic. Otherwise, the graphic will be embedded.


Insert Object Dialog Options


Insert Object Dialog Options


Create New

Lets you create a new graphic in the application you select.


Create from File

Lets you insert a graphic stored in a file you’ve already created.


Display as Icon

Displays the object as an icon.


Object Type

Lists the available applications in which to create an object.


Link

Links a graphic from an OLE server into your worksheet. When you make changes to a linked graphic, you change both the copy in Mathcad as well as the original.


Symbolic 0ptimization
SYMBOLIC OPTIMIZATION

Ordinarily, Mathcad evaluates an expression exactly as you type it in. It does so even if a little bit of simplification would have made the expression much easier to evaluate. The Optimization command in the Math menu, however, will force the numerical processor to make simplifications before it tries to evaluate. Click in the picture below to see what happens.

To optimize all equations in a worksheet:

Choose Optimization from the Math menu.

Once you do this, Mathcad submits all expressions to the symbolic processor before trying to evaluate them. If the symbolic processor finds a simpler form, it marks the expression with a red asterisk. To see the simplified form of the expression, double-click on the asterisk or choose Show Popup from the expression’s context menu. Mathcad uses this simpler form in all subsequent calculations.

If you want Mathcad to evaluate an expression exactly as you entered it without trying to first simplify it, click on the equation and choose Properties from the Format menu. Then click on the Calculation tab and click in the box next to “Enable Optimization” to remove the check.

If you want to optimize an individual expression rather than all expressions in the worksheet:

Click on the equation and choose Properties from the Format menu.

Click on the Calculation tab and click in the box next to “Enable Optimization” to place a check in the box.

Then If Mathcad optimizes the expression, it will place a red asterisk next to it. If Mathcad cannot optimize the expression, it marks the expression with a blue asterisk.


Symbolic 0ptimization
SYMBOLIC OPTIMIZATION

Ordinarily, Mathcad evaluates an expression exactly as you type it in. It does so even if a little bit of simplification would have made the expression much easier to evaluate. The Optimization command in the Math menu, however, will force the numerical processor to make simplifications before it tries to evaluate. Click in the picture below to see what happens.

To optimize all equations in a worksheet:

Choose Optimization from the Math menu.

Once you do this, Mathcad submits all expressions to the symbolic processor before trying to evaluate them. If the symbolic processor finds a simpler form, it marks the expression with a red asterisk. To see the simplified form of the expression, double-click on the asterisk or choose Show Popup from the expression’s context menu. Mathcad uses this simpler form in all subsequent calculations.

If for some reason you want Mathcad to evaluate the expression exactly as you entered it without trying to first simplify it, click on the equation and choose Properties from the Format menu. Then click on the Calculation tab and click in the box next to “Enable Optimization” to remove the check.

If you want to optimize an individual expression rather than all expressions, click on the equation and choose Properties from the Format menu. Then click on the Calculation tab and click in the box next to “Enable Optimization” to place a check in the box.


Symbolic evaluation using the symbolic equals sign
LIVE SYMBOLIC EVALUATION

Use the symbolic equal sign to symbolically evaluate an expression. To do so:

Type the expression you want to evaluate symbolically.

Press Ctrl +Period to insert the right arrow representing the symbolic equal sign.

Press Enter.

By default, the symbolic equal sign returns the same expression as that returned by choosing Evaluate Symbolically from the Symbolics menu. You can, however, change the meaning of the symbolic equal sign by preceding it with an appropriate keyword.


Modifying the live symbolic operator with keywords
MODIFYING THE LIVE SYMBOLIC OPERATOR

If you need to symbolically evaluate an expression in a particular way, use a keyword to modify the live symbolic operator. To do so:

Type the expression you want to evaluate symbolically.

Press Ctrl +Shift +Period to insert a placeholder and the symbolic equals sign.

Type a keyword in the placeholder. If the keyword takes another argument, type a comma followed by the argument. If there is more than one, type them separated by commas.

Press Enter.

The symbolic processor returns a result based on the keyword you typed. You can symbolically evaluate this result further by using several keywords.


Instead of pressing Ctrl+Shift+Period you can click on the Symbolic Keyword Palette on the Math Palette and use the Symbolic Keyword Evaluation button.


The Symbolic Keyword Palette

Instead of typing a keyword, you can use a keyword button in the Symbolic Keyword Palette. Click on the [image] button in the Math Palette to bring up the Symbolic Keyword Palette:

When you click on a keyword button, the keyword and placeholders for any arguments it can take will appear. Delete any placeholders that are for optional arguments you aren’t going to use.


USING SEVERAL KEYWORDS

To symbolically evaluate the result of a previous keyword, you can string several keywords together. There are two ways of doing this. One method shows the intermediate results from each keyword. The second method shows the final result after applying all the keywords.

To show intermediate results:

Type the expression you want to evaluate symbolically and press Ctrl +Shift +Period. Type a keyword.in the placeholder.

Press Enter to see the result from that keyword.

Press Ctrl +Shift +Period followed by another keyword.

Press Ctrl +Period followed by Enter to see the final result.

To apply several keywords but see only the final result:

Type the expression you want to evaluate symbolically and press Ctrl +Shift +Period. Type a keyword.in the placeholder.

Press Ctrl +Shift +Period to insert a vertical line and a placeholder.

Enter another keyword into the placeholder.

Press Ctrl +Shift +Period again to enter another keyword or press Enter to see the final result.


KEYWORD "simplify"

Use the simplify keyword to carry out basic algebraic simplification and to apply trigonometric and inverse function identities.

To simplify an expression assuming indeterminants are real, follow the keyword simplify with assume=real.

To simplify an expression assuming indeterminants are real and between the values a and b, follow the keyword simplify with assume=RealRange(a,b) where a and b are real numbers or infinity.

To simplify a trignomometric expression by applying only the following identities:

follow the keyword simplify with trig.

You can also simplify a result using the Simplify command on the Symbolic menu.

Other keywords...


KEYWORD "expand"

Use the expand keyword to expand all powers and products of sums in the selected expression. To expand an expression in a particular variable, follow the expand keyword with a comma and the variable.

You can also expand an expression using the Expand command on the Symbolic menu.

Other keywords...


KEYWORD "series"

Use the series keyword followed by a variable to expand an expression when that variable is set to zero.

To expand about a point other than zero, use the logical equals. For example:

x+y  series,x=2

will expand around the point x=2.

Other keywords...


KEYWORD "float"

Use the float keyword to make Mathcad return a floating point number rather than a symbolic result whenever possible.

To specify how many digits of precision to display, follow the float keyword with an integer.

Other keywords...


KEYWORD "factor"

Use the keyword factor to transform an expression into a product. This will transform:

a polynomial into a product of polynomials

an integer into a product of primes

a sum of rational expressions into a single fraction

To factor on a radical, follow the keyword factor with a comma and a radical or several radicals separated by commas.

Other keywords...


KEYWORD "assume"

To evaluate an expression based on certain assumptions, use the assume keyword.

If you want Mathcad to assume a variable is real, follow the keyword with var=real, where var is the variable.

If you want Mathcad to assume a variable is real between the real numbers a and b, follow the keyword with var=RealRange(a,b), where var is the variable.

Other keywords...


IGNORING DEFINITIONS

Ordinarily, Mathcad will use any previous definitions it finds in your worksheet when you are using live symbolic keywords.

If you want Mathcad to ignore all the definitions in your worksheet, you can symbolically evaluate an expression using commands from the Symbolics menu.

To force Mathcad to ignore some previously defined variables or functions you should define the variable recursively. For example, if you have x:=10 in your worksheet but you want Mathcad to ignore that definition when evaluating using live symbolics and assume x is undefined, type x:=x.

Other keywords...


KEYWORD "complex"

Ordinarily, Mathcad returns symbolic results in as simple a form as possible. Sometimes, particularly when working with complex numbers, it is more convenient to see results separated into real and imaginary parts. Use the keyword complex to make Mathcad return results in this form (a+i*b) whenever possible.

Other keywords...


Symbolic equal sign
SYMBOLIC EQUAL SIGN	Ctrl+.

To use the Symbolic equal sign to simplify an expression:

Enter the expression you want to simplify.

Press Ctrl+Period. Mathcad displays an arrow.

Click outside the expression. Mathcad displays the transformed expression to the right of the arrow.

Other facts about the symbolic equal sign:

It is a live operator meaning that if you make a change anywhere above or to the left of it, Mathcad updates the result.

It “knows” about previously defined functions and variables and uses them wherever appropriate. You can force the symbolic equal sign to ignore prior definitions, however.

It applies to an entire expression. You cannot, for example, use the symbolic equal sign to transform part of an expression.


Keywords:

assume

coeffs

collect

complex

convert

expand

factor

float

fourier

invfourier

invlaplace

invztrans

laplace

series

simplify

solve

substitute

ztrans


Keyword "fourier"
KEYWORD “fourier”

Use the keyword fourier to evaluate the inverse z-transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword fourier.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The fourier keyword returns a function in the variable w. If the expression you are transforming already contains a w, Mathcad avoids ambiguity by returning a function in the variable ww instead. Use the Substitute keyword to substitute a different variable or expression for w.

Other keywords...


KEYWORD "laplace"

Use the keyword laplace to evaluate the Laplace transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword laplace.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The laplace keyword returns a function in the variable s. If the expression you are transforming already contains an s, Mathcad avoids ambiguity by returning a function in the variable ss instead. Use the Substitute keyword to substitute a different variable or expression for s.

Other keywords...


KEYWORD "ztrans"

Use the keyword ztrans to evaluate the z-transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword ztrans.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The ztrans keyword returns a function in the variable z. If the expression you are transforming already contains a z, Mathcad avoids ambiguity by returning a function in the variable zz instead. Use the Substitute keyword to substitute a different variable or expression for z.

Other keywords...


KEYWORD "invfourier"

Use the keyword invfourier to evaluate the inverse z-transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword invfourier.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The invfourier keyword returns a function of the variable t. If the expression you are transforming already contains a t Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute keyword to substitute a different variable or expression for t.

Other keywords...


KEYWORD "invlaplace"

Use the keyword invlaplace to evaluate the inverse laplace transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword laplace.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The invlaplace keyword returns a function in the variable t. If the expression you are transforming already contains a t, Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute keyword to substitute a different variable or expression for t.

Other keywords...


KEYWORD "invztrans"

Use the keyword invztrans to evaluate the inverse z-transform of a function:

Type the function you want to evaluate.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword invztrans.

Type a comma followed by the variable in which the transform should be made.

Press Enter.

The invztrans keyword returns a function in the variable t. If the expression you are transforming already contains an n, Mathcad avoids ambiguity by returning a function in the variable nn instead. Use the Substitute keyword to substitute a different variable or expression for n.

Other keywords...


KEYWORD "substitute"

To replace all occurrences of a variable with another variable, an expression or a number:

Type the expression containing the variable to be replaced.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword substitute.

Type a comma followed by an equation of the form var1=var2, where var1 is to be replaced by var2. Use Ctrl+Equals for the equal sign.

Press Enter to see the result.

This operation can sometimes result in an unwieldy expression. To simplify the result, apply the keyword symplify.

Note that this command only works for replacing a variable with an expression. You cannot use this to replace one expression with another. To replace one expression with another, use the Cut and Paste commands on the Edit menu.

Other keywords...


KEYWORD "collect"

To simplify an expression by representing a sum of terms as a polynomial in a particular variable:

Type the expression you want to simplify.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword collect.

Type a comma followed by the variable or expression on which to collect.

Press Enter.

This will rewrite the sum as a polynomial in that variable or function.

Other keywords...


KEYWORD "solve"

To solve an equation symbolically for a variable, use the solve keyword:

Type the equation. Use Ctrl+Equals for the equal sign.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword solve.

Type a comma followed by the variable for which to solve.

Press Enter to see the result.

To solve a system of equations symbolically:

Create a vector having n rows and 1 column and fill in the element placeholders with the equations in the system. Use Ctrl+Equals for the equal sign.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword solve.

Create a vector having n rows and 1 column and fill in the element placeholders with the variables to solve for.

Press Enter to see the result.

Other keywords...


KEYWORD "coeffs"

To rewrite an equation as a polynomial, use the coeffs keyword:

Type the expression you want to rewrite.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type the keyword coeffs.

Type a comma followed by the variable or function in which you want your expression to be regarded as a polynomial.

Press Enter to see the result.

Other keywords...


Keyword "coeffs"
KEYWORD "convert"

To convert an equation to a partial fraction, use the convert keyword with parfrac:

Type the expression you want to convert.

Press Ctrl+Shift+Period to insert a placeholder and the symbolic equal sign.

Type convert,parfrac.

Type a comma followed by the variable in the denominator of the expression on which to convert.

Press Enter to see the result.

Other keywords...


SMOOTHING DATA

Smoothing involves taking a set of y (and possibly x) values and returning a new set of y values that is smoother than the original set. The medsmooth function is the most robust of the three since it is least likely to be affected by spurious data points. The ksmooth function is most useful when your data lies along a band of relatively constant width. If your data lies scattered along a band whose width fluctuates considerably, you should use an adaptive smoother like supsmooth.

medsmooth(vy,n)	Returns an m-element vector created by smoothing vy with running medians.

ksmooth(vx,vy,b)	Returns an m-element vector created by smoothing using a Gaussian kernel to return weighted averages of the elements in vy.

supsmooth(vx,vy)	Returns an m-element vector created by the piecewise use of a symmetric k-nearest neighbor linear least square fitting procedure in which k is adaptively chosen.

Arguments:

vx is an m element vector of real numbers. In supsmooth, the elements of vx must be in ascending order.

vy is an m element vector of real numbers.

n is the width of the window over which smoothing occurs. n must be an odd number of elements less than the number of elements in vy.

b is the bandwidth of the smoothing window. It should be set to a few times the spacing between x data points.

 (supsmooth)

 (medsmooth)

 (ksmooth)


The medsmooth function

Evaluation of medsmooth(vy,n) begins with the running median of input vector vy. We’ll call this vy`. The ith element is given by:

It then evaluates the residuals:  vr=vy - vy`

The residual vector, vr, is smoothed using the same procedure described in step 1. This creates a smoothed residual vector, vr`.

The medsmooth function returns the sum of these two smoothed vectors:

medsmooth(vy,n) = vy` + vr`.

Note that medsmooth will leave the first and last (n-1)/2 points unchanged. In practice, the length of the smoothing window, n, should be small compared to the length of the data set.


The ksmooth function

The ksmooth function uses a Gaussian kernel to compute local weighted averages of the input vector vy. For each element in the n-element vector vy, the ksmooth function returns a new vy` element given by:

and b is a bandwidth which you supply to the ksmooth function. The bandwidth is usually set to a few times the spacing between data point on the x axis depending on how big a window you want to use when smoothing.


SOLVING ONE EQUATION IN ONE UNKNOWN

Any such equation can be written as

f(x) = g(x)

which can be simplified to

f(x) - g(x) = 0

The solution is given by the root function:

root(f(x) - g(x),x)

For example, consider the equation:

cos(x) = x + .2

To solve this, you would write:

x := 1<--- Guess value

root(cos(x) - x - .2,x) =

Mathcad evaluates the root function using the secant method.

See Mathcad Quicksheets for an example using the root function.


SOLVING A SYSTEM OF NONLINEAR EQUATIONS

The example below illustrates how to solve two nonlinear equations in two unknowns using the find function.


APPROXIMATE SOLUTION TO A SYSTEM OF NONLINEAR EQUATIONS

The example below shows how to find the values that come closes to solving a system of equations using the minerr function.


ROOTS OF A POLYNOMIAL

root(f(x),x)	Returns the value of x that makes the function f equal to zero.

polyroots(v)	Returns a vector containing all the roots of the polynomial whose coefficients are in v.

Arguments:

f is a scalar valued function of any number of variables.

x is a scalar variable found in f.

v is a vector containing coefficients of a polynomial in which the first element is the constant term.

The root function requires a guess value to start the root finding process. For functions with many roots, the root returned depends on the guess value.

If the guess value is very close to a minimum or maximum of f, the root function may fail to converge, or converge to a root far away from the guess value.

See Mathcad Quicksheets for an example using root

or polyroot.


SOLVING SYSTEMS OF EQUATIONS

Find(x,y,...)	This returns the values of x, y...  that satisfy the equations and inequalities in a solve block. If you are solving for n variables, the solve block must have n equations (where n less than or equal to 50).

Arguments:

x, y,... are scalar variables found in the system of equations.

When the solve block involves only one unknown, the Find function returns a scalar. Otherwise it returns a vector whose first element is x, second element is y and so on. If you are solving for n variables, the solve block must have n equations.

Mathcad evaluates the find function using the Levenberg-Marquardt method. This method requires a guess value for each unknown to begin the search for solutions. For systems having more than one solution, the solution returned depends on the guess values. Adding inequalities may also force Mathcad to find a different solution.

There is a limit on the number of calculations that Mathcad will perform in search of an answer to the find function. Mathcad returns an error indicating that no solution was found when the difference between successive approximations to the solution is greater than TOL and  any of the following:

The solver reaches a point where it cannot reduce the error any further. Try defining TOL with a larger value. Also make sure you have provided complex guess values if you are trying to find a complex solution.

The solver reaches a point from which there is no preferred direction. Try a different guess value or add an inequality.

The solver reaches the limit of its accuracy. Roundoff errors make it unlikely that further computation would increase accuracy of the solution. This often happens if you set TOL to a value below 10^15.

You can use the find function like any other function. For example, you can define another function in terms of find. This allows you to call solve blocks from other solve blocks or vary some of the parameters or constants in your system of equations.

See Mathcad Quicksheets for an example.


APPROXIMATE SOLUTIONS

Minerr(x,y,..)	This returns the values of x, y...  that come closest to satisfying the equations and inequalities in a solve block.

Arguments:

x, y,... are scalar variables found in the system of equations.

When the solve block involves only one unknown, the minerr function returns a scalar. Otherwise it returns a vector whose first element is x, second element is y and so on.

Mathcad evaluates the minerr function using the Levenberg-Marquardt method. This method requires a guess value for each unknown to begin the search for solutions. For systems having more than one solution, the solution returned depends on the guess values. Adding inequalities may also force Mathcad to find a different solution.

Keep in mind that minerr returns an answer that minimizes the errors in the constraints. However, minerr cannot verify that its answers represent an absolute minimum for the errors in the contraints. If you use minerr, you should always include checks on the reasonableness of the results.

You can use the minerr function like any other function. Minerr is particularly useful for solving certain non-linear least squares problems.

See Mathcad Quicksheets for an example.


Guess value

The root function requires a value from which to start its search for a solution. To create a guess value, just define a variable. The variable name you use here should match the second argument of the root function. For expressions with multiple roots, the root you converge to will depend on this guess value.

When you are solving equations numerically, the find function and the minerr function also require values from which to start searching for solutions. To create guess values, just define variables. The variable names you use should match the arguments of the find function.

If you expect a complex solution, you should use a complex guess value.


HINTS ON USING THE ROOT FUNCTION

Mathcad evaluates the root function using the secant method. The guess value is the starting point for successive approximations to the root value. If the magnitude of f(x) evaluated at the proposed root is less than the value of TOL, the root function returns a result. If Mathcad cannot find an acceptable answer, an error is returned.

Here are some hints on getting the most out of the root function:

To change the accuracy of the root function, change the value of TOL.

If the expression has multiple roots, try different guess values.

See Mathcad Quicksheets for an example.

If f(x) has a small slope near its root, then root(f(x),x) may converge to a value r that is realatively far from the actual root. In such cases, even though |f(r)|<TOL, r may be far from the point where f(r)=0. To find a more accurate root, decrease the value of TOL. Or try finding root(g(x),x), where

For an expression f(x) with a known root a, solving for additional roots of f(x) is equivalent to solving for roots of h(x) = f(x) / (x-a). Dividing out known roots like this is useful for resolving two roots that may be close together. It’s often easier to solve for roots of h(x) as defined here than it is to try to find other roots for f(x) with different guesses.

You can use the root function when you want to find the root of an expression while varying one of the parameters. The simplest way to do this is to define a function in terms of the root function.

See Mathcad quicksheets for an example.


The built-in variable ERR gives the size of the error vector for the approximate solution. There is no built-in variable for determining the size of the error for individual solutions to the unknowns.


Related Topics:

Solving one equation in one unknown

Hints on using the root function

The root function algorithm

Solving systems of equations

Solving systems of equations symbolically


FUNCTIONS FOR EQUATION SOLVING

Find(x,y,...)

Solves a system of equations.

Minerr(x,y,...)

Approximate solution to a system of equations.

root(f(x),x)

Solves one equation in one unknown.

lsolve(M,v)

Solves a system of equations.

polyroots(v)

Solves for the roots of the polynomial whose coefficients are in v.


SOLVING LINEAR SYSTEMS

lsolve(A,b)	Returns the vector solving the linear system of equations Ax = b.

Arguments:

A is a square, non-singular matrix.

b is a vector having the same number of rows as A.


Singular matrix

A matrix is singular if its determinant is equal to zero. A matrix is nearly singular if it has a high condition number.


Related Topics:

Approximate solution to a system of nonlinear equations

Solving a system of linear equations

Solving a system of nonlinear equations

Solving systems of equations

Approximate solutions

Solving systems of equations symbolically


SORTING FUNCTIONS

Mathcad includes three functions for sorting arrays and one for reversing the order of their elements:

sort(v)

Returns a vector with the values from v sorted in ascending order.

csort(A,n)

Returns an array formed by rearranging rows of A until column n is in ascending order.

rsort(A,n)

Returns an array formed by rearranging columns of A until row n is in ascending order.

reverse(v)

Returns a vector in which the elements of v are in reverse order.

Related topics:

Vectors and matrices


Example of "sort" function
USING THE "sort" FUNCTION

Keep in mind that matrices are numbered starting with row zero and column zero unless you change the ORIGIN.

To sort a vector into descending order, use the function reverse(v) as follows:

reverse(sort(v))


Example of "rsort" function
USING THE "rsort" FUNCTION

Keep in mind that matrices are numbered starting with row zero and column zero unless you change the ORIGIN.


Example of "csort" function
USING THE "csort" FUNCTION

Keep in mind that matrices are numbered starting with row zero and column zero unless you change the ORIGIN.


Example of "reverse" function
USING THE "reverse" FUNCTION


n

must be an integer that indexes one of the rows in the array A

For ORIGIN = 1 (the default), n must be between 1 and rows(A) inclusive.


n

must be an integer that indexes one of the columns in the array A

For ORIGIN = 1 (the default), n must be between 1 and cols(A) inclusive.


A

An array

If the array contains elements having both real and imaginary parts, this function ignores the imaginary part.


v

A vector.

If the vector contains elements having both real and imaginary parts, this function ignores the imaginary part.


CUBIC SPLINE INTERPOLATION

Cubic spline interpolation lets you pass a curve through a set of points in such a way that the first and second derivatives of the curve are continuous across each point. This curve is assembled by taking three adjacent points and construction a cubic polynomial passing through those points. these cubic polynomials are then strung together to form the completed curve.

cspline(vx,vy)	Returns a vector of second derivatives for data vectors vx and vy. This vector becomes the first argument of the interp function. The resultant spline curve is cubic at the endpoints.

pspline(vx,vy)	Same as cspline, except that the resultant spline curve is parabolic at the endpoints.

lspline(vx,vy)	Same as cspline, except that the resultant spline curve is linear at the endpoints.

interp(vs,vx,vy,x)	Returns a spline interpolated value of vy at a point x.

Arguments:

vx is a vector of real data values in ascending order. These correspond to the x values.

vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

vs is a vector generated by either cspline, pspline or lspline.

x is the value of the independent variable at which you want to interpolate a result. For best results, this should be in the range encompassed by the values of vx.

The example below illustrates the use of cubic spline interpolation:


MULTIVARIATE CUBIC SPLINE INTERPOLATION

Two dimentional cubic spline interpolation lets you pass a surface through a grid of points in such a way that the first and second derivatives of the curve are continuous across each point. This surface corresponds to a cubic polynomial in x and y in which the first and second partial derivatives are continuous in the corresponding direction across each grid point.

spline(Mxy,Mz)	Returns a vector of second derivatives for data arrays Mxy and Mz. This vector becomes the first argument of the interp function. The resultant surface is cubic at the edges of the region spanned by Mxy.

pspline(Mxy,Mz)	Same as cspline, except that the resultant surface is parabolic at the boundaries.

lspline(Mxy,Mz)	Same as cspline, except that the resultant surface is linear at the boundaries.

interp(vs,Mxy,Mz,v)	Returns a spline interpolated value of Mz at the x and y coordinates specified in v.

Arguments:

Mxy is an n x 2 array specifying the x and y coordinates along the diagonal of the rectangular grid over which interpolation is to take place.

Mz is an n x n array of real data. These are the z values corresponding to x and y values in Mxy.

vs is a vector generated by either cspline, pspline or lspline.

v is a vector whose two elements are the values of x and y at which you want the interpolated value of z. For best results, the values of x and y should be in the range encompassed by the grid points.


How Mathcad interpolates

To find the value for a particular x, Mathcad finds the two points between which the value falls and returns the corresponding y value on the cubic section between the two points.

For x values before the first known data point, Mathcad extrapolates the cubic section between the first two data points.

For x values beyond the last known data point, Mathcad extrapolates the cubic section between the last two data points.


The first three values returned by cspline, lspline, and pspline are used by the interp  function. The remaining elements are the second-derivative coefficients. If you would like to access only the second derivatives, use the submatrix function.


DATA ANALYSIS FUNCTIONS

mean(A)	Arithmetic mean of the elements in array A.

median(A)	Median of elements in array A.

stdev(A)	Standard deviation of a population array A.

Stdev(v)	Standard deviation of a sample vector v.

var(A)	Variance of a population array A.

Var(v)	Variance of a sample vector v.

cvar(A,B)	Covariance of elements in the two m x n arrays A and B.

corr(A,B)	Pearson's correlation coefficient for the two m x n arrays A and B.

For additional information on statistics, open Practical Statistics from the Resource Center.


MEAN FUNCTION

Arguments:

A  is an m x n array.

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


Other functions for data analysis

Mean

Median

Poplulation standard deviation

Sample standard deviation

Population variance

Sample variance

Covariance

Correlation


MEDIAN FUNCTION

median(A)	Returns the median of the elements of an array. This is the value above and below which there are an equal number of array elements. If A has an even number of elements, this is the arithmetic mean of the two central values.

Arguments:

A  is an m x n array.

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


Population standard deviation
POPULATION STANDARD DEVIATION FUNCTION

stdev(A)	Returns the square root of the variance of the elements in A.

Arguments:

A is an m x n array.

Note that the stdev function divides by n rather than n−1 in computing the variance. To find the standard deviation corresponding to a denominator of n−1, multiply the result of this function by the square root of n/(n−1).

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


POPULATION VARIANCE FUNCTION

Arguments:

A is an m x n array.

Note that this function divides by mn rather than mn−1 in computing the variance. To find the variance corresponding to a denominator of mn−1, multiply the result of this function by mn/(mn−1).

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


COVARIANCE FUNCTION

Arguments:

A and B are both m x n arrays.

Note that this function divides by mn rather than mn−1 in computing the covariance. To find the covariance corresponding to a denominator of mn−1, multiply the result of this function by mn/(mn−1).

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


CORRELATION FUNCTION

corr(A,B)	Returns the Pearson's r correlation coefficient of the elements in A and B.

Arguments:

A and B are m x n arrays.

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


HISTOGRAMS

hist(int,A)	Returns a vector whose ith element is the number of points in A falling between the ith and (i+1)th element of int.

Arguments:

A is a vector of real data values.

int is a vector of real values in ascending order. These represent the intervals into which the elements of A will be sorted.

For additional information on statistics, open Practical Statistics from the Resource Center.


LINEAR INTERPOLATION

In linear interpolation, Mathcad connects the existing datapoints with straight lines and interpolates for a particular value.

linterp(vx,vy,x)	Returns a linearly interpolated value at x for data vectors vx and vy.

Arguments:

vx is a vector of real data values in ascending order. These correspond to the x values.

vy is a vector of real data values. These correspond to the y values. The number of elements is the same as vx.

x is the value of the independent variable at which you want to interpolate a result. For best results, this should be in the range encompassed by the values of vx.

The example below illustrates the use of linterp:


How Mathcad linearly interpolates

To find the value for a particular x, Mathcad finds the two points between which the value falls and returns the corresponding y value on the straight line between the two points.

For x values before the first known data point, Mathcad extrapolates the straight line between the first two data points.

For x values beyond the last known data point, Mathcad extrapolates the straight line between the last two data points.


Related Topics:

Linear interpolation

Cubic spline interpolation

Multivariate cubic spline interpolation


SAMPLE VARIANCE FUNCTION

Arguments:

v is an m x 1 vector.

Dividing the squared deviations by the "sample size minus one" rather than the sample size, provides a better estimate for the true population variance.

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


SAMPLE STANDARD DEVIATION FUNCTION

Stdev(v)	Returns the square root of the variance of the elements in v.

Arguments:

v is an m x 1 vector.

For additional information on statistics, open Practical Statistics from the Resource Center.

Other functions for data analysis...


STATISTICS AND DATA ANALYSIS

Data analysis functions

Describes elementary data analysis functions: mean, variance, standard deviation and correlation.

Distribution functions

Describes the built-in gamma function, the error function and the cumulative normal distribution and many other probabilty distribution functions.

Random numbers

Describes how random numbers are generated and how to use them to generate random numbers having a variety of distributions.

Histograms

Describes how to get the frequency distribution of a data sample.

Interpolation and prediction

Describes linear and cubic spline interpolation, and linear prediction.

Smoothing

Describes a variety of methods for smoothing noisy data.

Curve fitting

Describes regression techniques, both linear and nonlinear.


INTERPOLATION AND PREDICTION

Mathcad provides two interpolation methods and one linear prediction method:

Linear interpolation: For connecting points with a straight line.

Cubic spline interpolation: For connecting points with a cubic section.

Multivariate cubic spline interpolation: For creating a surface which passes through a grid of points.

Linear prediction: For determining values beyond a set of data.


LINEAR PREDICTION

The predict function uses your existing data to predict data points lying beyond the existing ones. It uses a linear prediction algorithm which is useful when your data is smooth and oscillatory, though not necessarily periodic. Linear prediction can be seen as a kind of extrapolation method but should not be confused with linear or polynomial extrapolation.

predict(v,m,n)	Returns a vector of n predicted values based on m consecutive elements in v.

Arguments:

v is a vector whose values represent samples taken at equal intervals.

m and n are integers.

The example below illustrates the use of linear prediction:


"interp" function
INTERP FUNCTION

The interp function is used in several different applications:

Cubic spline interpolation

Multivariate cubic spline interpolation

Polynomial regression

Multivariate polynomial regression


SURFACE PLOTS

When you create a surface plot, Mathcad visually represents a matrix of data as a surface in a three dimensional graph. You can change the perspective of the surface, its size, and color. You can also change a surface plot into another type of 3D plot.

Creating a surface plot

Parametric Surface Plots

Deleting a surface plot

Moving a surface plot

Changing the size of a surface plot

View settings

Axis settings

Color and line settings

Adding a title to a surface plot

Animating a surface plot


The height is proportional to the value of the matrix element.


In the default perspective, the first row of the matrix extends from the back left corner of the grid to the right, while the first column extends from the back left corner out to the viewer.


CREATING A SURFACE PLOT

To create a surface plot:

Define the matrix of elements to plot. The matrix must have at least two rows and two columns.

Choose Graph / Surface Plot from the Insert menu to a create a surface plot region.

Place the name of the matrix in the placeholder.

Mathcad draws a perspective view of the matrix as a two-dimensional grid lying flat in three-dimensional space. Each matrix element is represented as a point at a specified height above or below this grid. If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

Alternatively you can create a surface plot from a set of x, y and z data points. First create three vectors:  one containing the x values, one containing the y values, and one the z values. Create a surface plot region and type the names of the x, y and z vectors separated by commas into the placeholder. The surface plot Mathcad generates is the same as a 3D scatter plot changed into a surface plot.

See Mathcad Quicksheets for an example of a surface plot.


PARAMETRIC SURFACE PLOTS

Parametric surface plots remove the restriction that surfaces be of the form z = f(x,y). With parametric surface plots, you can plot arbitrary surfaces.

Define three matrices of elements to plot. These matrices contain the x, y and z coordinates of the points to be plotted.

Choose Graph / Surface Plot from the Insert menu to a create a surface plot region.

Place the names of the three matrices in the placeholder. Separate the names by commas.

All three matrices must have the same number of rows and columns.

You cannot convert parametric surface plots into any other type of 3D plot.

See Mathcad Quicksheets for an example of a parametric surface plot.


VIEW SETTINGS (SURFACE PLOTS)

To modify the general presentation of your plot:

Double-click on a plot to open a tabbed dialog box.

Click on the View tab.

The View page has the following options. Click on an option to learn more about it.

Rotation

Tilt

Vertical scale

Axes style

Show border

Show box

Show back planes

The View page also has options that allow you to change any surface plot (except for parametric surface plots) into other types of 3D plots:

Contour plot

3D bar chart

Data points

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a surface plot displayed with different view options.


AXIS SETTINGS (SURFACE PLOTS)

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the Axes tab.

The Axes page shows each axis having the following check boxes associated with it. Click on an option to learn more about it:

Grid lines

Numbered

Autoscale

Auto grid

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a surface plot displayed with different axis settings.


COLOR AND LINE SETTINGS (SURFACE PLOTS)

To define the shading of the surface:

Double-click on a plot to open a tabbed dialog box.

Click on the Color & Lines tab.

The Color & Lines page has the following check boxes for managing the color of a surface plot. Click on an option to learn more about it:

Color

None

Grayscale

Interpolated Mesh

The tab also has the following check boxes for managing the appearance of the surface plot. Click on an option to learn more about it:

Hidden lines/hide mesh

Patch plot/alternate mesh

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a surface plot displayed with different color and line settings.


ADDING A TITLE TO A SURFACE PLOT

To add a title to a surface plot:

Double-click on a plot to open a tabbed dialog box.

Click on the Title tab.

In the text box on the Title page, type the title for your graph. You can use upper and lower case letters in the title.

Make sure the "Show Title" checkbox has a check in it.

Click on either the "Above" or "Below" button. Then click "OK" to display the title of the graph region or "Cancel" to restore the title text box to its original state.


Rotation must be between 0 and 360 degrees.

Rotation = 0

You look directly down first column of matrix. First row points right.

Rotation = 90

You look directly down first row of matrix. First column points left.


Tilt must be between 0 and 360 degrees.

Tilt = 0

You look from the edge on the plane of the matrix. Effect is like standing at sea level and looking at mountains.

Tilt = 90

You look from directly above. Effect is like flying directly over those same mountains.


Vertical Scale

The vertical scale controls how 'bumpy' a plot looks. A large number magnifies variations in the surface, making it look bumpy. A small number makes a surface appear flatter.


Hidden Lines/Hide Mesh

This check box is labeled "Hidden Lines" for surface plots with no shading and "Hide Mesh" for colored and grayscale surface plots.

When there is no shading selected for a surface plot, check "Hidden Lines" to render the surface opaque.

When the surface is either grayscaled or colored, you'll see a mesh superimposed on the surface. This mesh corresponds to the rows and columns of the underlying matrix. To remove this mesh from the surface, check "Hide Mesh".


Contour Plot

When this button is clicked, the surface plot is converted into a contour plot that shows a visible representation of a matrix's level curves.


3D Bar Chart

When this button is clicked, the surface plot is converted into a 3D bar chart that shows a matrix as bars of varying heights.


Data Points

When this button is clicked, the surface plot is converted into a plot showing just the points making up the surface.


Patch Plot/Alternate Mesh

This check box is labeled "Patch Plot" for regular surface plots and "Alternate Mesh" for parametric plots.

When the check box is checked, patches making up surface are constrained to be flat. Result is a discontinuous surface.

When it remains unchecked, patches making up surface are allowed to tilt in whatever direction is required to form a continuous surface.


Show Border

When checked, the surface plot is enclosed in a rectangle.


Show Box

When checked, the surface plot is enclosed in a bounding box.


Show Back Planes

When checked, the surface plot has xy, xz, and yz back planes. Use the "Fill Color" and "Edge Color" buttons to add color to the back planes so that the surface plot stands out.


Axes Style

This controls whether the axes appear at the front perimeter of the plot (perimeter), whether they intersect in the back left of the plot (corner), or whether they appear at all.


Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by grid lines. Thus, x-axis grid lines represent lines of constant x drawn on the xz plane and the xy plane, the two orthogonal planes whose intersections form the x-axis. The y-axis grid lines and z-axis grid lines are defined similarly.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 1 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Autoscale

By default, the z axis of all surface plots except parameteric surface plots is autoscaled. With Autoscale on, the z axis limit is the first major tick mark beyond the end of the data.

With Autoscale off, the axis limit is set right at the data limits. You can redefine this limit by entering values in the Max. Val. and Min. Val. text boxes.

To turn off Autoscale and have your plot drawn to the ends of the plot region:

Click on the "Autoscale" check box for the z axis to toggle it off.

If you want to set axis limits other than at the data limits, enter values in the Max. Val. and Min. Val. text boxes.

Since a surface plot is made by plotting the elements of a matrix, Mathcad cannot “know” anything about x and y coordinates. By default, the coordinates on these axes will simply be rows and columns.

If you’ve created a parametric surface plot, however, you can turn off Autoscale for the x and y axes and change the numbers used to label them. Just change the numbers in the Max. Val. and Min. Val. text boxes.

If you are setting up a surface animation sequence, you may want to turn Autoscale off.


Color

Lowest points on surface are blue. Colors progress through green, yellow, and finally, red.


None

When this button is selected, the plot doesn't have any shading. Checking "Hide lines" makes the surface opaque.


Grayscale

When this button is selected, the plot is in grayscale. The highest points on the surface are white and the lowest are black. Those in between are appropriate shades of gray.


ERROR MESSAGES IN SYMBOLIC CALCULATIONS

The messages you may see during symbolic calculation include:

Argument too large

Discarding huge result

Expecting array or list

Expression contains nonsymbolic operators

Floats not handled

Illegal function syntax

Integer too large

Invalid arguments

Invalid range

No answer found; stack limit reached

No answer found

No closed form found for . . .

Object too large

Syntax error


Discarding huge result

The answer is too large to display as a formatted math region. You can place the answer in the clipboard.


Syntax error

Usually the result of applying a symbolic operation to an inappropriate or incorrectly typed expression. Symbolic processing of expressions with units will also generate this error.


Invalid arguments

The symbolic processor can't carry out the requested operation for the given arguments. You'll see this, for example, if you apply a scalar function to an array without using the vectorize operator and choose Simplify from the Symbolics menu.


Illegal function syntax

The symbolic processor can't interpret an expression like (f)(x).


Expression contains nonsymbolic operators

You're applying a symbolic operation to an expression containing operator or variable placeholders.


No answer found

The symbolic processor could not find an exact solution for the equation you were solving.


No answer found; stack limit reached

The symbolic processor reached the limit of its internal expression stack without completing the evaluation or simplification you requested.


No closed form found for . . .

The symbolic processor couldn't find an indefinite integral for the expression you were integrating, or a closed form for the sum or product you were evaluating.


Invalid range

In looking for a numerical solution to an equation, the symbolic processor tried to evaluate one of its built-in functions at a point outside its domain.


Floats not handled

The Factor command has been applied to an expression containing decimals.


Argument too large

Integer too large in context

Object too large

Usually the result of evaluating an expression with a floating point value larger than about 10 to the 10 billion.


Expecting array or list

Operators in the expression you are simplifying or evaluating require vector or matrix operands.


SYMBOLIC ALGEBRA

Simplifying

Expanding expressions

Factoring

Collecting terms

Finding the coefficients of a polynomial

Series

Partial fractions

Symbolic sums and products


COLLECTING TERMS

To express a sum of terms as a polynomial in a particular variable:

Select a variable name or the name of a function together with its argument by placing it between the editing lines.

Choose Collect from the Symbolics menu.

This will rewrite the sum as a polynomial in that variable or function.


FINDING THE COEFFICIENTS OF A POLYNOMIAL

To rewrite an expression as a polynomial, either in a particular variable or with respect to a subexpression:

Select the variable (or subexpression) in which you want your expression to be regarded as a polynomial.

Choose Polynomial Coefficients from the Symbolics menu.

You'll see a vector containing the coefficients of the equivalent polynomial. The first element of the vector corresponds to the constant term.


SUBSTITUTION

To replace all occurrences of a variable with another variable, an expression or a number:

Select whatever you want to replace the variable with and choose Copy from the Edit menu.

Select the variable you want to replace.

Choose Variable / Substitute from the Symbolics menu.

This operation can sometimes result in an unwieldy expression. To simplify the result, select it and choose Simplify.

Note that this command only works for replacing a variable with an expression. You cannot use this to replace one expression with another. To replace one expression with another, use the Cut and Paste commands on the Edit menu.


SERIES EXPANSION OF AN EXPRESSION

To expand a function or expression in a Taylor or Laurent series around 0:

Select the variable you want to expand around.

Choose Variable / Expand to Series from the Symbolics menu.

 You'll be prompted for an order of expansion. Choose an order (the default is 6, the maximum is 99) and click "OK."

The expanded series will include a term like O(x^6). If you want to use the series for numerical calculations, delete this "O" term at the end.

If the symbolic processor can't derive a series centered at 0, it will return the function unchanged. To derive a series with a center other than zero, simply translate the variable.

Keep in mind that the Taylor series for a function may converge only in some small interval around the center. Furthermore, functions like sin or exp have series with infinitely many terms (how many depends on the order you select). Thus, when you approximate a function by the polynomial returned by Expand to Series, the approximation will be reasonably accurate close to the center, but may be quite inaccurate for values far from the center.


Mathcad will find Taylor series (series in nonnegative powers of the variable) for functions that are analytic at 0, and Laurent series for functions that have a pole of finite order at 0.


This indicates that the error in using the given terms of the series as an approximation is bounded by a constant times x^6 as x tends to 0.


For example, although ln(x) does not have an expansion at 0, you can calculate a series for ln around 1 by expanding ln(1 − x) around 0.


PARTIAL FRACTIONS

To expand a rational expression into a sum of fractions with linear or quadratic denominators:

Select the variable you want to use to factor the denominators.

Choose Variable / Convert to Partial Fraction from the Symbolics menu.

This command tries to factor the denominator into factors that are linear or quadratic (with rational coefficients) in the variable you select. If it can't factor the denominator in the selected variable, the expression returns unchanged.

Note that this command will not expand any expression containing constants with decimal points.


Symbolic calculation
OVERVIEW OF SYMBOLIC MATH

What it's for...

Characteristics of symbolic math...

How to do it...


What it's for

Use symbolic math when you want the answer to a problem to be something other than a number.


Characteristics of symbolic math

Some advantages to using symbolic math are:

You can explicitly see relationships between variables.

The results are immune from roundoff errors, numerical instabilities, and other problems inherent in numerical calculation.

Some problems that you may encounter when doing symbolic math are:

The resulting expressions can become very complicated.

It can be difficult to control exactly what form the answer takes.


For example, when you do symbolic math:

3x - 2x

will simplify to x

If you do numerical math (by simply typing an equal sign) you'll see either:

an error message if x happens to be undefined, or

the value of x if x happens to be defined.


SYMBOLIC EVALUATION USING MENU COMMANDS

One method of evaluating an expression symbolically is to use the commands from the Symbolics menu. Using the Symbolics menu all algebraic transformations work in fundamentally the same way:

Select either all or part of an expression.

Choose the appropriate menu command from the Symbolics menu.

You'll see the transformed expression in your worksheet. Depending on how you've set your evaluation style, this transformed expression will either replace the expression you clicked on or place it below or to the right of the existing one. If the symbolic transformation was unsuccessful, the new expression will be identical to the old one.

Note that when you use the menu commands to do symbolic math, the resulting transformation does not update itself when you make changes to your worksheet. To do symbolic math so that the transformations update, use live symbolic evaluation.


Selecting all or part of an expression

The significance of what you select depends on the specific menu command you use. In most cases, you'll only be transforming whatever is held between the editing lines. In a few cases, you'll be transforming the entire expression but whatever you selected is used in some special way. For example, when you differentiate symbolically, you differentiate the entire expression with respect to whatever you selected.


Unsuccessful symbolic transformation

Symbolic transformations may fail to occur for a variety of reasons. For example you may have tried to factor an unfactorable expression. Or you may be trying to simplify an expression that cannot reasonably be simplified.


SYMBOLIC MATRIX ALGEBRA

Matrix algebra

Transpose of a matrix

Inverse of a matrix

Determinant of a matrix


SIMPLIFYING AN EXPRESSION SYMBOLICALLY

To algebraically simplify all or part of an expression:

Place the expression (or subexpression) you want to simplify between the editing lines.

Choose Simplify from the Symbolics menu.

The Simplify command performs arithmetic, cancels common factors, uses basic trigonometric and inverse function identities, and simplifies square roots and powers. If the expression can't be simplified further, the Simplify command returns it unchanged.

When the expression to be simplified includes functions with more than one branch, such as square root or the inverse trigonometric functions, the symbolic processor may return a result that differs in numerical behavior from the original.

Note that when you type numbers with decimal points, the symbolic processor returns any numerical results with decimal approximations.


EXPANDING EXPRESSIONS

To multiply out powers and products of polynomials:

Enclose the expression (or subexpression) you want to expand between the editing lines.

Choose Expand from the Symbolics menu.

Specifics about the expansion of an expression:

If the expression is a fraction, the numerator will be expanded and the expression will be written as a sum of functions.

Sines, cosines, and tangents of sums of variables, or integer multiples of variables will be expanded as far as possible into expressions involving only sines and cosines of single variables.

If the expression can't be expanded further, this command returns it unchanged.


Factoring polynomials
FACTORING

To rewrite an expression as a product of terms:

Enclose the expression (or subexpression) you want to factor between the editing lines.

Choose Factor from the Symbolics menu.

Note that this command will not factor any expression containing constants with decimal points.


SYMBOLIC DIFFERENTIATION

To differentiate a function with respect to a variable:

Press ? to create the derivative operator.

Enter the expression to differentiate and the variable of differentiation in the placeholders.

Press Space until the entire expression is between the editing lines.

Choose Simplify from the Symbolics menu.

To evaluate higher order derivatives, press Ctrl+Shift+? to create the higher order derivative operator follow the instructions above.


SYMBOLIC INTEGRATION

To evaluate an indefinite integral:

Press Ctrl+I to create the indefinite integral operator.

Fill in the placeholders for the integrand and the integration variable.

Press Space until the entire integral is between the editing lines.

Choose Simplify from the Symbolics menu.

To evaluate a definite integral instead, press & to create the integral operator and follow the instructions above. Mathcad’s symbolic processor will find an indefinite integral and subtract its value at the lower limit of integration from its value at the upper limit. If you use decimals in the integrand or limits of integration, you'll see a 20-place numerical approximation if one is available.

If an integral has no closed form expression, you'll see an appropriate error message. If all you need is a numerical approximation to a definite integral, try evaluating the integral numerically instead.

When evaluating an indefinite integral, remember that the answer to an integration problem is not unique. If f(x) is an integral of a given function, so is f(x) + C for a constant C.


SOLVING AN EQUATION SYMBOLICALLY

To solve an equation:

Enter the left side of the equation.

Use Ctrl+= to make the equals sign (to find the root of an expression, do not type an equals sign and proceed to step 4).

In the remaining placeholder, enter the right side of the equation.

Select the variable you want to solve for.

Choose Variable / Solve from the Symbolics menu.

Mathcad will solve for the variable and paste the result into your worksheet. If the equation has more than one solution, you'll see a vector having as many elements as there are solutions. If your equation includes numbers with decimal points, you'll see a decimal answer. Otherwise, you'll see an exact solution (if one is available).

To solve an inequality, follow the above procedure except type >, <, Ctrl+(, or Ctrl+) in place of the Ctrl+=.


SYMBOLIC DISPLAY FORMAT

Choose Evaluation Style from the Symbolics menu to control where symbolic results are placed. You'll be able to choose from the following:

"vertically, inserting lines" stacks results, clearing a space across the full width of your worksheet.

"vertically, without inserting lines" stacks results but leaves adjacent regions in place so that you can do separate calculations side by side.

"horizontally" puts results to the right of the original expression

Check the box next to "Show comments" box to automatically insert an appropriate comment before each result. You'll be able to edit these automatically generated comments just as you would any text region.

Check the box next to ‘Evaluate in Place’ to replace the original expression with the symbolic answer. This option is convenient if you want to transform only a part of a larger expression.


SYMBOLIC SUMS AND PRODUCTS

To evaluate sums and products symbolically

Create the summation or product operator by pressing Ctrl+Shift+4 or Ctrl+Shift+3 respectively.

Fill in an expression and a range.

Choose Simplify from the Symbolics menu.

If the symbolic processor can't find a closed form for the sum or product, it either

returns an explicit sum or product or

returns a message indicating that no closed from was found for the sum or product.

Note that when you use symbolic commands such as Simplify, the symbolic processor does not “know” about any variable definitions in your worksheet.


SYMBOLIC RESULTS TOO LONG TO DISPLAY

When a symbolic result is too unwieldy to be displayed conveniently in your worksheet, you'll see a dialog box asking you if you want the result placed on the clipboard. Large results are often generated by

integrating or differentiating complex expressions

finding roots of polynomials symbolically

symbolically evaluating functions that produce a very large integer result

If you save a large answer to the clipboard, you can examine the result by opening the clipboard. Symbolic results on the clipboard appear in a syntax similar to what you might see in a spreadsheet.

You can print this result by pasting it into any word processor. You can also paste the answer string directly into your worksheet as a text region.


Special functions (symbolic only)
SPECIAL FUNCTIONS

Symbolic results placed on the clipboard use a special kind of syntax. You may see embedded font codes for variables. Results may also contain two kinds of special operators and functions:

Symbolic operators like sum, RootOf, D , diff, int, and @@ . Answers containing these operators can't be expressed in terms of any of the built-in numerical operators. They will be flagged with the message "Result special to Maple" and placed on the clipboard.

Special numerical functions like Ei, Psi, and dilog. These functions often appear in answers to integration, summation, and equation-solving problems.

arcsec, arccsc, arccot, arcsech, arcscsh, arccoth

γ

Catalan's constant

Chi(x)

Ci(x)

csgn(x)

dilog(x)

Dirac(x)

Ei(x)

erf(z)

FresnelC(x)

FresnelS(x)

GAMMA(z)

hypergeom(n1, n2..., d1, d2..., z)

LegendreE(x,k)

LegendreEc(k)

LegendreEc1(k)

LegendreF(x,k)

LegendreKc(k)

LegendreKc1(k)

LegendrePi(x,n,k)

LegendrePic(n,k)

LegendrePic1(n,k)

Psi(n,x)

Psi(x)

Shi(x)

Si(x)

signum(x)

W(x)

W(n,x)

Zeta(s)

Since the special functions aren't built-in numerical functions, you can't evaluate them directly in by pressing =. To find a numerical value for one of these functions, click on the its name below and use the equivalent expression in the pop-up window:


VECTORIZING IN SYMBOLICS

Use the vectorize operator to apply a built-in function to each element of a matrix, as illustrated below. To apply the vectorize operator, select the whole expression (function and matrix argument) and press Ctrl+ -. Then choose Simplify from the Symbolics menu.


To select an expression, click in it and press the Space key until the expression is between the editing lines. To select a particular subexpression, you may need to insert parentheses before you can select it.


To select a variable, click to put the editing lines in the variable name.


A “D” stands for the partial derivative operator. The nth derivative is “(D,n)”. The partial derivative of a function with respect to its nth argument is “(D[n])”.


The operator “@” denotes function composition. For example, (sin@exp)(x) is the same as sin(exp(x)). A”@@” represents repeated composition, so (f@@2)(x) is the same as f(f(x)).


 The derivative of f(x) with respect to x is written “diff(f(x),x)”. The nth derivative is “diff(f(x),x$n)”.

The integral of f(x) with respect to x is written “int(f(x),x)”.


Embedded font codes such as “MFNT_03_” preceding a variable name indicate the font in which the variable name is to appear.


A closed form solution for the root does not exist. This root is given as the root of another polynomial.

If you chose to save the result to the clipboard, the polynomial will appear on the clipboard in the form

RootOf(h(_Z))

where h(_Z) is a polynomial whose root is also a root of the original expression.


Euler's Constant


Catalan's Constant


Generalized hypergeometric function


Hyperbolic cosine integral


Cosine integral


Sign function for real and complex expressions


Dilogarithm function


Dirac delta (unit impulse) function


Exponential integral


Error function

For |z| < 4 use a range of n=0 to 100.


Fresnel cosine integral


Fresnel sine integral


Legendre's canonical incomplete elliptic integral of the second kind


Legendre's complete elliptic integral of the second kind

Define LegendreE(x,k). Then define

LegendreEc(k) = LegendreE(1,k)


Associated Legendre's complete elliptic integral of the second kind

Define LegendreEc(k). Then define


Legendre's canonical incomplete elliptic integral of the first kind


Legendre's complete elliptic integral of the first kind

Define LegendreF(x,k). Then define

LegendreKc(k) = LegendreF(1,k)


Associated Legendre's complete elliptic integral of the first kind

Define LegendreKc(k). Then define


Legendre's canonical incomplete elliptic integral of the third kind


Legendre's complete elliptic integral of the third kind

Define LegendrePi(x,n,k). Then define

LegendrePic(n,k) = LegendrePi(1,n,k)


Associated Legendre's complete elliptic integral of the third kind

Define LegendrePic(n,k). Then define


Euler's Gamma function


Polygamma function


Digamma function


Hyperbolic sine integral


Sine integral


Sign function (real)


Lambert's W function

This is the inverse of [image].

To calculate W(a), calculate [image].


Lambert's W function, nth branch

This is the nth branch of W(a), the inverse of [image].


Riemann Zeta function


These functions can be calculated by taking the reciprocals and using the Mathcad built-in functions acos, asin, etc. For example, you can define arcsec(x) as acos(1/x).


SYMBOLIC MATRIX OPERATIONS

You can symbolically evaluate matrix expressions involving operators. Most matrix functions will also be simplified symbolically when it is reasonable to do so. To symbolically evaluate an expression involving matrices, matrix operators and functions:

Click on the expression and press Space until whatever you want to evaluate is between the editing lines.

Choose Simplify from the Symbolics menu.

Note that many of these transformations do not apply to the matrix as a whole. For example, to simplify the expressions in a matrix you must select each element and choose Simplify.


SYMBOLIC MATRIX TRANSPOSE

To evaluate the transpose of a matrix:

Click on the matrix and press Space until the matrix is between the editing lines.

Choose Matrix / Transpose from the Symbolics menu.

Note that you must select the entire matrix to use this command. You cannot define a variable as a matrix and select the variable.


SYMBOLIC MATRIX INVERSE

To evaluate the inverse of a square matrix:

Click on the square matrix and press Space until the matrix is between the editing lines.

Choose Matrix / Invert from the Symbolics menu.

Note that you must select the entire matrix to use this command. You cannot define a variable as a matrix and select the variable.


SYMBOLIC MATRIX DETERMINANT

To evaluate the determinant of a square matrix:

Click on the square matrix and press Space until the matrix is held between the editing lines.

Choose Matrix / Determinant from the Symbolics menu.

Note that you must select the entire matrix to use this command. You cannot define a variable as a matrix and select the variable.


Related Topics:

Overview

Matrix algebra

Transpose of a matrix

Inverse of a matrix

Vectorizing in symbolics

Large answers

Numerical inverse of a matrix

Numerical determinant of a matrix

Numerical transpose operator


SYMBOLIC TRANSFORMS

Overview

Fourier transforms

Laplace transforms

z-Transforms


OVERVIEW OF SYMBOLIC TRANSFORMS

When you choose Symbolics / Transform from the Symbolics menu, you'll see six additional commands on a pull-right menu. Use these commands to evaluate Fourier, Laplace, and z-transforms, and their inverses.

To transform an expression:

Enter the expression to be transformed.

Click on the transform variable.

Choose Symbolics / Transform from the Symbolics menu.

Choose the appropriate transform or inverse transform.

Transforms...


FOURIER TRANSFORM

To evaluate the Fourier transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / Fourier from the Symbolics menu.

Mathcad returns a function in the variable w when you perform a Fourier transform. If the expression you are transforming already contains a w, Mathcad avoids ambiguity by returning a function in the variable ww instead. Use the Substitute for Variable command to substitute a different variable or expression for w.

Other transforms...


INVERSE FOURIER TRANSFORM

To evaluate the inverse Fourier transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / Inverse Fourier from the Symbolics menu.

Mathcad returns a function the variable t when you perform an inverse Fourier transform. If the expression you are transforming already contains a t Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute for Variable command to substitute a different variable or expression for t.

Other transforms...


LAPLACE TRANSFORM

To evaluate the Laplace transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / Laplace from the Symbolics menu.

Mathcad returns a function in the variable s when you perform a Laplace transform. If the expression you are transforming already contains an s, Mathcad avoids ambiguity by returning a function in the variable ss instead. Use the Substitute for Variable command to substitute a different variable or expression for s.

Other transforms...


INVERSE LAPLACE TRANSFORM

To evaluate the inverse Laplace transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / Inverse Laplace Transform from the Symbolics menu.

Mathcad returns a function in the variable t when you perform an inverse Laplace transform. If the expression you are transforming already contains a t, Mathcad avoids ambiguity by returning a function in the variable tt instead. Use the Substitute for Variable command to substitute a different variable or expression for t.

Other transforms...


z-TRANSFORM

To evaluate the z-transform transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / z-Transform from the Symbolics menu.

Mathcad returns a function in the variable z when you perform a z-transform. If the expression you are transforming already contains an z, Mathcad avoids ambiguity by returning a function in the variable zz instead. Use the Variable / Substitute command to substitute a different variable or expression for z.

Other transforms...


INVERSE z-TRANSFORM

To evaluate the inverse z-transform transform of a function:

Enter the expression to be transformed.

Click on the transform variable.

Choose Transform / Inverse z-Transform from the Symbolics menu.

Mathcad returns a function in the variable n when you perform an inverse z-transform. If the expression you are transforming already contains an n, Mathcad avoids ambiguity by returning a function in the variable nn instead. Use the Variable / Substitute command to substitute a different variable or expression for n.

Other transforms...


How to do it

There are two ways to do symbolic math:

Use the symbolic equal sign for live symbolic results. This method feels just as if you were doing numerical calculation.

Use menu commands. This method allows you to control more precisely the form of the symbolic result.


USING FUNCTIONS AND VARIABLES IN SYMBOLIC MATH

Built-in functions

Many built-in functions retain their usual meanings in symbolic calculation. Certain built-in functions do not have any reasonable meaning in the symbolic context and are therefore not evaluated. For example, statistical functions like linterp, or rnd make no sense symbolically.

Predefined constants

The symbolic processor recognizes π, e, and [image] because these have a well-accepted mathematical meaning. Other predefined constants such as TOL and ORIGIN have no such meaning and are not evaluated.

User-defined functions and variables

The symbolic processor recognizes user-defined functions and variables only if you're evaluating them with the symbolic equals sign.


NUMERICAL RESULTS WITH SYMBOLICS

Symbolic calculation is often useful for getting numerical results, particularly in cases like the following:

The results from the symbolic processor depend on whether the constants in your equation contain decimal points. If your constants are pure rational numbers like 1/2 or 4, the symbolic solver will try to find an exact solution. But if you type a decimal number (such as .5 instead of 1/2), the symbolic solver will return an approximate numerical answer.

You can also force numerical evaluation by the symbolic processor by using the Floating Point Evaluation command from the Evaluate pull-right menu.


DISPLAYING SYMBOLIC RESULTS

Symbolic display format

Large answers

Numerical results with symbolics

Special functions

Error messages in symbolics


SOLVING A SYSTEM OF EQUATIONS SYMBOLICALLY

To solve a system of equations symbolically:

Type the word Given.

Type the equations and inequalities below the word Given.

Type the Find function entering the unknowns as arguments.

Press Ctrl+. (the control key followed by a period). Mathcad displays the right arrow.

Click outside the Find function. Mathcad places the results in a vector. The results are in the same order as the arguments to the Find function.

The following is an example:


SOLVING EQUATIONS SYMBOLICALLY

Solving an equation symbolically

Solving a system of equations symbolically


In most cases, you will want to use the Evaluate Symbolically command to evaluate expressions symbolically.


You can use the Complex Evaluation command for evaluating expressions containing complex numbers. Mathcad will express the results in the form a+bi whenever possible.


When evaluating an expression involving p or e, you can use the Floating Point Evaluation command to force Mathcad to return numbers for these constants. Specify the number of digits to the right of the decimal point in the dialog box that appears after having chosen this command. By default, this number is set to 20.


Related Topics:

Large answers

Special functions

Live symbolic calculation


Other Transforms:

Fourier

Laplace

z

Inverse Laplace

Inverse Fourier

Inverse z


Built-in functions that retain their meaning when used symbolically include:

Trigonometric and hyperbolic functions and their inverses.

Logarithmic and exponential functions.

The Re and Im functions.

The erf function.

The gamma function.

The mod function.

The Heaviside step function.

The min and max functions.

The identity and eigenvals functions.

In general, these functions mean the same thing for both numerical evaluations and symbolic transformations, but there are three subtle differences:

Unlike the numerical mod function, the symbolic mod function requires an integer modulus, and can accept a polynomial as its first argument.

Certain of the symbolic inverse trigonometric functions use different branches in the complex plane.

The eigenvals function will work symbolically for complex as well as real matrices.


SYMBOLIC CALCULUS

Symbolic derivatives

Symbolic integrals

Limits


Limit operators
LIMITS

To evaluate the limit of an expression

Press Ctrl+L to create the limit operator. To create operators for limits from the left or right, press Ctrl+B or Ctrl+A.

Enter the expression in the placeholder to the right of "lim."

Enter the limiting variable in the left-hand placeholder below the "lim."

Enter the limiting value in the right-hand placeholder below the "lim."

Press Space until the entire expression is between the editing lines.

Choose Simplify from the Symbolics menu.

If the limit does not exist, you'll see an error message.


Inserting text
CREATING A TEXT REGION

To create a text region:

Click wherever you want to place the region.

Choose Text Region from the Insert menu. A text box will appear.

Begin typing. As you type, the text box grows to accommodate your text. The text box will disappear when you click outside the text region. The text will have the “Normal” text style.

To stop entering text, click outside the text region. Do not press "Enter." Doing so will simply create a new line inside the text region.


CONTROLLING THE WIDTH OF A TEXT REGION

As you type into a text region, the region will continue to grow until it encounters the right margin. There are two ways to resize the text region:

Using the mouse, and

Using the keyboard.

Note that once a text region has been created, changing the right margin has no effect on its width.


USING A MOUSE TO RESIZE A TEXT REGION

To change the width of a text region using the mouse:

Select the text region.

Move the cursor to a handle on the side of the region. It should change to a double-headed arrow.

Drag the mouse to the right or left. The text region will change size as you drag the mouse.

Once the text region is the right size, let go of the mouse button.


USING THE KEYBOARD TO RESIZE A TEXT REGION

To change the width of a text region using the keyboard:

Click in the text region and move the insertion point to wherever you want the text region to wrap.

Press Ctrl+Enter.

Note that this method can only be used to make a text region narrower. To make a text region wider, you must use the mouse.


Right margin

This is an amber-colored vertical line in your worksheet. There are potentially two such lines:

a dashed vertical line whose placement is controlled by your choice of printer, and

a solid vertical line whose placement is controlled by choosing Page Setup from the File menu.

As you type into a text region, it continues to grow until it encounters the first of these two vertical lines.


You can align text either:

flush with the left margin

flush with the right margin, or

centered relative to both margins.


You can indent:

all lines of text relative to the left margin

the first line of text relative to all other lines of text.


Hanging indent

A hanging indent, sometimes called an "outdent," occurs when the first line of a paragraph extends to the left of all the other lines in that paragraph.


IMPORTING TEXT

To paste text from another application into your worksheet:

Copy the text from that application into the clipboard.

Click in the worksheet and choose Paste from the Edit menu.


Default text font:

This is the font you see when you first type in a text region. It is based on the “Normal” text style.


SELECTING TEXT

To select a group of characters:

Place the insertion point at one end of the selection.

Drag the mouse to the other end of the your selection.

Once there, let go of the mouse button. The selected area will be highlighted.

To select one word of text:

Double-click on just one word of text to highlight it.

You can also select text using the arrow keys to select text character by character, word by word, or line by line.


To select text charcter by character using the arrow keys:

Place the insertion point at one end of the selection.

Press Shift and an arrow key. Mathcad highlights text characters in the direction of the arrow key used.


To select text word by word using the arrow keys:

Place the insertion point at one end of the selection.

Press Ctrl + Shift and the left or right arrow key. Mathcad highlights from the insertion point to the beginning of the current or next word in the direction of the arrow key used.


To select text line by line sing the arrow keys:

Place the insertion point at one end of the selection.

Press Ctrl + Shift and the up or down arrow key. Mathcad highlights from the insertion point to the beginning or end of a line.


SELECTING TEXT REGIONS

To select an entire text region:

Click the mouse just outside the text region. This anchors one corner of the selection rectangle.

Press and hold down the mouse button. With the button still held, drag the mouse. A selection rectangle framed by dashed lines emerges from the anchor point.

When the selection rectangle just encloses the text region, let go of the mouse button.

To select more than one text region, drag the mouse until the dashed selection rectangle encloses everything you want to select.


Editing text
EDITING EXISTING TEXT

To copy or cut text:

Select the text

Choose Copy from the Edit menu to copy or Cut from the Edit menu to cut.

To paste text:

Click in the text region into which you wish to paste text.

Move the insertion point to wherever you want to insert the text.

Press Paste from the Edit menu to paste the text.

To delete text from an existing text region, click in the region and:

Press Bksp to delete the character to the left of the insertion point.

Press Del to delete the character to the right of the insertion point.

To overtype text:

Place the insertion point to the left of the first character you want to overtype.

Press the Ins key and begin typing. The insertion point now has a break in the middle to indicate that you are in overtype mode. To return to the default insert mode, press Ins again.


In general, you can move the insertion point around in a text region by clicking with the mouse. However, you can also use the arrow keys to move the insertion point character by character or line by line within text. Pressing Ctrl and an arrow key moves the insertion point word by word or paragraph by paragraph.


CHECKING THE SPELLING OF TEXT

To spellcheck text in your worksheet:

Select the text you want to spellcheck. If you do not select text, the spell-checker will check all the text in the worksheet, from the cursor to the end of the worksheet.

Choose Check Spelling from the Edit menu.

When the spell-checker finds a misspelled word, it brings up the Check Spelling dialog box showing the misspelled word along with any suggested replacements.


The spell-checker considers a word misspelled when it is not found in its dictionary. Note that you can add words to this dictionary using the Check Spelling dialog box.


Changing text fonts
CHANGING TEXT FONT PROPERTIES

When you first enter text, its properties are determined by the worksheet or template defaults for the style called “Normal.” To change the font, size, style, color, or position of a particular section of text:

Select the text.

Choose Text from the Format menu.

Choose from among the various font properties available in the dialog box and click "OK."

Note that in order to change all the text based on a particular text style , you need to modify the style properties or you can apply a different style.


Font refers to the typeface family of the text.


Size refers to the size of the characters in points.


Style refers to the actual face chosen within the typeface family such as bold, italic, or underline.


Position refers to whether the text is subscripted, superscripted, or neither.


MODIFYING AN EXISTING TEXT STYLE

To change all the text based on a particular text style, such as the default text style “normal,” modify the text style:

Choose Style from the Format menu to bring up the Text Styles dialog box showing the available styles.

Select the name of the text style you want to modify and click “Modify.”

You will see a dialog box displaying the definitions of that text style:

Click on the “Font” button to modify the text formats such as the font, size, style, color, or special effects. Click on the “Paragraph” button to modify the indentation and alignment for that text style.

Click “OK” to save your changes.

Any new text regions to which you apply the modified text style will reflect the new definition for that text style. In addition, any text regions previously created with the text style will redisplay according to the definitions of the new text style.


APPLYING A TEXT STYLE

When you create a text region, the “Normal” text style is applied to it. However, your worksheet or worksheet template provides you with one or more text styles which you can apply to any text region to determine its appearance.

To apply a different text style to a text region:

Click in the text region.

Choose Style from the Format menu to see the Text Styles dialog box.

Select one of the available text styles and click “Apply.” The default text in your region acquires the text and paragraph properties associated with that style.

When you apply a text style to a text region, the region’s paragraph properties change to those of the applied text style.

Text you have previously selected and formatted by changing the font properties will retain its previous appearance. If you previously only modified text properties other than the font in the selected text, the selected text will now acquire the text properties of the style with the addition of the particular style, size, and effects chosen.


Available text styles will differ depending on the worksheet template you based your worksheet on.


Alignment

You align the text at either the left edge or right edge of the text region, or to center the text within the text region.

Use the corresponding buttons in the Paragraph Format dialog box to control the alignment or use the three alignment buttons on far right of the Format Bar.


Left aligned text

Click on this button to align all the text in a text region against the left edge of the region.


Centered text

Click on this button to center all the lines of a text region.


Right aligned text

Click on this button to align all the text in a text region against the left edge of the region.


Indentation

You can indent every line in the text region the same amount, or you can indent the first line of the text region a different amount than the rest of the lines, as for a conventional or hanging indent.

To indent every line in the text region the same amount, enter a value (in inches) in the All Lines text box in the Paragraph Format dialog box. To indent the first line of the text region a different amount than the rest of the lines, enter a different value (in inches) in the First Line text box.


CHANGING TEXT PARAGRAPH PROPERTIES

The paragraph properties of a text region consist of alignment and indentation for either the first or all lines in the text region. When you first create a text region in your worksheet, the lines in the region are left aligned and not indented. You can change these properties for an individual text region by doing the following:

Select the text region by clicking on it.

Choose Paragraph from the Format menu to see the Paragraph Format dialog box.

Change the appropriate Alignment or the Indentation properties in the dialog box and click “OK.”


CREATING A NEW TEXT STYLE

To create a new text style:

Choose Style from the Format menu. Mathcad brings up the Text Styles dialog box showing the currently available text styles.

Click “New.”

In the Define Styles dialog box, enter a name for the new style in the “Name” text box.

If you want to base the new style on one of the existing styles in the current worksheet or template, select a style from the “Based on” drop-down list.

Click on the “Font” button to make your choices for text formats for the new style. Click on the “Paragraph” button to choose alignment and indentation options for the new style.

Click “OK” when you have finished defining the new style.

Your new style will now appear in the Text Styles dialog box and can be applied to any text region. When you save the worksheet, the new text style is saved with it. If you want to use the new text style in your future worksheets, save your worksheet as a template.


If you base a new text style on an existing text style, any changes you later make to properties of the original text style that carry over to the new text style will be reflected in any text regions that have the new text style. In addition, the properties of the new text style will be updated for future applications of the style.


DELETING A TEXT STYLE

You may choose to delete a text style at any time. To do so:

Choose Style from the Format menu. Mathcad brings up the Text Styles dialog box showing the currently available text styles.

Select one of the available text styles from the list.

Click “Delete.”

The text style is removed from the list of available text styles. Any text regions in your worksheet whose text and paragraph properties were defined in terms of that text style will continue to display the properties of that style, however.


Text Styles

A text style is a tag used to assign text fonts and paragraph properties to entire text regions. Every worksheet has a default, “normal” text style with a particular choice of text and paragraph properties.


TEXT STYLES

Mathcad uses text styles to assign default text and paragraph properties to entire text regions. Every worksheet has a default, “normal” text style but other styles are available. You can apply a style to a region, modify an existing style, create a new style, or delete a style.

Applying a text style

Modifying a text style

Creating a text style

Deleting a text style


HIGHLIGHTING A TEXT REGION

To apply a background highlight color to a text region:

Click in the equation you want to highlight.

Choose Properties from the Format menu.

Click on the Region tab.

Click in the box next to “Highlight Region.” Click “Choose Color” to choose a highlight color other than the default choice.

Click “OK.”

Mathcad fills a box around the text region with either the default background highlight color or the color you chose. To change the default background color of a highlighted equation:

Choose Color / Highlight from the Format menu to bring up a dialog box containing a palette of colors.

Click on the appropriate color.


MOVING TEXT

To drag a text region:

Select the text region.

Move the mouse pointer to one of the borders of the selection rectangle. The pointer turns from an arrow into a small hand.

Drag the mouse. The selected text will move with it.

To cut and paste a text region:

Select the text region.

Choose Cut from the Edit menu to cut it to the clipboard.

Click the mouse where you want to put the text and choose Paste from the Edit menu.


Pasting text

When you choose Paste from the Edit menu, you insert whatever text was last copied or cut. This text goes wherever the cursor is located.


Copying text

When you choose Copy from the Edit menu, you replace whatever is on the clipboard with whatever text you have selected.


Cutting text

When you choose Cut from the Edit menu, you:

Replace whatever is on the clipboard with whatever text you have selected.

Remove the selected text from your worksheet.


CHECK SPELLING DIALOG BOX

When the spell-checker finds a misspelled word and brings up this dialog box, you have several options:

To change the misspelled word to the suggested replacement in the "Change to" box, click on "Change."

To change the misspelled word to one from the list of replacements, select one and click on "Change."

To see additional but less likely replacements, click on "Suggest."

To change the misspelled word to one not listed, type the replacement into the "Change to" box and click on "Change."

To leave the word as is, click "Ignore" or "Add." If you click on "Ignore," the spell-checker leaves the word alone and continues spellchecking. If you click "Add," the spell-checker adds the word to the dictionary. The spell-checker will then consider it spelled correctly for future spellchecks.


DRAGGING THE MOUSE

To drag the mouse:

Press and hold down the mouse button.

Without letting go of the mouse button, move the mouse.


Text region

A rectangular area reserved for typing text. A text region can have any width and be placed anywhere in the worksheet.


Math region

This is a region containing a math expression or a plot. Math regions are live. This means changes you make to them will affect other math regions throughout the worksheet.


Text box

This is the rectangular box surrounding a text region when the insertion point is inside it. When you click outside of a text region, the text box disappears.


INSERTING MATH IN TEXT

You can insert a math region into a text region. This math region will continue to be live, just as if it were outside text. To insert a math region into a text region:

Click in the text region into which you want to place the math region.

Choose Math Region from the Insert menu to create an empty placeholder.

Type the equation into this placeholder just as you would enter it anywhere else in your worksheet.

When you're done entering the equation, click elsewhere in the text region to go back to text mode.

Note that when you insert an equation into text, it affects calculations throughout the worksheet. If you want the equation to be purely cosmetic, you can turn it off.


Related Topics:

Inserting text

Inserting math in text

Editing text

Highlighting a text region

Controlling the width of a text region

Importing text

Selecting text

Selecting text regions

Moving text

Spell checking

Changing text fonts

Changing text paragraph properties

Working with text styles


Related Topics:

Applying a text style

Modifying a text style

Creating a text style

Deleting a text style

Inserting text

Editing text

Changing the font of selected text


UNITS AND DIMENSIONS

When you first start Mathcad, a complete set of units is available for your calculations. You can attach these built-in units to your variables or define and attach your own units. Mathcad checks for dimensional consistency and automatically displays results in terms of the appropriate units for the unit system you’ve chosen.

List of built-in units

Attaching units to a variable

Unit conversions

Choosing a system of units

Defining a new unit

Renaming dimensions


UNIT CONVERSIONS

Mathcad automatically displays results in terms of the fundamental units for whatever unit system you’ve chosen. However, you can have Mathcad redisplay a particular result in terms of any of Mathcad’s built-in units.

The example below shows how to convert a single result into units other than the fundamental units. It assumes the result already has units. If the result doesn't have units, there won't be any meaningful way to convert units. You'll need to attach units to whatever expression gives the result. Click on the buttons below to see a step by step example of how to convert units.

Click in the result to see the unit placeholder.

Click on the unit placeholder.

Type any combination of units in the unit placeholder.

Click outside the expression to redisplay the result in terms of the selected units.

See Mathcad Quicksheets for an example of converting units on a plot, a table, or a matrix of results.


To illustrate this, suppose someone asked you to display "3" in terms of inches. You'd be tempted to ask "3 what?" You could easily display "3 ft" as "36 inches"...but you certainly can't display "3" all by itself in terms of inches.


Alternatively, you can see a list of built-in units by choosing Unit from the Insert menu.


Fundamental units

The fundamental units are those used for the fundamental dimensions of length, mass, time, charge or current, temperature, luminosity (SI unit system), and substance (SI unit system). The fundamental units are different for each unit system.

Unit System	Fundamental units

MKS 	meters (m), kilograms (kg), seconds (sec), coloumbs (coul), Kelvin (K)

CGS	centimeters (cm), grams (gm), seconds (sec), coloumbs (coul), Kelvin (K)

US	feet (ft), pounds (lb), seconds (sec), coloumbs (coul), Kelvin (K)

SI	meters (m), kilograms (kg), seconds (s), amps (A), Kelvin (K), candella (cd), moles (mole)


Related Topics:

Built-in units

Attaching units to a variable

Unit Conversions

Choosing a system of units

Defining a new unit

Renaming dimensions


ASSOCIATING A UNIT WITH A VARIABLE OR CONSTANT

To associate a unit with a variable or constant, simply multiply it by the name of the unit. Click on the buttons below for a step-by-step example:

Click in the variable or constant.

Press "∗" to insert a times sign and a placeholder.

Type the name of any unit in the placeholder or choose Unit from the Insert menu.

When you enter units in the units placeholder, Mathcad divides the value to be displayed by whatever you enter in the placeholder. This ensures that the complete displayed result - the number times the expression you entered for the placeholder - is a correct value for the equation.


Regardless of the unit system you have chosen, most units (there are a few exceptions) are available to you. For example, when CGS is selected, you’ll still be able to use kg and lb even though these are not, strictly speaking, part of the CGS system of units.


DEFINING A UNIT

Since you already have a collection of built-in units, you'll rarely need to define your own. You can, however, define a unit just as you would define a variable:

Type the name of the unit you want to define.

Press ":" to insert the ":=" sign.

In the placeholder, type the unit or combination of units you want your new unit to be defined as.

After you've done all this, the new unit will be available everywhere below and to the right of where you defined it.


CHOOSING A SYSTEM OF UNITS

Unless you specify otherwise, you'll see your results displayed in terms of the fundamental SI units: m, kg, s, K, A, cd, and mole. To choose a different system of units:

Choose Options from the Math menu and click on the Unit System tab.

Click on the whatever default system of units you want to use.

If you set the unit system to None, you can still define and use your own units. To do so, define your own units in terms of the special built-in constants 1L, 1M, 1T, 1Q, 1K, 1C, and 1S which represent the dimensions length, mass, time, charge or current, absolute temperature, luminosity, and substance. For example, you can define kg:=1M, sec:=1T, and m:=1L.


System of Units dialog box
Click on the various parts of the dialog box below to see what they're for:


Click here to display results in terms of meters, kilograms, seconds, amps, Kelvin, candellas, and moles  unless otherwise specified.


Click here to display results in terms of centimeters, grams and seconds unless otherwise specified.


Click here to display results in terms of meters, kilograms, seconds, coulombs, and Kelvin unless otherwise specified.


Click here to display results in terms of feet, pounds, seconds and coulombs unless otherwise specified.


Click here to disable all built-in units. Note that the units in the picture below are displayed in red to show that they are undefined.


INSERTING BUILT-IN UNITS

An easy way to insert a built-in unit is to use the "Insert Unit" dialog box. To do so:

Click on a unit placeholder and choose Unit from the Insert menu.

Choose Unit from the Insert menu to open the Insert Unit dialog box.

Find the unit you want to use in the scrolling list of units on the right. To display only those units corresponding to a particular physical quantity, use the scrolling list on the left.

Once you've found the unit name, double-click on it.


RENAMING DIMENSIONS

By default, results are displayed in terms of m, kg, s, A, K, cd, and mole. To change this to something like meter, kilo, s and degrees:

Choose Options from the Math menu and click on the Dimensions tab.

Click on the “Display dimension names” checkbox.

Type the desired dimension names in place the names in the text boxes and click OK.

Renaming the dimensions may be useful when you prefer to use more appropriate names for your work. For example, a car salesman might define trucks and sedans rather than length and mass. In short, a dimension is nothing more than a way of tagging numbers so you can keep better track of them.


Click here to display results using dimension names other than the default.


After you click the box next to ‘Display dimensions,’ you can type any dimension names here.


Click on the various parts of the dialog box below to see what they're for:


Insert Unit dialog box


Shows the default system of units. This controls how a result is displayed when you don't specify the units with which to display it.

To change this, choose Options from the Math menu and click on the Unit System tab.


Use this to control the units displayed in the right-hand list. This confines the list of displayed units to those having the appropriate dimensions. To show the complete list of units, scroll to the top of the list and choose "Dimensionless."

If you click on a numerical result, this will automatically be set to whatever dimension is appropriate for that result.


This is a list of units available for the dimension selected in the left-hand list. To show the complete list of units, scroll to the top of the list in the left-hand box and choose "Dimensionless" from the top of that list.

Double-clicking on a unit in this box will insert it into your worksheet.


List of built-in units
BUILT-IN UNITS

This is a list of all built-in units available. All except those underlined are available in either the SI, MKS, CGS or US systems. You can see a list of currently available units in the Insert Unit dialog box by choosing Unit from the Insert menu.

A

acre

amp

atm

bhp

Bq

BTU

BTU15

c_

c

C

cal

cal15

cal20

CBTU

cd

cm

coul

day

dcal

deg

dyne

ehp

erg

F

farad

fl_oz

ft

g

gal

galUK

gauss

GHz

gm

Gy

H

hectare

henry

hhp

hp

hpUK

hr

Hz

Hza

IBTU

in

in_Hg

J

joule

K

KΩ

kA

KA

kcal

kg

kgf

kHz

KHz

km

kph

kV

KV

kΩ

kW

L

lb

lbf

liter

lm

lx

m

mBTU

mcal

MΩ

mA

mH

mole

μA

μF

μH

mhp

mho

mg

MHz

mi

min

mL

mm

mph

mV

N

nF

newton

Ω

Oe

oersted

ohm

oz

Pa

pF

poise

psi

R

rad

S

s

sec

siemens

slug

statamp

statcoul

statfarad

stathenry

statohm

statseimens

stattesla

statvolt

statweber

stokes

str

Sv

T

tBTU

tcal

tesla

ton

tonne

torr

V

volt

W

watt

Wb

weber

yd

yr

Ω


Available only in CGS.

Not available in SI, MKS, or US.


Available only in SI and US

Not available in CGS or MKS.


Available only in US.

Not available in SI, MKS, or CGS.


Available only in SI.

Not available in MKS, CGS, or US.


Available only in MKS and US.

Not available in CGS or SI.


Available only in MKS , SI, and US.

Not available in CGS .


VECTOR FIELD PLOTS

A vector field can be thought of as a function which assigns to a point in the plane a vector which starts at a given point.  You can create a two-dimensional vector field plot in Mathcad by creating a matrix of complex numbers. The base of each vector sits on the x and y values corresponding to the rows and columns of the matrix. The magnitude and direction of each vector are derived from the real and imaginary parts of the matrix elements.

Creating a vector field plot

Deleting a vector field plot

Moving a vector field plot

Changing the size of a vector field plot

Axis settings

Adding a title to a vector field plot

Animating a vector field plot


CREATING A VECTOR FIELD PLOT

To create a graphical representation of a two dimensional vector field:

Define a matrix containing as many elements as there are vectors to plot.

Each matrix element is a two-dimensional vector represented by a complex number. The real part of that number is the x component of the vector. The imaginary part is the y component.

The location of an element in a matrix maps to the location of the corresponding vector in the xy plane.

Choose Graph / Vector Field Plot from the Insert menu to create a vector field plot region.

Place the name of the matrix in the placeholder.

See Mathcad Quicksheets for an example.

Alternatively, you can use two real matrices having the same number of rows and columns. Corresponding elements of these matrices represent the x and y components of a particular vector. You would then enter the names of these matrices, separated by a comma, in the placeholder.

If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.


AXIS SETTINGS (VECTOR FIELD PLOTS)

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the Axes tab.

Each axis has the following check boxes associated with it. Click on an option to learn more about it:

Grid lines

Numbered

Auto grid

Min. Val./Max. Val.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.

See Mathcad Quicksheets for an example of a vector field plot displayed with different axis settings.


ADDING A TITLE TO A VECTOR FIELD PLOT

To add a title to a vector field plot:

Double-click on a plot to open a tabbed dialog box.

Click on the Title tab.

In the text box, type the title for your graph. You can use upper- and lowercase letters in the title.

Click on either the "Above" or "Below" button. Then click "OK" to display the title of the graph region or "Cancel" to restore the title text box to its original state.

Click on "Show Title" to toggle it off if you don't want the title to appear on your graph. Or backspace over the title to it from the text box and to delete it from the graph.


Grid Lines

When this box is checked, the tick marks on the selected axis are replaced by grid lines.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto Grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 1 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Min. Val./Max. Val.

The Min. Val. and Max. Val. text boxes let you control the axis limits for the specified axis. Since the vector field plot is made by plotting the elements of a matrix, Mathcad has no way of knowing the actual values of the x and y axes. The row and column numbers therefore have no real significance as coordinates. They affect the display only. By default, Min and Max are set to -1 and 1 respectively.


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed on the screen.


Two dimensional vector field

In a vector field, each point (x, y) has a vector associated with it. A vector field plot shows this vector as a small arrow emerging from each point. The arrow's length and direction correspond to the magnitude and direction of this associated vector.


X-Y PLOTS

X-Y plots are useful for plotting functions, mathematical expressions, and sets of data (stored in vectors). Once you’ve created an X-Y plot, you can format it to your liking. Mathcad also allows you to zoom in on parts of an X-Y graph or extract the coordinates from a particular spot.

Creating a plot

Deleting a plot

Moving a plot

Changing the size of a plot

Axis limits

Axis settings

Axis labels

Trace settings

Legends

Zooming in

Reading coordinates

Titles on plots

Default settings

Animating an X-Y plot


CREATING AN X-Y PLOT

To create an X-Y plot:

Choose Graph / X-Y Plot from the Insert menu to create a plot region.

In the middle placeholder under the horizontal axis, enter the expression you want to plot on the x axis. For example, type ‘m’ if you had previously defined ‘m’ as a range variable. (Do not define ‘m’ if you want to create a Quickplot..)

In the middle placeholder beside the vertical axis, enter the expression you want to plot on the y axis. For example, type ‘m^2’ to plot the squares of ‘m’.

Mathcad graphs one point for each value of the range variable and, unless you specify otherwise, connects them with straight lines.

You can graph any expression against any other expression, as long as they share the same range variables. You can also graph more than one curve on a graph.

If a point is complex or imaginary, Mathcad does not plot it. To plot the real or complex part of a point, use the Re and Im functions which pull off the real or imaginary parts.

See Mathcad Quicksheets for graphing examples.


CONTROLLING WHICH POINTS TO PLOT

By default, the values of the independent variable (x) are automatically generated. You can, if you prefer, control exactly which points to plot by using range variables on the x-axis. To do so:

Define a range variable that takes on values corresponding to those values of x at which you want to plot.

Press @ to create a plot region.

In the middle placeholder under the horizontal axis, enter the range variable

In the middle placeholder beside the vertical axis, enter the expression you want to plot on the y axis.


CHANGING AXIS LIMITS OF X-Y PLOTS

To override the default axis limits:

Click in the plot to select it. You'll see four numbers, one by each axis limit.

To set the axis limit on the horizontal axis, click on the number below the appropriate x-axis limit and replace it with the number at which you want the axis to end.

For the vertical axis, do the same thing to the number to the left of the appropriate axis limit.

Click outside the plot region to redisplay the plot using the numbers you specified as axis limits.


ZOOMING IN ON AN X-Y PLOT

To magnify a portion of a plot:

Click in the plot to select it.

Choose Graph / Zoom from the Format menu to bring up the Zoom dialog box.

In the plot region, press and hold down the mouse button at one corner of the region you want to magnify.

Drag the mouse until a dashed selection rectangle encloses the region you want to magnify.

Click "Zoom" to redisplay the plot.

When you click "Zoom," the axis limits are temporarily set to the coordinates specified in the Zoom dialog box. To make these axis limits permanent, click "OK."


Getting a readout of X-Y plot coordinates
GETTING A READOUT OF PLOT COORDINATES

To see a readout of the coordinates on any point on a trace:

Click in the plot to select it.

Choose Graph / Trace from the Format menu to open the Trace dialog box.

In the plot region, click and drag the mouse along the trace whose coordinates you want to see. A dotted crosshair jumps from one point to the next as you drag it along the trace.

You'll see the coordinates corresponding to the location of the crosshair in the "X-Value" and "Y-Value" boxes. These coordinates change as you move the mouse.

When you release the mouse button, you'll see the x and y values of the last point you selected in the dialog box.

To copy a coordinate value to the clipboard:

Click the "Copy X" or "Copy Y" button to place the corresponding coordinate on the clipboard.


ADDING A TITLE TO AN X-Y PLOT

To add a title to a plot:

Double-click on the plot to open a tabbed dialog box.

Click on the Labels tab.

In the text box, type the title for your plot. You can use upper and lower case letters in the title.

Click on either the "Above" or "Below" button.

Click on “Show Title.” Then click "OK" to display the title of the plot region.

To remove the title in the text box, click on "Cancel" to restore the title text box to its original state.

To hide the title, uncheck the "Show Title" check box to toggle it off. To delete the title altogether, backspace over it.


LABELING AXES ON AN X-Y PLOT

To label an axis of a plot:

Double-click on the plot to open a tabbed dialog box.

Click on the Labels tab.

In this dialog box, type in a label for either or both axes. You can use upper and lower case letters in the label.

Click "OK" to display the labels you've specified.

To remove the label from the text boxes, click on "Cancel" to restore the label text boxes to their original state.

To delete the labels altogether, backspace over them.


AXIS SETTINGS (X-Y PLOTS)

To select the characteristics of each axis:

Double-click on a plot to open a tabbed dialog box.

Click on the X-Y Axes tab.

Each axis has the following check boxes associated with it:

Log scale

Grid lines

Numbered

Autoscale

Show markers

Auto grid

Axes style

Equal scales

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


TRACE SETTINGS (X-Y PLOTS)

To select the characteristics of each trace:

Double-click on a plot to open a tabbed dialog box.

Click on the Traces tab.

Click on the trace's name under the Legend Label column of the scrolling list in the middle of the dialog box. The characteristics assigned to that trace appear in the six text boxes under the corresponding columns. These are:

Legend label

Symbol

Line

Color

Type

Weight

To change any of these characteristics, click on the arrow beside the appropriate text box to see a drop-down list of options.

To change the characteristics for another trace, click on its name in the scrolling list in the middle of the dialog box. Then assign its characteristics as described above.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


LEGEND SETTINGS (X-Y PLOTS)

To create a legend for identifying each trace:

Double-click on a plot to open a tabbed dialog box.

If necessary, click on the Traces tab.

Assign names to each trace by clicking the default names listed in the Legend label column of the scrolling list in the middle of the dialog box. You'll see the name reproduced in the text box below this column.

To change the name of the trace, type the new name in the text box under the Legend label column.

To control whether the legend is displayed or hidden, use the "Hide Legend" check box.

To control whether the expressions that created the plot are also displayed, use the "Hide Arguments" check box.

When you're done, click "Apply" to preview the plot. Click "Close" or "OK" to dismiss the dialog box.


DEFAULT SETTINGS (X-Y PLOTS)

To reset a plot to the default settings:

Double-click on the plot to open a tabbed dialog box.

If necessary, click on the Defaults tab.

Click on the "Change to Defaults" button.

To make the default settings be those of a particular plot:

Double-click on the plot to open a tabbed dialog box.

If necessary, click on the "Defaults" tab.

Click on the "Use for Defaults" check box.

To set defaults without using a graph:

Make sure that you don't have any graphs selected.

Choose Graph / X-Y Plot from the Format menu to open the tabbed dialog box.

Change the appropriate settings on the X-Y Axes and Traces pages.

Click "OK" to accept your changes and close the dialog box.


Log scale

When this box is checked, the selected axis is logarithmic. The axis limits must be positive.


Grid lines

When this box is checked, the tick marks on the selected axis are replaced by gridlines.


Numbered

When this box is checked, the tick marks on the selected axis are numbered.


Auto grid

When this box is checked, the number of tick marks is chosen automatically.

To choose the number of tick marks yourself:

Click in the box to remove the checkmark.

Type an integer from 2 to 99 in the text box labeled "No. of grids." Make sure the number you type isn't so large that the labels on the tick marks crowd together too much.


Autoscale

By default, a plot you create is autoscaled. With "Autoscale" on, each axis limit is set to the first major tick mark beyond the end of the data.

With "Autoscale" off, the axis limits are set right at the data limits. To turn off "Autoscale" and have your plot drawn to the ends of the plot region:

Click on the "Autoscale" check box for the appropriate axis to toggle it off.


Show markers

This lets you add one or two horizontal or vertical lines to a plot. To do so:

Click on the "Show Markers" check box in the X-Axis: column for a vertical line and in the Y-Axis: column for a horizontal line. Click the "OK" button. You'll see two additional placeholders on each axis for which you have "Show Markers" selected.

To add a vertical line, click on one of the placeholders under the x-axis and type in a value at which you want a line drawn. For a horizontal line, do the same thing in one of the placeholders to the left of the y-axis.

Choose Calculate from the Math menu to redisplay the plot.


Track Data Points

Normally, the crosshair snaps from one data point to the next along a trace. To make the crosshair follow your pointer anywhere on the plot, uncheck the "Track Data Points" check box.


Legend label

This is the name of the trace as it appears on the legend.


Symbol

This controls whether each point on the curve is marked with a symbol. If you have a lot of points packed closely together, you should probably select 'none.'


Axes style

This controls whether the axes intersect in the center of the plot (crossed), whether they intersect in the bottom left of the plot (boxed), or whether they appear at all.


Equal scales

When checked, the x and y-axes have equal scales. This means that if one inch along the x-axis stands for 2 units, then one inch along the y-axis will likewise stand for 2 units.

When unchecked, the scale on the x-axis is independent of the scale on the y-axis.


Line

This controls whether the line is solid, dotted, dashed, or whether it consists of alternating dashes and dots. This provides a useful way to distinguish unmarked curves in black and white printouts.


Color

This controls whether the selected trace is red, blue, green, magenta, cyan (a light blue), brown, black, or white.


Weight

This controls how thick the curve is. Use 1 for fine curves and 9 for thick curves. Use "p" to make the finest possible curve, a single pixel wide. Keep in mind that a "p" curve may not print on printers with inadequate resolution.


Trace type

This controls whether the selected trace is shown as a curve, a symbol/point, a bar chart, error bars, as a stepped curve, or as a stem plot.


Hide Arguments

Check this box to hide the math expressions you typed in the middle placeholder of each axis.


Hide Legend

Check this box to hide the legend that appears under the plot.


Use for defaults

Check this box to use the current settings for all other plots in your worksheet.


Trace

A "trace" is another name for one of the curves or lines you're plotting.


Title

To add a title, enter it in the text box, indicate whether it goes above or below the plot, and be sure that "Show Title" is checked if you want the title to be displayed on the screen.


Axis labels

Type the text you want to have appear beside the axis in the corresponding text box. Make sure the check box beside it is checked. Uncheck this box to suppress the display of the axis label.


Use for defaults

Make the settings of the currently selected X-Y plot be the default settings for all X-Y plots created from now on.


Change to defaults

Restore all settings on the currently selected X-Y plot to whatever the default plot settings are.


GRAPHING MORE THAN ONE EXPRESSION

You can graph several curves on one graph by typing a comma between the arguments on each axis.

To graph several independent curves on the same set of axes for either an XY or Polar Plot:

Choose Graph / XY Plot or Polar Plot from the Insert menu to create a plot region.

In the middle placeholder under the horizontal axis (or the bottom placeholder on a polar plot), enter the first expression you want to plot. For example, type ‘m’ if you had previously defined ‘m’ as a range variable.

Type a comma. You’ll see a placeholder appear to the right.

Enter the second expression.

You can continue adding expressions separated by commas up to a total of 10 expressions.

In the middle placeholder beside the vertical axis (or the left-hand placeholder on a polar plot), enter the first expression you want to plot. For example, type ‘m^2’ to plot the squares of ‘m’.

Type a comma and enter the second expression..

You can continue adding expressions separated by commas; you must have the same number of expressions on each axis.

Mathcad matches up the expressions in pairs. It then draws a trace for each pair. Each matching pair of expressions should use the same range variable, but the range variable for one pair need not match the range variables for the other pairs.

To graph several y-axis (or radial axis) expressions versus one x-axis (or angle axis) expression, enter one expression on the x-axis (or angle axis) and multiple expressions separated by commas on the y-axis (or radial axis). You can plot up to 16 y-axis arguments.

See Mathcad Quicksheets for an example of multiple XY Plots or Polar Plots.


OPENING THE RESOURCE CENTER

The Resource Center is an electronic library containing information on a variety of topics including a Tutorial, in-depth guides to certain Mathcad features, and links to the Web.

To open the Resource Center:

Choose Resource Center from the Help menu.

You'll open up a new window showing the various topics available. Click on any topic to open it.


BROWSING THROUGH THE RESOURCE CENTER

There are two ways to find your way around the Resource Center:

Use the buttons on the toolbar along the top of the window.

Click on indicated regions with the mouse. The Resource Center contains jumps just like those in this help file. These jumps are usually underlined or otherwise marked.


Browsing the Web with Resource Center
BROWSING THE WEB WITH THE RESOURCE CENTER

MathSoft maintains a site on the World Wide Web specifically for use with Mathcad. You can also use the Resource Center to browse to any location on the World Wide Web. To browse to any World WideWeb page from within the Resource Center:

Click on the Web Toolbar button on the Resource Center toolbar. You’ll see an addtional toolbar with an “Address” line:

In the “Address” box, type a URL for a document on the World Wide Web.

The buttons to the left of the “Address” box let you bookmark a page for a later visit, reload the current page, and interrupt the current file transfer.


SEARCHING THROUGH THE RESOURCE CENTER

To find information on a topic:

Click the Search button on the toolbar along the top of the window. This opens a dialog box.

Type a word or phrase in the text box.

Click the Search button in the dialog box. Mathcad shows how many occurrences of that word or phrase are in the Resource Center, what sections they're in, and how many there are in each section.

To open a section, double-click on its title in the scrolling list.


COPYING INFORMATION FROM THE RESOURCE CENTER

To drag a region from the Resource Center to your worksheet:

Select the region(s) you want to move.

Move the mouse pointer into one of the regions enclosed by a dashed selection rectangle. The pointer will turn into a small hand.

Press and hold down the mouse button.

With the mouse button still held down, drag the regions from the Resource Center to the worksheet.

When the outlines are on the desired spots, let go of the mouse button.


MAKING NOTES IN THE RESOURCE CENTER

You can make changes in the Resource Center by typing them in just as you would in any worksheet.

Anything you add to or change in the Resource Center will appear in a different color. To control this color, choose Color / Annotation from the Format menu.

To undo any changes you make and restore the original Resource Center, simply close the Resource Center window or exit the application.


RESOURCE CENTER TOOLBAR

The toolbar below appears in the Resource Center window. Click on the buttons to learn what each one does. The toolbar in some Mathcad editions may contain additional buttons.


Start Page

Jumps to the main menu of Resource Center topics.


Next Topic

Jumps to the beginning of the next section.


Previous Topic

Jumps to the beginning of the previous section.


Back

Jumps to whichever section was last viewed regardless of its location within the Resource Center.


Forward

Jumps to whichever section was last viewed before you used the Back button.


Search

Searches the entire Resource Center for a particular word or phrase.


History

Shows a listing of all sections you've visited so far and gives you a chance to revisit any one of them by clicking on the list.


Copy

Copies the selected regions to the clipboard.


Web Toolbar

Opens a web browsing toolbar. Enter any URL in the address box to open a document on the Web.


Print

Prints the current section.


Save As

Saves the current section as a worksheet you can open later by choosing Open from the Mathcad File menu.


Bookmark

Lets add the current page to your list of bookmarks, edit/organize your list of bookmarks, go to a particular bookmarked page.


Reload

Refreshes the current page by reloading it.


Cancel

Cancels the current process.


Address

Brings you to the document on the Web whose URL you enter.


Some editions of Mathcad may show additional buttons in the Resource Center.


Overview

A high level introduction to Mathcad’s computational features.


Tutorial

Jumps to a tutorial demonstration of some of the basic principles of using Mathcad.


Reference Tables

Jumps to a library of useful mathematical and engineering formulas, physical constants, properties of various materials, and other useful information you would ordinarily look up in any reference book.


Web Link

Jumps to a MathSoft Web Site containing Mathcad worksheets.


Practical Statistics

Jumps to an introduction to hypothesis testing and data analysis in Mathcad.


The Treasury Guide to Solving

Taken out of our most popular electronic book, The Mathcad Treasury, this guide demonstrates and explains in detail how to use Mathcad for solving everything from a system of equations, to solving equations symbolically, to solving differential equations.


The Treasury Guide to Programming

Taken out of our most popular electronic book, The Mathcad Treasury, this guide demonstrates and explains in detail how to use programs in Mathcad to perform advanced calculations.


Quicksheets

A collection of Mathcad worksheets demonstrating a variety of calculations. To search for a Quicksheet on a particular function or operator, use the Search button on the toolbar at the top of the window.


Registration

Provides a jump to the product registration page on MathSoft’s World Wide Web site .


Mathsoft.com

Jumps to MathSoft’s home page on the World Wide Web (www.mathsoft.com).


Tech Support

Provides information on receiving Technical Support. Allows you to jump to the Technical Support page on MathSoft’s World Wide Web site.


Web Store

Jumps to MathSoft’s Web store for purchasing additional MathSoft products.


Sorry, this QuickSheet could not be opened automatically. To open a Quicksheet on this topic, choose Resource Center from the Help menu and click on the [image] button to search on this topic.


CREATING A NEW WORKSHEET

To create a new worksheet:

Choose New from the File menu to bring up the New dialog.

Choose a template on which to base your worksheet.

A new, untitled window will open. Depending on the template you chose, you may see equations, text, or other regions which you can edit.

Choose Save from the File menu and enter a name for the worksheet. The extension for the worksheet will be “.mcd”.


OPENING AN EXISTING WORKSHEET

To open a worksheet:

Choose Open from the File menu to display a scrolling list of worksheets in the current directory.

Double click on the name of the worksheet you want to open. (To change the current directory, click in the scrolling list of the Open dialog box.)

To open a worksheet located on the Internet:

Choose Collaboratory from the File menu to open the Collaboratory dialog box.

Enter the worksheet’s URL in the URL text box.

Click on the “Get” button.


MANAGING WORKSHEET WINDOWS

Although you can open several worksheets at once, only one worksheet will be the active worksheet. Here are some things you may want to do to your active worksheet:

Move it...

Resize it...

Maximize its size...

Iconify it...

Close it...

Replace it with another...

Stack it neatly on top of the other worksheets...

Tile it together with the other worksheets...


With the pointer on the window's title bar, press and hold down the mouse button and drag the window. When you've correctly positioned the window, release the mouse button.


With the pointer on the window's edge, press and hold down the mouse button and drag the mouse. When the window is the size you want, release the mouse button.


Click on the maximize button in the upper right corner of the window.


Click on the minimize button in the upper right corner of the window.


Choose Close from the File menu.


To make another worksheet the active worksheet, either click anywhere on its window or choose its name from the Window menu.


Choose Cascade from the Window menu. This will stack the active window over any other open windows without obscuring any of their title bars.


Choose either Tile Horizontally or Tile Vertically from the Window menu.


EXPORTING A WORKSHEET TO ANOTHER APPLICATION

You can turn an entire worksheet, complete with equations and plots, into an RTF file readable by most modern word processors. To do so:

Choose Save As from the File menu.

Choose Rich Text Format (*.rtf) from the "Save as Type" drop-down list in the Save As dialog box.

In the File Name box, type the name of the RTF file you want to create.

When you open this RTF file with a word processor, you’ll find all the Mathcad regions lined up one above the other at the left edge of the documents. You can then use your word processor to move these regions wherever you want to.


OPENING A WORKSHEET WITH ANOTHER APPLICATION

When you use another application to open an RTF file created with the Save As command:

The regions will no longer be editable. They can, however, be moved around freely.

The regions will be aligned along the left margin rather than laid out as they were in the original worksheet.


RTF (Rich Text Format)

This is a file format recognized by an increasing number of word processors and other applications. RTF is capable of representing not just simple text but graphics, equations, fonts, and document layout information like page breaks, margins and paragraph formats.


Regions

A region is either an equation, text or plot in a worksheet. To see the borders of all the regions in a worksheet, choose Regions from the View menu.


INCLUDING ONE WORKSHEET INSIDE ANOTHER

There may be times when you want to use formulas and calculations from one worksheet in another. One way is to use Copy and Paste  from the Edit menu to move whatever you need to move.

Another method is to include a reference to a worksheet. This procedure will make the current worksheet behave as if you had inserted into it the actual regions from the referenced worksheet. You won't see the regions themselves, however. Instead, you'll see an icon showing where the referenced worksheet regions take effect.

Choose Reference from the Insert menu to display the Insert Reference dialog box.

In the dialog box, click the “Browse” button to locate and select a Mathcad worksheet whose regions you want to refer to in the active worksheet. Alternatively, you may type the complete path or Internet address (URL) to a worksheet in the empty text box.

Click the box next to “Use relative path for reference” if you want a relative path.

Click “OK.”

Upon completing these steps, you'll see an icon showing where the included worksheet takes effect. If you double-click on that icon, you'll see the referenced worksheet. However, once you’ve inserted a reference to a worksheet, there is no need to have the referenced worksheet open.


The following icon appears in your worksheet, together with the pathname to the included file:


For example, you would type c:\Program Files\MathSoft\Mathcad\conform.mcd to insert a reference to the file conform.mcd located in the Mathcad folder. Or you could type  http://www.mathsoft.com/coeffs.mcd to insert a reference to a file located on the World Wide Web.


Relative path

Use a relative path if you want the location of the referenced file to be stored relative to the Mathcad worksheet containing the reference. This allows the reference to be valid even if you move the referenced file and the main worksheet, but keep the relative directory structure between the two the same. To use a relative path, the two worksheets must be on the same local or network drive.

If you specify a relative path, Mathcad displays a capital “R” in parentheses at the end of the path for the reference in your worksheet.


Referenced worksheet

This must be a worksheet that already exists. Once the worksheet has been referenced, do not move it to another directory. If you do, your worksheet will not know where to find it. If you plan to move the Mathcad worksheet containing the reference as well as the referenced worksheet, make sure you keep the relative directory structure between the two and make sure the link uses a relative path.


SAVING A WORKSHEET

To save a worksheet:

Choose Save from the File menu. This replaces the old copy of the worksheet.

To save the worksheet without replacing the old copy:

Choose Save As from the File menu.

Save the worksheet under a different name.

You can also use Save As to save a worksheet as a template, as an RTF file, or as a Mathcad 6 worksheet through the Save as Type drop down list.


SAVING A WORKSHEET AS A MATHCAD 6 WORKSHEET

In general, Mathcad worksheets are only upwardly compatible, but Mathcad 7 allows you to save a worksheet as a Mathcad 6 worksheet so that it will open in Mathcad version 6 for Windows or Macintosh. However, features in your worksheet new to Mathcad 7 will not be recognized in Mathcad 6.

To save a worksheet as a Mathcad 6 worksheet:

Choose Save or Save As from the File menu.

In the “Save as type” drop-down list, select “Mathcad 6 Files” and provide a file name.

Click “Save.” A message will appear warning you that certain features available only in Mathcad 7 will not work in Mathcad 6.

When you open a Mathcad 7 worksheet saved as a Mathcad 6 file in Mathcad 6 for Windows or Macintosh, you may see an additional warning indicating that certain features are not supported. You’ll also notice that features that are only available in Mathcad 7 will appear as bitmaps in Mathcad 6 and any regions that depend on them will issue error messages. Such features include strings, some symbolic keywords, components, and QuickPlots.


RENAMING A WORKSHEET

To rename a worksheet:

Choose Save As from the File menu to display a dialog box.

Enter the new name of the worksheet in the text box.


CLOSING A WORKSHEET

Choose Close from the File menu to close the active worksheet.

If any changes have been made to this worksheet since it was last saved, you'll be prompted to save the worksheet before closing.

If you want to exit Mathcad completely, choose Exit from the File menu.


EXITING

Choose Exit from the File menu to exit completely.

If any changes have been made to any open worksheet since it was last saved, you'll be prompted to save them before quitting.

If you just want to close a worksheet, choose Close from the File menu.


CREATING A NEW TEMPLATE

Although Mathcad provides a variety of built-in templates, you can extend the collection of templates by creating your own. For example, you may want to create a template for a project that contains specific information in the worksheet header and footer, graphs and text in certain places, or you may want to customize other settings.

To create a new template:

Create a new worksheet having the settings you want. The worksheet should also contain any equations, text, and graphics that you want in the template.

Choose Save As from the File menu to display a dialog box.

Double-click on the Template folder in the Save As dialog.

In the “Files of type” drop-down list, select “Mathcad Template.”

Type a name for the template in the “File name” box.

Click “Save.” The file is saved as a Mathcad template file (with the extension .mct) in the template subdirectory by default, but you may save it in another location if you wish.

Your template will be added to the list of templates available in the dialog box when you choose New from the File menu to create a new worksheet.


The template specifies the following:

Default text properties

Definitions of all math styles

Definitions of all text styles

Headers and footers

Margins for printing

Numerical result formats

Values for Mathcad's built-in variables

Names of Mathcad's basic units

The default unit system

The default calculation mode


MODIFYING A TEMPLATE

To modify an existing worksheet template,

Choose Open from the File menu.

In the “Files of type” drop-down list, select “Mathcad Template.”

Type the name of the template in the “File name” box, or browse to the Template directory or elsewhere to locate it.

Click “Open.” The template opens in the Mathcad window.

Edit the template as you would modify any Mathcad worksheet.

Choose Save from the File menu. If you want to give a new name to the modified template, choose Save As from the File menu instead and enter a new name for the template in the dialog box.

Note that when you modify a template, your changes affect only new files created from the modified template. The changes will not affect any worksheets created with the template before the template was modified.


WORKING WITH ARRAYS

While ordinary variables hold a single value, arrays (the general term for vectors and matrices) hold many values. You can create vectors and matrices and use them in your calculations and variable definitions just as you would numbers. Many of Mathcad’s operators and functions can be used with arrays, but there are also special array operators and functions for array manipulation.

Creating vectors and matrices

Displaying vectors and matrices

Computing with arrays

Changing the size of an array

Extracting elements, rows and columns

Beginning arrays at an element other than zero

Limits on array sizes

Vector and matrix functions

Vector and matrix operators

Matrix manipulation

Nested arrays


CREATING VECTORS AND MATRICES

The easiest way to create an array is to create an array of empty placeholders and just fill them in.

To do so:

Choose Matrix from the Insert menu to bring up a dialog box.

Specify the number of rows and columns in the dialog box.

Click "CREATE" to create an array of empty placeholders.

Click on each placeholder to select it, then enter a number, an expression, or a string. Alternatively. use Tab to move through the placeholders.

For arrays in which there exists a formula relating the value of an array element to its indices, it is easier to use range variables and subscripts. The example below illustrates the technique:

i := 0 ..9

j := 0 ..9

X[i,j := i^2+j/2

You can also create an array by:

Reading directly from a datafile.

Importing values from a datafile

Reading from an ASCII datafile

Defining individual elements.

Creating an input table using the Input Table component

Creating an input table using a range variable

Connecting to another application such as Excel or MATLAB


A matrix is a rectangular array of numbers.


A vector is an array or matrix containing one column of numbers.


DISPLAYING VECTOR OR MATRIX RESULTS

There are three ways of displaying a vector or matrix:

If an array has fewer than ten rows or columns, you'll see it displayed as a matrix.

If you type an array name together with subscripts and press = , you’ll see the array displayed in a non-scrolling output table.

If an array has more than nine rows or columns, you'll see a portion of it displayed as a scrolling output table. A scroll bar will appear along the appropriate edge of the table if your results extend beyond the table. You can also resize the table to see all the values or suppress the use of scrolling output tables to display an array.

You can use the Output Table component to display results. The Output Table displays the array in a scrolling table from which you can export the values to an external data file.

When you display a large vector or matrix as an array rather than in a table, Mathcad displays only the first 200 rows or columns. Mathcad uses an ellipsis to indicate that rows and columns are stored internally but not displayed.


Suppressing the use of scrolling output tables

To suppress the use of scrolling output tables:

Click on the scrolling table.

Choose Number from the Format menu to open the Number format dialog box.

Click on the box beside "Display as Matrix."

Click on the "OK" button.

To suppress the use of scrolling output tables for all the large arrays in your worksheet, follow the above steps, but click on the Global button in the Number Format dialog box before clicking the "OK" button.


NON-SCROLLING OUTPUT TABLES

Mathcad displays expressions involving range variables in non-scrolling output tables. For example, if you type subscripts with an array name as opposed to the array name by itself, you will see a non-scrolling output table:

Non-scrolling output tables are limited to displaying 50 values, but all results are stored internally.


For example, even if j ranges from 1 to 100, typing j^2= will show only the values from 1^2 up to 50^2. To see more than 50 values, use several range variables and several tables. You could, for example, define j1 from 1 to 50 and j2 from 51 to 100, and then show tables for j1^2= and j2^2= side by side.


Use subscripts on an array when you want to refer to individual elements in the array. For example, you should use subscripts when plotting an array because you want to plot each individual element.


COMPUTING WITH ARRAYS

You can define a variable as an array and use it in your calculations. To do so:

Click in empty space in your worksheet and type the  variable name.

Choose Matrix from the Insert menu to bring up a dialog box.

Specify the number of rows and columns in the dialog box.

Click "CREATE" and fill in the placeholders.

You can now use the name v in place of the actual vector in any equation:

Arrays are useful for performing parallel calculations.


Defining array elements

To define individual array elements, use subscripts. For example, type v[3:6 to define the fourth element of the vector v.

When you define vector elements, you may leave gaps in the vector. For example, if v is undefined and you  define the third element, the first and second elements are undefined. Mathcad fills the undefined elements with zeros. Be careful of inadvertently creating large arrays by defining elements individually.


Beginning arrays at a different element
BEGINNING ARRAYS AT AN ELEMENT OTHER THAN ZERO

By default, Mathcad arrays begin at element zero. To change this, change the value of the built-in variable ORIGIN by doing either of the following:

Choose Options / Built-In Variables tab from the Math menu.

Enter a global definition for ORIGIN anywhere in your worksheet (be sure to use capital letters).

When you change the ORIGIN to something other than zero, certain elements may not longer exist. For example, if you change the ORIGIN to one, Mathcad no longer maintains an element zero for vectors or a zeroth row and column for matrices. You will see an error if you try to access an element that no longer exists.


LIMITS ON ARRAY SIZES

Limit on input arrays

When you choose Matrix from the Insert menu, you cannot create an array having more than 100 elements. You can, however, create larger arrays by:

Joining smaller ones together.

Reading from a data file.

Using range variables.

Limit on array size

The effective array size limit depends on the memory available on your system. Approximately 8 bytes of memory are needed per array element. For most systems, the array limit will be at least 1 million elements. In no system will it be higher than 8 million elements.


DATA FILE I/O

Reading a file from disk

To read a non-ASCII file, use the File Read/Write component.

To read an ASCII file consisting of rows and columns, use the READPRN function as follows:

A := READPRN (filename)

To read an ASCII file consisting of a simple list of numbers, use the READ function with a range variable as follows:

i := 1 .. N

A[i := READ (filename)

Writing a file to disk

To write to a non-ASCII file, use the File Read/Write component.

To write an ASCII file consisting of rows and columns, use the WRITEPRN function as follows:

WRITEPRN (filename) := A

To write an ASCII file consisting of a simple list of numbers, use the WRITE function with a range variable as follows:

i := 1 .. N

WRITE (filename) := A[i


N

Number of elements in the data vector.


Changing the size of an array
CHANGING THE SIZE OF AN ARRAY:

To join two arrays side by side:

Use the augment function to combine an m x n array with an m x p array to form an m x (n + p) array. For example:

To stack two arrays one above the other:

Use the stack function to combine an m x n array with an p x n array to form an (m + p) x n array. For example:

To insert or delete rows and columns:

Additional details on:

Inserting rows

Deleting rows

Inserting columns

Deleting columns


To insert one or more rows:

Click on an element in the row below which you want to add additional rows.

Choose Matrix from the Insert menu to bring up a dialog box.

Click the "Insert" button.

Specify the number of rows to insert.

You'll see one or more rows of empty placeholders below the row containing the selected element.


To delete one or more rows:

Click on an element in the first row you want to delete.

Choose Matrix from the Insert menu to bring up a dialog box.

Click the "Delete" button.

Specify the number of rows to delete.

This procedure deletes the row containing the selected element together with an appropriate number of rows below it.


To insert one or more columns:

Click on an element in the first column you want to delete.

Choose Matrix from the Insert menu to bring up a dialog box.

Click the "Insert" button.

Specify the number of columns to insert.

You'll see one or more columns of empty placeholders to the right of the column containing the selected element.


To delete one or more columns:

Move the cursor to where the array was defined and click on an element on the right hand side.

Choose Matrix from the Insert menu to bring up a dialog box.

Click the "Delete" button.

Specify the number of columns to delete.

This procedure deletes the column containing the selected element and the appropriate number of columns to the right.


Extracting elements, rows, and columns
EXTRACTING ELEMENTS, ROWS, AND COLUMNS:

To access a particular array element, use the subscript operator and type an equals sign. For example:

To access an entire column at once, use the superscript operator as shown below:

To access an entire row, use the transpose and superscript operator together as shown below:


Matrix Dialog Options


Click this button to insert a matrix of placeholders.  If this button is gray, make sure you have filled in the “Rows:” and “Columns:” boxes with the number of rows and columns you would like your new matrix to have. Also make sure that your cursor is on a placeholder or in a blank spot of your worksheet.


Type the number of rows you would like to create, delete, or insert.


Type the number of columns you would like to create, delete, or insert.


Click this button to insert additional rows or columns in your matrix:

If you insert rows, Mathcad creates rows of empty placeholders below the selected element.

If you insert columns, Mathcad creates columns of empty placeholders to the right of the selected element.


Click this button to eliminate rows or columns from your matrix:

If you delete rows, Mathcad begins with the row occupied by the selected element and deletes rows from that element downward.

If you delete columns, Mathcad begins with the column occupied by the selected element and deletes columns from that element rightward.


SIMULTANEOUS DEFINITIONS

You can use arrays to define several variables at once. To do so:

     Create a vector or matrix.

     Fill in the element placeholders with variable names.

     Type ":" to create a ":=" with a placeholder.

     Create a vector or matrix having the same number of rows and columns as the vector or matrix on the left side.

     Fill in the placeholders with definitions for the variables.

Mathcad evaluates all elements on the right hand side before assigning any of them on the left hand side. Because of this:

     Nothing on the right hand side of an expression can depend on what is on the left hand side.

     You cannot have a variable appear more than once on the left hand side.


NUMERICAL METHODS

Here are descriptions of the numerical methods Mathcad uses for some types of calculations.

Integration

Derivation

Root function

Solving systems of equations

Matrix determinants and inverses

Sorting

Zero factors or numerators

Numerical method accuracy


NUMERICAL METHOD ACCURACY

Since Mathcad is a general-purpose calculation program, it uses numerical methods that work in a wide variety of contexts. However, as with any numerical algorithms, it is always possible to find specific examples for which Mathcad’s methods return inaccurate or misleading results.

You can verify the accuracy of your results and avoid numerical problems by following these principals:

When you use a Mathcad function or operator that involves a numerical approximation, be sure your results are reasonable.

Review the information available for the operator or function in question. In cases where you suspect Mathcad’s methods may fail, restate the problem in a more stable form.

Become familiar with the numerical methods to get a better understanding of the conditions under which they will fail or return inaccurate answers.

Set the built-in variable TOL to achieve the desired accuracy and speed for numerically computed answers.


Checking for reasonable results

For simple calculations, just use common sense. For more complicated calculations, Include redundancy checks in your documents to estimate whether results are approximately correct.


NUMERICAL INTEGRATION METHOD

Mathcad computes definite integrals numerically using a Romberg algorithm. It makes successive estimates of the value of the integral and returns a value when the two most recent estimates differ by less than the value of the built-in variable TOL.

To compute the integral of f(x) from a to b, Mathcad follows these steps:

Calculate an estimate for the integral using the trapezoidal rule.

Fit a polynomial to the sequence of trapezoidal estimates computed so far and the corresponding subinterval widths. Extrapolate this polynomial to width zero to produce a Romberg estimate for the integral.

Compare the two most recent Romberg estimates according to the following test:

If the two most recent estimates agree according to this test, check also whether estimate n-1 and estimate n-2 also agreed. If they did, then return to the most recent Romberg estimate as the value of the integral. If not, double the number of subintervals and return to the first step.

Mathcad sets a limit on the number of times it will iterate this procedure. If the routine reaches this limit without converging, or if the integrand is singular at one or both of the endpoints of the interval of integration, then Mathcad switches to an open-ended Romberg method. If Mathcad reaches it’s set limit performing this routine without returning an answer, the integral is marked with an error indicating that it did not converge.

Notes about the algorithm:

Mathcad can evaluate many integrals for which the integrand is singular at one or both of the endpoints of the interval of integration, but evaluation of these integrals will often be slower than for integrands that are well-behaved.

For small values of TOL, the integration may not converge even though the integral has a finite value.

Mathcad generally will not be able to integrate functions that have sigularities in the interior of the interval of integration. Functions such as step and sawtooth functions that have large numbers of finite discontinuities may also lead to nonconverging integrals. If you know where singularities in the integrand are, you can often obtain a correct numerical evaluation by splitting the integral into a sum of integrals with these points as limits. A plot of the integrand may help to indicate trouble spots.

 	Because Mathcad’s integration method divides the interval into four subintervals and then successively doubles the number of points, it can return incorrect answers for periodic functions having periods 1/(2^n) times the length of the interval. To avoid this problem, divide the interval into two uneven subintervals and integrate over each subinterval separately.


The first trapezoidal estimate is:

The second trapezoidal estimate doubles the number of subintervals, using two subintervals each of width b-a/2. To begin the algorithm, compute the first three estimates, subdividing the interval into one, two, and four subintervals, respectively.


OPEN-ENDED ROMBERG METHOD

In the open-ended method, the preliminary estimates are obtained by using the  midpoints of subintervals, avoiding the necessity to evaluate the function at the endpoints a and b. (See Handheld Calculator Evaluates Integrals, by William Kahan, Ph.D., in Hewlett-Packard Journal, August 1980, for a full description.) The sample points are concentrated near the ends of the interval of integration, where integrands that are singular or that have an infinite derivative are likely to be changing most rapidly. The number of subintervals is tripled at each step.

For its open-ended Romberg method, Mathcad follows these steps:

   Calculate an open-ended estimate for the integral by summing terms computed by mulitplying the function value at the midpoint of a subinterval by the width of that subinterval. Begin with one interval; the estimate is:

The next estimate uses three points, the next nine points, and so on. Begin by making the first three estimates.

   Compare the two most recent Romberg estimates according to the following test:

   If the two most recent estimates agree according to this test, return to the most recent open-ended estimate as the value of the integral. If not, triple the number of subintervals and return to the first step.

Mathcad sets a limit on the number of times it will iterate through the open-ended Romberg method. If the routine reaches this limit without returning an answer, the integral is marked with an error indicating that it did not converge.


The Romberg method

The Romberg method accelerates the convergence of a sequence of simple trapezoidal or midpoint approximations to the integral by extrapolating the sequence of estimates and the corresponding subinterval widths.


The variable name Estimate subscripted with 0,1, and so on represent Mathcad’s internal approximations to the answer. Only the last estimate, the one that passes Mathcad’s tolerance test, is available to the user.


Because Mathcad’s integration method divides the interval into four subintervals and then successively doubles the number of points, it can return incorrect answers for periodic functions having periods 1/(2^n) times the length of the interval. To avoid this problem, divide the interval into two uneven subintervals and integrate over each subinterval separately.


NUMERICAL DERIVATION METHOD

Mathcad’s derivative operator uses a variation on Ridder’s method to compute derivatives of order between 0 and 5 inclusive. It begins with the determination of an intial stepsize hand the constructnion of a triangular array of estimates. This proceeds as follows:

Mathcad computes the first estimate in the table using an n+1-point divided difference approximation.

The remaining estimates in the first row of the table are computed using the divided difference formula but with a decreasing step-size:

The remaining elements in this table of estimates are computed using weighted averages of earlier elements:

The error for a particular estimate of the derivative’s value is given by:

Let errmin be the smallest of the i and j elements of err and let der be the estimate of the deriative’s value corresponding to errmin. Then if:

where E is a small number depending on the order. Mathcad returns der as the value of the derivative. Otherwise, Mathcad marks the derivative with an error message.

Note about the algorithm:

With Ridder’s algorithm, you can expect the first derivative to be accurate within 7 or 8 significant digits, provided that the value at which you evaluate the derivative is not too close to a singularity of the function.


Although Mathcad’s derivative operator won’t compute derivatives of order greater than 5, you can nest derivative operators within each other to compute higher order derivatives.


ROOT FUNCTION ALGORITHM

Mathcad’s root function solves for zeros using the secant method.

To compute root(f(x),x), Mathcad uses x as the intial guess to find the root of f(x) and follows these steps:

If |f(x)| < TOL, then x is already a root, so return x.

Set n=1. If x is not 0, set h=TOL*x, otherwise, set h=TOL. Make the following definitions:

Increase n by one. Then compute the straight line connecting the points

Set x sub n to the point where this straight line crosses the zero axis.

If

Otherwise, go back to step 3.

There is a limit on the number of calculations that Mathcad will perform in search of an answer for the root function. If it exceeds this limit without returning an answer, the root function is marked with an error.

This error can be caused by any of the following:

The expression has no roots.

The roots of the expression are far from the initial guess.

The expression has local maxima or minima between the initial guess and the roots.

The expression has discontinuities between the initial guess and the roots.

The expression has a complex root but the initial guess was real (or vice versa).

To make the root function converge, try plotting the expression to determine whether or not the expression crosses the x-axis and if so, approximately where it does so. Change your guess value accordingly. You can also trying changing the value of TOL.


ZERO FACTORS OR NUMERATORS

For efficiency reasons, Mathcad always assumes that for any expression x:

0*x=0

and

0/x = 0

Presented with a calculation of this type, Mathcad will not even evaluate x. This has the following consequences:

Mathad will instantly compute a result of zero for these expressions, even if x requires a time-consuming calculation like an integral or a summation.

If computing x would result in an error, Mathcad will return zero without detecting the error. In some cases this is desirable; in others it isn’t.

Mathcad evaluates 0/0 as zero, not as an error.


NUMERICAL METHOD USED TO SOLVE SYSTEMS OF EQUATIONS

Mathcad uses the iterative Levenberg-Marquardt method to solve for several constraints simultaneously using find or minerr. Mathcad’s method is taken from the public-domain MINPACK algorithms developed and published by the Argonne National Laboratory in Argonne, Illinois.

The error vector

Steps in the Levenberg-Marquardt method

Termination criteria

Mathcad’s modifications to the Levenberg-Marquardt method


For more information, see the User’s Guide to Minpack I, by Jorge J. More, Burton S. Garbow, and Kenneth E. Hillstrom, Argonne National Laboratory publication ANL-80-74, 1980.


The error vector

The MINPACK algorithm attempts to find the zeros of, or at worst minimize the sum of square of, the value of a vector of functions relative to the values of certain variables. The vector of functions Mathcad uses is an error vector whose elements represent the errors in the constraints. The errors are defined as follows:

For equality constraints (constraints using “=”):

For inequality constraints:

if inequality is true, otherwise:

Mathcad treats the Levenberg-Marquardt algorithm as an algorithm on real variables. When you solve for a complex variable, Mathcad treats the real and imaginary parts as separate variables in the algorithm. When you solve an equality constraint, Mathcad creates two real constraints for the algorithm, one for the real part and one for the imaginary part.


Steps in the Levenberg-Marquardt method

The Levenberg-Marquardt method is a quasi-Newton method (a variation on the gradient method). At each step, Mathcad estimates the first partial derivatives of the errors with respect to the variables to be solved to create a Jacobian matrix. Ordinarily, Mathcad can determine the next estimate to make by computing the Gauss-Newton step s for each variable. In matrix notation, Mathcad solves the matrix equation:

In this equation, J is the Jacobian matrix, s is the step to take, and x is the vector of current estimates for unknown variables. For the first step, x is the vector of guesses; at each subsequent step, the new x is the old x plus s, the vector of steps. Notice that computing this step involves inverting the Jacobian matrix J.

Computing this step is not always possible. Computing this step fails when the Jacobian matrix cannot be inverted or when there are more constraints than variables to be solved. In these cases, Mathcad adds the additional condition that the following quantity be reduced to a minimum:

Here D is a vector of wieght factors computed from the norms of the columns of the Jacobian matrix. In these cases, s is computed to satisfy this minimization criteria as well as solving the Newton equation with the Jacobian .

The Levenberg-Marquardt method does not work when there are fewer constraints than variables. In these cases, Mathcad returns an error.


Termination criteria

The Levenberg-Marquardt method ends when it reaches one of the following termination criteria:

When it is no longer possible to reduce the norm of the error vector significantly.

When s becomes relatively close to zero.

When it reaches one of these termination conditions, Mathcad checks the magnitude of the error vector and returns an answer:

If the magnitude of the error vector is less than or equal to TOL, Mathcad returns the variable values as a solution.

If the solve block ends with the find function and the magnitude of the error vector is greater than TOL, Mathcad marks the find function with an error.

If the solve block ends with the minerr function and the magnitude of the error vector is greater than TOL, Mathcad returns the solution anyway, even though the error vector is not close to zero. Mathcad sets the value of the variable ERR to the magnitude of the error vector.

There is a limit on the number of calculations that Mathcad will perform in search of an answer for a solve block. If it exceeds this limit without returning an answer, the find or minerr is marked with an error.

Mathcad returns an error indicating that no solution was found when the difference between successive approximations to the solution is greater than TOL and  any of the following:

The solver reaches a point where it cannot reduce the error any further. Try defining TOL with a larger value. Also make sure you have provided complex guess values if you are trying to find a complex solution.

The solver reaches a point from which there is no preferred direction. Try different guess values or add an inequality.

The solver reaches the limit of its accuracy. Roundoff errors make it unlikely that further computation would increase accuracy of the solution. This often happens if you set TOL to a value below 10^15.


In this context, “significantly” means by more than the larger of TOL and TOL*|err_vector|. This criterion stops the solver when the errors cannot be reduce further.


In this method, “relatively close” means a norm smaller than the larger of TOL and TOL*|v|. This criterion stops the solver when there is no preferred direction to move the guesses.


Mathcad’s modifications to the Levenberg-Marquardt method

To make the Levenberg-Marquardt method more effective on actual problems, Mathcad includes the following modifications to the basic method:

The first time the solver stops at a point that is not a solution, Mathcad adds a small random amount to all the variables and tries again. This helps avoid getting stuck in local minima and other points from which there is no preferred direction. Mathcad does this only once per solve, the first time the solver stops on a point that is not a solution.

If you include inequality constraints in a solve block, Mathcad solves the subsystem consisting of only the inequalities first before adding in the equality constraints and attempting a full solution. This is equivalent to moving the guesses into an area where the inequalities are all satisfied before starting the solver.


NUMERICAL METHOD FOR COMPUTING A MATRIX INVERSE AND DETERMINANT

To compute the determinant or inverse of a square matrix M, Mathcad decomposes it into a lower-triangular matrix L and an upper triangular  matrix U, such that:

This is called the LU decomposition of the matrix. It makes the solution of a system of equations:

into a matter of simple substitutions with the elements of L, U, and y.

To compute the inverse, Mathcad solves the equations:

where e is a vector with one in element j and a zero in all other elements. The solution vectors v for each j form the columns of the inverse matrix.

The determinant of the original matrix is simple the product of the diagonal elements of U, the upper-triangular matrix in the LU decomposition.


Mathcad performs the LU decomposition using Crout’s method with partial pivioting. See Numerical Recipes in C by William H. Press, Brian P. Flannery, Saul A. Teukolosky and William T. Vetterling (Cambridge University Press, 1986), pp. 31 to 39, for a complete description.


METHOD USED IN SORTING FUNCTIONS

Mathcad’s sorting routine for the sorting functions sort, csort, and rsort uses a heapsort algorithm. See Numerical Recipes in C by William H. Press, Brian P. Flannery, Saul A. Teukolosky and William T. Vetterling (Cambridge University Press, 1986) for a complete description.

The heapsort procedure is not a stable sort. This means that if you sort a matrix on a columns that contains equal elements, the rows containing these elements will be adjacent in the sorted array, but will appear in an arbitrary order.


Creating user DLLs
CREATING YOUR OWN FUNCTIONS

You can extend Mathcad’s power by writing your own customized functions in C or C++ . Customized functions can accept and return complex scalars or complex arrays. Customized functions can also have features such as error messages, interruption, and exception handling.

To create customized functions, you will first need to create source code using the structures and functions provided by MathSoft. Next, you will compile the code and link it to create a DLL.

The follow specific steps are involved in creating a DLL:

Writing an entry point routine.

Registering your function.

Writing your function.

Error handling

Compiling and linking your DLL.

Incorporating your DLL into Mathcad.

Refer to the Appendix in the User’s Guide for additional information on creating DLLs.


Once you’ve completed your DLL, place it into the userefi subdirectory. Mathcad will load the customized function upon startup and the function will show up in the Insert Function dialog box along with Mathcad’s built-in functions.


DLL entry point routine

When you start Mathcad, it attempts to load any DLL’s located in the userefi subdirectory. During this loading process, your DLL must supply information about your library through an entry point routine. A DLL entry point routine is called by the operating system when the DLL is loaded. The information found in the entry point routine should include:

The names of the functions in the library.

The types of arguments the functions take.

The types of values they return.

The text of possible error messages.

Because the way to specify the DLL entry point routine is linker-specfic, refer to the readme.mcd file in the userefi subdirectory for linking instructions.


Error messages

C/C++ functions which return error messages require an error message table in the DLL code. A call to CreateUserErrorMessageTable inside the DLL entry point routine informs Mathcad of the meaning of error codes returned by the C/C++ functions from a DLL.

Mathcad traps the following floating point exceptions:

overflow

divide by zero

invalid operation

In the case of these exceptions, Mathcad will display a floating point error message under the function. Mathcad will also free all the memory inside your function with MathcadArrayAllocate and MathcadAllocate.


Compiling and linking your DLL

To create your DLL you will need a 32-bit compiler such as:

Microsoft visual C++ (32-bit version).

Borland C++ version 4.5 or higher.

Watcom C++32 version 10.0 or higher.

Once you compile the code, you need to link the object files together with the MathSoft-provided mcaduser.lib library to create a DLL.

Detailed instructions on compiling and linking your DLL are provided in readme.mcd located in the userefi subdirectory. For more specific instructions on how to link and compile your source code, refer to the user guide provided with your compiler.


Stucture and functions for user DLLS
STRUCTURE AND FUNCTION DEFINTIONS

MathSoft provides the mcadincl.h include file which contains the prototypes for the following structures and functions:

Structures

COMPLEXSCALAR

COMPLEXARRAY

FUNCTIONINFO

Functions

CreateUserFunctions

CreateUserErrorMessageTable

MathcadAllocate

MathcadFree

MathcadArrayAllocate

MyCFunction

MathcadArrayFree

isUserInterrupted

For detailed information on these structures and functions, refer to the Appendix in the User’s Guide.


COMPLEXSCALAR

This structure is used to pass scalar data between Mathcad and a user DLL. The real part of the scalar is stored in the real member of a COMPLEXSCALAR, and the imaginary in the imag member.


COMPLEXARRAY

This structure is used to pass array data between Mathcad and a user DLL. It contains information about the size of the array and whether any of the elements in the array has an imaginary or a real component.


FUNCTIONINFO

This structure contains the information that Mathcad uses to register a user function. FUNCTIONINFO is an argument of CreateUserFunction. A call to CreateUserFunction inside the DLL entry point routine registers your function in Mathcad.


CreateUserFunction

This function is called when the DLL is attaching to the address space of the current process in order to register the user function with Mathcad. The return value is a non-NULL handle if the registration is successful. Otherwise, it is NULL.


CreateUserErrorMessageTable

This function is called when the DLL is attaching to the address space of the current process in order to register the user error message table with Mathcad. The return value is TRUE if the registration is successful. Otherwise, it is FALSE.


MathcadAllocate

This function allocates a memory block or a given size (in bytes) of memory. Returns a pointer to the storage space. To get a pointer to a type other than char, use a type cast on the return value.


MathcadFree

This function frees memory allocated with MathcadAllocate. The argument address points to the memory previously allocated with MathcadAllocate. A NULL pointer argument is ignored. This function does not return a value.


MathcadArrayAllocate

This function allocates memory for a COMPLEXARRAY of columns and rows.


MyCFunction

This is the actual code which executes the user function. Mathcad arguments and a pointer to a return value are passed to this function. It puts the result of the calculation in the return value.

MyCFunction is a place-holder for the library supplied function name. You can name the function that executes your Mathcad user function anything you would like, but you must register the address of your executable code with Mathcad using the FUNCTIONINFO structure.

Compiler-specific sample code files are located in the userefi subdirectory. The appendix of the User’s Guide includes an analysis of the sample code file multiply.c.


MathcadArrayFree

This function frees memory that was allocated by the MathcadArrayAllocate function. This function does not return a value.


isUserInterrupted

This function checks whether a user has pressed the Esc key to interrupt calcuation. Include this function if you want to be able to interrupt your function like other Mathcad functions. Returns TRUE if the Esc key has been pressed, FALSE otherwise.


Defining string variables and functions
DEFINING A STRING VARIABLE

To define a string variable:

Type the variable name.

Type ":" to create a ":=" with a placeholder.

Press the double quotes key (“). You will see an insertion line between double quotes.

Type any combination of letters, numbers, or other characters. Press Enter when you are finished.


DEFINING A STRING FUNCTION

To define a function involving a string:

Type the function name together with its argument list.

Type ":" to create a ":=" with a placeholder.

Press the double quotes key (“). You will see an insertion line between double quotes.

Type any combination of letters, numbers, or other characters. Press Enter when you are finished.


Strings

A string is a sequence of characters between double quotes. It has no numeric value. A string, while not limited in size, always appears as a single line of text in your worksheet

A number string is a string containing characters which constitute a real, complex, floating point, negative, positive, or exponential number. Spaces in number strings are ignored.

To create a string:

Click on a placeholder in a math expression or click in a blank space in your worksheet, and choose Math Region from the Insert menu.

Press the double quotes key (“). You will see an insertion line between double quotes.

Type any combination of letters, numbers, or other characters.

Examples of strings:

“hello world!”

“5.67e-2”    (a number string)

“-4.3 - 6.7i”     (a number string)


Related Topics:

Vector and matrix addition

Plus with line break for long expressions

Summation


Related Topics:

Vector and matrix addition

Plus with line break for long expressions


Related Topics:

Matrix multiplication

Inner product

Iterated product


Related Topics:

Dividing arrays element by element

Dividing an array by a scalar


Related Topics:

How to insert or delete a minus sign

Negating a matrix


Related Topics:

Raising matrices to a power

Inverse of a matrix

nth root of a number


Related Topics:

Complex conjugate of matrix elements


Related Topics:

nth root

Exponentiation

Square root of matrix elements


Related Topics:

Square root

Exponentiation

nth root of matrix elements

Multivalued functions and operators


Related Topics:

Summation without defining range variables


Related Topics:

Summation with range variables


Related Topics:

Iterated products without defining range variables


Related Topics:

Iterated products with range variables


Related Topics:

Magnitude of vectors

Determinant of a matrix


IMPORTING DATA

You can bring data into Mathcad by importing it from a data file, by reading it from a data file, by typing it in, or by pasting it in from the clipboard. To do so, you will usually use a component.

Importing data from a data file

Reading data from a data file

Typing data into a worksheet

Pasting in data from the clipboard


IMPORTING DATA FROM A DATA FILE

When you want to import data once from a data file into Mathcad, you can use the Input Table component. The Input Table component allows you to import data from an external data file and assign it to a Mathcad variable. To import data from an external data file:

Click in a blank spot of your worksheet and choose Component from the Insert menu.

Select Input Table from the list and click “Next.” The Input Table component is inserted into your worksheet.

In the placeholder that appears to the left, enter the name of the Mathcad variable to which this data will be assigned.

Click with the right mouse button on the component so that you see the context menu for the component.

Choose Import.

The Read from File dialog box appears. In the “Files of type” text box, choose the type of file you’d like to import. Use the dialog box to browse to the data file and click “Open.”

Data from the data file will appear in your worksheet in a table and will be assigned to the variable name you provided. You can now manipulate this Mathcad array however you’d like using Mathcad’s built-in functions and operators.


Data files

You can read data from and write data to the following types of data files:

Formatted Text (*.prn)

Tab Delimited Text (*.dat, *.txt)

Comma Separated Values (*.csv)

MATLAB MAT Files (*.mat)

Excel Files (*.xls)

Lotus 1-2-3 Files (*.wks, *.wk1, *.wk*)

Quattro Pro Files (*.wq?, *.wb?)

dbase III Files (*.dbf)

S-Plus Files


RESIZING A COMPONENT

To make a component larger or smaller:

Double-click on the component to activate it.

Move the cursor to one of the handles so that the cursor changes to a double-headed arrow.

Press and hold down the mouse button.

Drag the cursor in the direction you want the component’s dimensions to change.


READING DATA FROM A DATA FILE

When you want to read data from a data file into Mathcad, you can use the File Read/Write component. The File Read/Write component allows you to establish a connection to a data file, read data from it, and assign the data to a Mathcad variable. The data updates automatically in Mathcad whenever it changes in the data file.

To read data from a data file using the File Read/Write component:

Click in a blank spot of your worksheet.

Choose Component from the Insert menu.

Choose File Read/Write from the list and click “Next.” This launches the first part of the File Read/Write Setup Wizard.

Choose “Read from data source” and press “Next” to go to the second page of the Wizard.

From the File Format drop-down list in this Wizard, choose the type of file you want to read.

Type the path to the data file you want to read or use the “Browse” button to locate it.

Press “Finish.” You’ll see the File Read/Write component icon and the path to the data file.

In the placeholder that appears to the left, enter the name of the Mathcad variable to which the data from the file will be assigned.

When you click outside the component, the data file is read in and the data is assigned to the Mathcad variable you entered into the placeholder. You can now manipulate the Mathcad variable however you’d like using Mathcad’s built-in functions and operators. Each time you calculate the worksheet, Mathcad will re-read the data from the file you specified.


READING CERTAIN VALUES FROM A DATA FILE

By default, when you read data from a data file using the File Read/Write component, Mathcad reads in the entire data file. To read only certain rows or columns:

Insert the File Read/Write component so that it reads from a data file.

Click once on the File Read/Write component to select it.

Choose Properties from the context menu to bring up the Properties dialog box:

Use this dialog box to specify the row and columns at which to start and stop reading.


Reading from a different file
READING FROM OR WRITING TO A DIFFERENT FILE

When you insert the File Read/Write component, you specify the file to read from or write to. If later you want to read from or write to a different data file or a different type of data file:

Click with the right mouse button on the component and select Choose File from the component’s context menu. This brings up either the Read from File dialog box or the Write to File dialog box.

In the “Files of type” text box, choose the type of file you’d like to read from or write to, and use the dialog box to browse to the data file, select the data file and click “Open.”


TYPING DATA INTO A WORKSHEET

You can enter data directly into Mathcad and assign it to a Mathcad variable by using the Input Table component:

Click in a blank spot in your worksheet and choose Component from the Insert menu.

Select Input Table from the list and click “Next.” The Input Table component is inserted into your worksheet.

In the placeholder that appears, enter the name of the Mathcad variable to which this data will be assigned.

Double-click on the component and enter data into the cells. Each row must have the same number of data values. If you do not enter a number into a cell, Mathcad inserts 0 into the cell.

When you create an input table, you’re actually assigning elements to an array that has the name of the variable you entered into the placeholder. Once you’ve created an array using an input table, you can manipulate the array using Mathcad’s built-in functions and operators.


PASTING DATA FROM THE CLIPBOARD

In some cases, you may have data stored in a spreadsheet or another application, but you don’t want to import or read the data as a file into Mathcad. An alternative to importing a file is to copy the data to the clipboard and paste it into Mathcad. To do so:

Select the data in the other application and copy it to the clipboard. In most applications, you do this by choosing Copy from the Edit menu.

Open the Mathcad worksheet in which you want the data to be used.

In your Mathcad worksheet, type a variable definition such as m:=

Click in the placeholder to the right of the := and choose Paste from the Edit menu. A matrix containing the data you copied will appear.

When you click outside the component, the data you copied will appear in a scrolling table and are assigned as an array to the Mathcad variable you specified. You can manipulate the array however you’d like using Mathcad’s built-in functions and operators.

Note that if you paste the copied data into a blank spot of a Mathcad worksheet instead of into a placeholder, you’ll also see a matrix containing the data you selected. Or, if the data you copied to the clipboard is from Excel, the Excel component will be inserted into your worksheet

When you double-click on the table, you can edit the values in it.


EXPORTING DATA

Once you’ve used Mathcad to perform calculations, you can export or write the results to a data file, or you can place the results on the clipboard for pasting into another application. The File Read/Write component and the Output Table component allow you to do this.

Exporting data to a data file

Writing data to a data file

Placing data on the clipoboard


EXPORTING DATA TO A DATA FILE

To export data to a data file, use the Output Table component:

Click in a blank spot in your worksheet.

Choose Component from the Insert menu.

Select Output Table from the list and click “Next.” The Output Table component will be inserted into your worksheet.

In the placeholder that appears at the bottom, enter the name of the Mathcad variable containing the data to be exported.

Click on the component with the right mouse button so that you see the context menu for the component.

Choose Export. You will see the Write to File dialog box.

In the “Files of type” text box, select the format of the file you’d like to create. Use the dialog box to browse to the folder in which the data file will be created and enter the name of the data file you wish to create. Then click “Open.”

The data will be exported to the file you specified. Keep in mind that if the data changes and you want it to update in the data file, you need to export the data again. For making a live connection between Mathcad and a data file, use the File Read/Write component instead.


CONTROLLING THE DISPLAY OF THE VALUES IN AN INPUT OR OUTPUT TABLE

When you use the Input Table component to import data or the Output Table component to display or export data., the numbers are displayed in a default format. Unlike most other values displayed in Mathcad, this format not controlled through the Number Format dialog box. To change the way the numbers are displayed in the Input Table component or the Output Table component:

Click once on the component to select it.

Choose Properties from the context menu.

Go to the Display tab and set the options however you’d like.


Click this box to display the row and column numbers associated with the values in the table.


COPYING DATA TO THE CLIPBOARD

If you want to send results from Mathcad to another application, but you don’t want to export them to a file, you can copy the data to the clipboard and paste it into the other application. To do so:

Click in a blank spot in your worksheet.

Choose Component from the Insert menu.

Select Output Table from the list and click “Next.” The Output Table component will be inserted into your worksheet.

In the placeholder that appears at the bottom, enter the name of the Mathcad variable containing the data to be copied and pasted.

Click on the component with the right mouse button so that you see the context menu for the component.

Choose Copy Data.

Open the other application and paste from the clipboard. (This is usually accomplished by choosing Paste from the Edit menu.)


WRITING DATA TO A DATA FILE

To write values from Mathcad to a data file you can use the File Read/Write component. To do so:

Click in a blank spot in your worksheet.

Choose Component from the Insert menu.

Select File Read/Write from the list and click “Next.” This launches the first part of the File Read/Write Setup Wizard.

Choose “Write to a data source” and press “Next” to go to the second page of the Wizard:

From the File Format drop-down list in this Wizard, choose the type of data file you want to write.

Type the path to the data file you want to write or click the “Browse” button to locate it.

Press “Finish.” You’ll see the File Read/Write component icon and the path to the data file:

In the placeholder that appears at the bottom of the component, enter the name of the Mathcad variable containing the data which will be written to the data file.

When you click outside the component, the values in the Mathcad variable will be written to the filename you specified. Each time you calculate the worksheet, the data file is rewritten.


ACCESSING THE APPLICATION ASSOCIATED WITH A COMPONENT

After inserting an application component into a Mathcad worksheet, you can use the component to perform calculations in the application associated with it. To do so:

Double-click on the component in the Mathcad worksheet. The component opens and it either activates in-place or in a separate editing window.

Edit the component however you’d like.

Click back in the Mathcad worksheet to have the component recalculate and to resume working in Mathcad.

When you click outside the component, input variables are sent to the component and arrays are assigned to output variables in Mathcad. Once the output variables are created in Mathcad, you can manipulate them however you’d like using Mathcad’s built-in functions and operators for arrays.


AXUM COMPONENT

Axum is a technical graphing and data analysis application available from MathSoft. Axum gives you access to over 50 2D and 3D graph types. If you have Axum 5 installed on your system, the Axum component gives you the power to create these publication-quality graphs from your Mathcad data without leaving the Mathcad environment.

Using the Axum component you can:

Create different types of 2D and 3D graphs using Mathcad data.

Use Axum to format every detail of your graph.

To insert an Axum graph into a Mathcad worksheet:

Make sure Axum 5 is installed on your system, but not necessarily running.

Create the arrays which will provide input to the Axum component and which Axum will display in a graph. For information on the number and type of arrays required for each type of graph, choose Mathcad-Axum Link from Axum’s Help menu and go to the section titled “Mathcad data specifications for creating Axum graphs.”

Click in a blank spot in your worksheet. Make sure you click below or to the right of the arrays.

Choose Component from the Insert menu.

Select Axum from the list and click “Next.” This launches the first part of the Axum Setup Wizard.

Choose the type of graph you would like to insert and click “Next” to go to the next page of the Wizard.

Choose a plot type. The available choices depend on the type of graph you selected.

Click “Finish.” The Axum component will be inserted into your worksheet.

Enter the appropriate array input variables in the placeholders that appear.

When you click outside the component, the array data will be displayed in the Axum plot type you selected in the Wizard. Each time you calculate the worksheet, the data is redisplayed in Axum.


Some graph types available through the Axum component

2D graphs

Scatter

Line

Spline

Lowess

Weighted least squares

Bar

Error bar

Curve fit natural log

Curve fit expoential

Area

Histogram

Comment

3d graphs

Scatter

Line

Regression

Thin Surface

Spline

Other

Pie

Smith


INTRODUCTION TO COMPONENTS

Components allow data to flow dynamically between the Mathcad worksheet and a data source or application. The data going into a component from Mathcad is called input. The data coming out of a component is called output. The input and output are passed between a Mathcad worksheet and a component by way of a Mathcad input variable and a Mathcad output variable.

The basic steps to using a component in order to exchange data with Mathcad are as follows:

Insert the component and specify the input variable(s) and output variable(s) in the placeholders that appear.

Configure the component so that it knows what to do with input and what to send as output.

Since some components only take input or only send output, these steps will differ slightly for each component. The ideas presented in the steps, however, should improve your understanding of how components work.

Once you’ve inserted a component into a Mathcad worksheet, filled in the appropriate placeholders, and configured the properties, click away from the component region. At that point, the data exchange takes place. This will happen whenever you click on the component and press [F9], when the input variables change, or when you choose Calculate Worksheet from the Math menu.


CONFIGURING A COMPONENT

Once you’ve inserted a component into a worksheet, you usually need to set up the component’s properties so that the component knows how to handle any inputs it’s getting from Mathcad and what to send as output. To configure the properties for a component:

Click on the component once to select it.

Click on it with the right mouse button to see a context menu. The options on the context menu depend on the component you selected, but usually you’ll see the commands Cut, Copy, and Properties.

Choose Properties from the context menu.

The settings in the Properties dialog box depend on the component you clicked on. The properties dialog for the Output Table component, for example, lets you specify the display format for the numbers in the table.


Data exchange

Data passes from the Mathcad input variable into the component, and the output variable will become defined with the output.


DISPLAYING AN ARRAY USING THE OUTPUT TABLE COMPONENT

To display an array using the Output Table component:

Click in a blank spot in your worksheet.

Choose Component from the Insert menu.

Select Output Table from the list and click “Next.” The Output Table component will be inserted into your worksheet.

In the placeholder that appears at the bottom, enter the name of the Array.

The data will be exported to the file you specified.


Related Topics:

Resizing the Input Table

Controlling the display of the values in an Input Table

Other ways to import data

Functions for reading ASCII data


Related Topics:

Reading data from a data file

Reading certain rows and columns of a data file

Reading from a different file

Other ways to import data

Functions for reading ASCII data


Related Topics:

Resizing the Input Table

Controlling the display of the values in an Input Table

Other ways to import data


Related Topics:

Other ways to import data


Related Topics:

Exporting data

Importing data

Functions for writing to ASCII data files


Related Topics:

Controlling the display of the values in an Output Table

Resizing the Output Table

Other ways to export data

Functions for writing to ASCII data files


Related Topics:

Controlling the display of the values in an Output Table

Resizing the Output Table

Other ways to export data

Functions for writing to ASCII data files


Related Topics:

Writing from a different file

Other ways to export data

Functions for writing to ASCII data files


Related Topics:

Resizing the Output Table


Related Topics:

Resizing the Axum component

Using Axum to format the graph

Creating 2D graphs

Creating surface plots

Creating 3d bar charts

Creating contour plots


Related Topics:

Resizing the Output Table

Controlling the display of the values in an Output Table

Copying data from the Output Table

Introduction to components

Exporting data

Other ways to display arrays


Error messages in numerical calculations
ERROR MESSAGES IN NUMERICAL CALCULATION

When Mathcad encounters an error in an expression, it marks the offending expression with an error message and highlights the offending name or operator in a different color (usually red).

Mathcad cannot process an expression containing an error. In order for an expression to process, you must fix the error.

For information on a particular error message, click on it in the list below:

A “Find” or “Minerr” must be preceded by a matching “Given”.

All evaluations resulted in either an error or a complex result.

Arguments in function definitions must be names.

Can only evaluate an nth order derivative when n=0,1..5.

Can only use positive values when log axes are used.

Can’t converge to a solution. The integrand may have a singularity or the integral may not be finite.

Can’t define the same variable more than once in the same expression.

Can’t determine what units the result of this operation should have.

Can’t evaluate this function when its argument is zero.

Can’t find a solution to this system of equations. Try a different guess value or check that a solution really exists.

Can’t find the data file you’re trying to use.

Can’t have anything with units or dimensions here.

Can’t perform this operation on the entire array at once. Try using “vectorize” to perform it element by element.

Can’t plot this many points.

Can’t put a “:=” inside a solve block. Use the “=” button on the “Inequalities” palette instead.

Can’t raise an expression having units to a complex power.

Can’t solve a system having more than fifty equations.

Can’t understand something in this data file. If this file came from a spreadsheet, make sure you saved it as ASCII text only.

Can’t understand the name of this function. If you’re trying to multiply, use ”*”.

Can’t understand the way this range variable is defined.

Can’t understand this number.

Can’t use a range variable in a solve block.

Cannot evaluate this accurately at one or more of the values you specified.

Cross product is defined only for vectors having more than one row or column.

Definition stack overflow

Degree of the polynomial must be between 1 and 99.

Dimensions must be >4.

End of file

End points cannot be the same.

Equation too large

Floating point error

Found a number with a magnitude greater than 10^307 while tryinig to evaluate this expression.

Found a singularity while evaluating this expression. You may be dividing by zero.

Illegal constraint

Illegal context. Press F1 for Help.

Illegal dimensions

Input must be 1 or 2 dimensional.

Integer too large.

Integer too small.

Invalid expansion point

Invalid format

Invalid matrix dimension.

List too long

Live symbolics not availables

Loess cannot extrapolate.

Must be <-10000

Must be >= 10^-16

Must be 1 complex matrix or 2 real matrices.

Must be 1 multidimensional array.

Must be a string.

Must be between two lock regions.

Must be function.

Must be increasing.

Must be integer >= 1.

Must be less than the number of data points.

Must be odd integer

Must be positive

Must be real

Must be real scalar

Must be real vector

Must be square

Must have fewer than five factors.

Must have more data points than parameters.

Must have more than three observations.

Must have 3 vectors or one matrix.

Needs more data points than parameters.

No bitmaps were found in the worksheet.

No solution found.

Non-positive definite

Not enough memory for this operation.

Nothing to unlock.

Number of rows must be a power of 2.

Root finder failed

(Rows - 1) must be power of 2.

Singular matrix

Something is wrong with the solve block used to define the function. It may need a guess value.

Stack overflow

Symbolic operator only.

The expression to the left of the equal sign cannot be defined.

The matrix dimensions are incompatible.

The number of rows and/or columns in these arrays do not match.

The unit placeholder can only have real, non-zero scalars put into it.

The units in this expression do not match.

There is an extra comma in this expression.

This array must have more than one row or column.

This expression has a “(“ without a matching “)”.

This expression is incomplete. You must fill in the placholders.

This function has too many arguments.

This function is undefined at one or more of the points you specified.

This function needs more arguments.

This matrix must be square. It should have the same number of rows as columns.

This must be an integer. The expression you used appears to have a fractional part.

This must be the name of a function or variable.

This operation can only be performed on a function.

This operation can only be performed on an array. It can’t be performed on a number.

This operation can only be performed on a number or an array.

This operation can only be performed on a string.

This subscript is too large.

This system of equations has more unknowns than there are equations.

This value must be a vector. It can be neither a matrix nor a scalar.

This value must be real. Its imaginary part must be zero.

This variable must be a range variable.

This variable or function is not defined above.

This vector has the  wrong number of elements.

This vector should have more elements.

Too many iterations.

Too many integrator steps.

Type “ORIGIN=” to see what it’s set to…it should b an integer whose magnitude is less than 16 million. Redefine it if necessary.

Type “TOL=” to see what the tolerance is set to…it should be greater than 0 and less than or equal to 1. Redefine it if necessary.

Underflow

Unequal array dimensions

Value of subscript or superscript is too big (or too small) for this array.

Vector elements cannot all be the same.

You are trying to use an array or range as a scalar. Press F1 for help.

You have one solve block inside another. Every “Given” must have a matching “Find” or “Minerr”.

You interrupted calculation. To resume, click here and choose “Calculate” from the “Math” menu.


Must be between two lock regions.

In order to use the Lock Regions / Lock Area command from the Format menu, you must click in an area of the worksheet that is in a locked area.


This operation can only be performed on a string.

The function or operator you are using requires a string argument. For example, string functions usually require at least one string argument.


Nothing to unlock.

In order to use the Lock Regions / Unlock Area command from the Format menu, you must click in an area of the worksheet that is in a locked area.


EXCHANGING DATA WITH OTHER APPLICATIONS

Although you can import and export data from and to a data file, you can also exchange data directly with an application. Mathcad provides components which make connections between Mathcad and other applications. This allows you to:

Send values from Mathcad to the application.

Use the application to manipulate the data dynamically without actually leaving the Mathcad environment.

Send values from the application back to Mathcad.

When you insert an application component into your Mathcad worksheet, you’ll actually see a small window on that application’s environment embedded in your Mathcad worksheet. When you double-click on the component, Mathcad’s menus and toolbars change to those of the other application. This gives you access to the application without leaving the Mathcad environment.

Components are available for connecting to the following applications:

Excel

MATLAB

Axum

Scriptable Object


EXCEL COMPONENT

Although you can import and export Excel data files using the File Read/Write and other components, you can use the Excel component to exchange data between Mathcad and Excel and use Excel’s functionality. For example, you may have some values in Mathcad that you want to send to Excel, use Excel for some manipulation, and send values back to Mathcad to continue working.

The Excel component lets you:

Pass data from Mathcad into an Excel file.

Double-click on the Excel component to use functionality from Excel.

Send values from an Excel file into Mathcad.

To insert an Excel component into a Mathcad worksheet:

Make sure Microsoft Excel 7.0 or higher is installed on your system, but not necessarily running.

Click in a blank spot in your worksheet. If you want to send values to the component from a Mathcad variable defined in your worksheet, make sure you click below or to the right of the variable definition.

Choose Component from the Insert menu.

Select Excel from the list and click “Next.” This launches the first part of the Excel Setup Wizard. Fill in the dialog box options and click on the “Next” button. The Wizard will bring you through other dialog boxes whose options you should fill in.

When you finish using the Wizard, you’ll see the Excel component in your worksheet with placeholders for the input variables and output variables. Enter the input variables in the bottom placeholders. Enter the output variables into the placeholders to the left of the :=.

When you click outside the component, input variables are sent to Excel from Mathcad and a range of cells are sent from Excel back to Mathcad and assigned to output variables. Once the output variables are defined, you can manipulate them however you’d like using Mathcad’s built-in functions and operators.


First page of the Excel wizard

Use this page of the Wizard to specify:

If you want to connect a file you’ve already created, choose “Create from file,” and type the path name in the text box or use the Browse button to locate the file; then click “Open.” If you don’t want to connect to a previously created file, choose “Create an empty Excel Worksheet.”

Click the Display as Icon box if you want to see an icon in your Mathcad worksheet rather than a portion of the Excel file.


Other pages of the Excel wizard allow you to specify:

The number of input and output variables. You can supply between 0 and 4 input variables and between 0 and 4 output variables.

Input ranges: the cells in which the values of each Mathcad input variable will be stored. Enter the starting cell, which is the cell that will hold the element in the upper left corner of an array of values. For example, for an input variable containing a  matrix of values, you can specify A1 as the starting cell, and the values will be placed in the cells A1 through C3.

Output ranges: the cells whose values will define the Mathcad output variables. For example, enter C2:L11 to extract the values in cells C2 through L11 and create a  matrix.


ADDING OR REMOVING INPUT AND OUTPUT VARIABLES

Once you insert an application component, you may find that you want to add or remove input variables or output variables. To do so:

Click once on the component to select it.

To add another output, choose Add Output Variable from the context menu. Another placeholder will appear to the left of the := .

To add another input, choose Add Input Variable from the context menu. Another placeholder will appear at the bottom of the component.

To eliminate an output, choose Remove Output Variable from the context menu.An output placeholder or variable to the left of the := will disappear. If there was more than one output, the last output placeholder or variable will disappear.

To eliminate an input, choose Remove Input Variable from the context menu. An input variable or placeholder at the bottom of the component will disappear. If there was more than one input, the placeholder furthest to the right will disappear.

When you add input or output variables to the Excel component, you’ll need to specify which cells in the component will store the new input and which will provide the new output. To do so:

Click once on the component to select it.

Choose Properties from the context menu.

Choose either the Inputs tab or the Outputs tab and specify a range of cells for each input and each output.


MATLAB COMPONENT

Although you can import and export MATLAB data files using the File Read/Write and other components, you can use the MATLAB component to exchange data between Mathcad and MATLAB and use MATLAB’s functionality. For example, you may have some values in Mathcad that you want to send to MATLAB, use MATLAB to manipulate them, and send values back to MATLAB.

A MATLAB component lets you:

Pass values stored in variables in Mathcad into MATLAB variables.

Double-click on the MATLAB component to use MATLAB to process the data.

Send data from MATLAB variables into Mathcad variables.

To insert a MATLAB component into a Mathcad worksheet:

Make sure MATLAB Professional version 4.2c or higher or MATLAB Student version 5.0 or higher is installed on your system, but not necessarily running.

Click in a blank spot in your worksheet. If you want to send values to the component from a Mathcad variable defined in your worksheet, make sure you click below or to the right of the variable definition.

Choose Component from the Insert menu.

Select MATLAB from the list and click “Next.” The MATLAB component will be inserted into your worksheet.

In the placeholder that appears at the bottom, enter the name of the Mathcad input variables to pass into the MATLAB component. In the placeholder that appears to the left of the component, enter the names of the Mathcad output variables to be defined.

By default, the Mathcad input variables will be sent into MATLAB variables named in0, in1, in2, and so on. The MATLAB variables out0, out1, out2, and so on will define the output variables to be created in Mathcad. To change these names:

Choose Properties from the component’s context menu.

Use the Outputs and Inputs tabs to type in new names for the inputs and outputs.


SCRIPTABLE OBJECT COMPONENT

You can exchange data between a Mathcad worksheet and any other application that supports OLE Automation, even if Mathcad does not have a specific component to do so. You can use the Scriptable Object component to create a custom component that:

Sends values from Mathcad to the application.

Uses the application to manipulate the data without actually leaving Mathcad.

Sends values from the other application back to Mathcad.

You can create a custom scriptable object from any object you can insert into a Mathcad worksheet. For example, you may want to send some values from Mathcad to Lotus 1-2-3, manipulate the values there, and send results back to the Mathcad worksheet.

To create a Scriptable Object component, you must:

Be proficient in a supported scripting language that is installed on your system.

Have some knowledge of the way the other application has implemented OLE.

Have the other application available on your system.

To insert a Scriptable Object component into a Mathcad worksheet:

Click in a blank spot in your worksheet. If you want to send values to the object from a Mathcad variable, make sure you click below or to the right of the variable definition.

Choose Component from the Insert menu.

Select Scriptable Object from the list and click “Next.” This launches the Scriptable Object Setup Wizard.

The Object to Script scrolling list shows the available applications on your system.

Specify whether the component will be a new file or whether you will insert a file that already exists, and whether you will see the actual file in your Mathcad worksheet or if you’ll see an icon. Click on the “Next” button.”

Specify which scripting language you will use, the type of object you want to script, the name of the object, and the number of inputs and outputs the object will accept and provide.

When you finish using the Wizard, you’ll see a scriptable component in your worksheet with placeholders for the input and output variables. Enter the input variables in the bottom placeholders. Enter the output variables into the placeholders to the left of the :=.

The final step is the script the component. Then you’ll have a scripted object in your worksheet.

For more information on the Scriptable Object component, refer to the MathConnex on-line Help.


SCRIPTING AN OBJECT

To script an object:

Insert the Scriptable Object component.

Click once on the component to select it.

Choose Edit Script from the context menu. This brings up the Script Editor.

Choose Close & Return from the Script Editor’s File menu when you have completed your script and want to resume working in the Mathcad worksheet.

Note: To control the name of the scripted object, click on the Scriptable Object component with the right mouse button and choose Properties from the context menu.

The Scripted Object will appear in your worksheet.


This scripted object accepts two input values and sends out two output values. The input values determine whether the face smiles or winks. The Script Editor window shows a portion of the VBScript code used to configure the object.


Script Editor

The Script Editor shows the basic outline of a script and three subroutines for you to insert scripting code. The arguments Inputs and Outputs to the “Exec” subroutine correspond to the arrays of input and output data the object works with; you use notation like Inputs(0) and Outputs(1) in the body of the subroutine to refer to the first input and the second output. The commands in each section are executed in sequence whenever the Mathcad worksheet is calculated.


SUPPORTED SCRIPTING LANGUAGES

The latest versions of Microsoft VBScript (Visual Basic Scripting Edition) or JScript (JavaScript) are examples of supported scripting languages. For more information on these scripting languages and to download the latest versions of them, refer to Microsoft, Inc.’s Web sites:

http://www.microsoft.com/vbscript

http://www.microsoft.com/jscript


JScript is a fast, portable, lightweight interpreter for use in applications that use ActiveX Controls, OLE automation servers, and Java applets. JScript is directly comparable to VBScript (not Java). Like VBScript, JScript is a pure interpreter that processes source code rather than producing stand-alone applets.


VBScript is a strict subset of the Visual Basic for Applications language used in Microsoft Excel, Project, Access, and the Visual Basic 4.0 development system. VBScript is designed to be a small and lightweight interpreted language, so it does not use strict types (only Variants). Also, because VBScript is intended to be a safe subset of the language, it does not include file input/output or direct access to the underlying operating system.


OVERVIEW OF DATA MANAGEMENT

Mathcad provides components to exchange data between Mathcad and other applications. A component communicates with the mathematical equations in Mathcad, linking your Mathcad computations to the rest of your computing environment.

This link allows data to flow dynamically between the Mathcad worksheet and a data source or application. The data going into a component from Mathcad is called input. The data coming out of a component is called output. The input and output are passed between a Mathcad worksheet and a component by way of a Mathcad input variable and a Mathcad output variable.

Some components are used to import data, some to export data, and application components, such as Excel, Axum, and MATLAB, allow you to communicate with other applications installed on your computer.

Although the components available in Mathcad are limited, there are additional components available in MathConnex.

Introduction to components

Importing data

Exporting data

Exchanging data with other application

Using MathConnex


INSERTING A COMPONENT

To insert a component into a Mathcad worksheet:

Click in a blank spot of your Mathcad worksheet where you would like the component.

Choose Component from the Insert menu.

Choose one of the components from the list and click “Next.”

Depending on the component you choose, you will immediately see the component, with some default properties, inserted into your worksheet or you will see a Wizard dialog box to help you set up the component.

Each component has its own look, so you will see something different for each component you choose. All components have one or more placeholders either to the right of the := or at the bottom of the component. For example, the Excel component might look like this when inserted into your worksheet:

The placeholders you see to the left of the := are for the output variables which will contain the data passed from the component. The placeholder at the bottom of the component is for the name of an input variable the component is getting from Mathcad. The number of placeholders you see to the left or the bottom depend either on the default properties for the component or on the settings you provided in the component’s Wizard.


MATHCONNEX

The components available in Mathcad are used to connect a Mathcad worksheet to other data sources and applications. If you want to connect these data sources and applications to each other as well as to Mathcad, you can use the MathConnex application if you have Mathcad Professional.

In addition to the components available in Mathcad Professional, MathConnex contains a number of other components for manipulating data, such as a Mathcad component for connecting to a Mathcad worksheet. The MathConnex environment lets you connect any of one of the available components to any other component. You can visually design systems of data flow to analyze projects which involve a variety of applications and data sources.

To run MathConnex, click on the MathConnex icon [image] from the Mathcad Toolbar, or exit Mathcad and run MathConnex as you would any application.


Related Topics:

Excel component

MATLAB component

Axum component

Scriptable Object component


Related Topics:

Resizing the MATLAB component

Adding or removing input and output variables

Accessing the MATLAB component

Exporting data

Importing data


Related Topics:

Excel component

MATLAB component

Scriptable Object component


Related Topics:

Inserting a component

Configuring a component

Accessing a component

Resizing a component

Adding or removing input and output variables

Components:

Axum

Excel

File Read/Write

Input Table (used for importing data, typing it in, or pasting it in)

Output Table (used for displaying data, exporting it, or copying it to the clipboard)

MATLAB

Scriptable Object


Related Topics:

Resizing the object

Adding or removing input and output variables

Scripting the object


Related Topics:

Excel component

Resizing the Excel component

Accessing the Excel component

Adding or removing input and output variables

Exporting data

Importing data


Component

A specialized OLE object that you insert into a Mathcad worksheet to create a link between the worksheet and either a data source or another application containing data.

To insert a component, choose Component from the Insert menu. The following components are available:

Axum, for creating Axum graphs in a Mathcad worksheet. You must have Axum installed to insert this component.

File Read/Write, for importing and exporting data files in a variety of formats.

Excel, for creating a link between a Mathcad worksheet and an Excel file.

Input Table, for typing in data, importing data from a data file, or pasting data in from the clipboard.

MATLAB, for creating a link between a Mathcad worksheet and a MATLAB file.

Output Table, for displaying data in a table and exporting it to a data file.

Scriptable Object, for creating a custom component via a scripting language.


Wizards

When you insert any of the following components, you’ll see a Setup Wizard:

MATLAB component

Excel component

File Read/Write component

Scriptable Object component

The Setup Wizard lets you specify some properties of the component before it is inserted.

Press the “Next” button to continue through the Wizard.

Press the “Back” button to go back to a previous page.

Click the “Finish” button to insert the component into your worksheet.


WORKING WITH STRINGS

Although you will usually be defining variables and functions in terms of numbers and other variables or functions, you may wish to define them in terms of a string of characters. Using the double quotes key to type a string, you can define variables, functions, and arrays in terms of a string.

Most built-in functions and operators do not make sense when used with strings. There are, however, several string functions for combining strings, finding substrings, determining the length of a string, and converting strings to numbers and vectors and vice versa.

Defining a string variable

Defining a string function

Defining an array element as a string

Built-in string functions


BUILT-IN STRING FUNCTIONS

The following functions are reserved for use with strings:

concat(S1,S2)

Concatenates string S2 to the end of S1. Returns a string.

error(S)

Returns the string S as an error message.

strlen(S)

Determines the number of characters in the string S. Returns an integer.

substr(S,n,m)

Extracts a substring of S starting with the character in position n and having at most m  characters. The arguments m and n must be integers.

search(S,SubS,x)

Finds the starting position of the substring SubS in S, beginning from position x in S.

str2num(S)

Converts a string of numbers S into a constant.

num2str(x)

Converts the number x into a string.

str2vec(S)

Converts a string S to a vector of ASCII codes.

vec2str(v)

Converts a vector of ASCII codes to a string.


String concatenation function
CONCATENATING TWO STRINGS

concat(S1,S2)	Returns a string formed by attaching string S2 to the end of string S1.

Arguments:

S1 and S2 are strings.

Example:


Length of a string
FINDING THE LENGTH OF A STRING

strlen(S)	Returns the number of characters in S.

Arguments:

S is a string or an expression that returns a string.

Example:


CONVERTING A STRING TO A NUMBER

str2num(S)	Returns a constant equal to the number in S.

Arguments:

S is a number string or an expression that returns a number string.

This function is useful when you need to perform calculations on a string of numbers.

Example:


CONVERTING A NUMBER TO A STRING

num2str(x)	Returns the number string equivalent of x.

Arguments:

x is a constant or an expression that returns a constant.

This function is useful when it is easier to manipulate a number as a string than rather than mathematically.

Example:


Finding a substring
EXTRACTING A SUBSTRING

substr(S,m,n)	Returns the substring of S consisting of the characters from position n and having m characters.

Arguments:

S is a string.

m is the position of the first character in the desired substring. m must be a nonnegative integer.

n is the maximum possible length of the substring. n must be a nonnegative integer.

Example:


The position of the first character in a string is 0.


Finding a substring
LOCATING A SUBSTRING

search(S,SubS,m)	Returns the starting position of SubS in S, found by beginning the search at position m. Returns -1 if SubS is not found.

Arguments:

S is a string.

SubS is a substring of S.

m is a nonnegative integer representing the position in S at which the search begins.

Example:


CONVERTING A VECTOR TO A STRING

vec2str(v)	Returns a string formed by converting the ASCII codes in v.

Arguments:

v is a vector containing integers between 0 and 255.

Example:


CONVERTING A STRING TO A VECTOR

str2vec(S)	Returns a vector of ASCII codes formed by converting the characters in S.

Arguments:

S is a string.

Example:


USER-DEFINED ERROR MESSAGES

error(S)	Returns S as an error message.

Arguments:

S is a string.

Example:


YOUR MATHCAD WORKSHEET

A Mathcad worksheet is a collection of equations, text, and graphics. Each equation, piece of text, or graphic that you create is a ‘region.’ Mathcad creates an invisible rectangle to hold each region. To see the regions, choose Regions from the View menu.

To start a new region:

Click in blank space. This leaves a small crosshair wherever you clicked the mouse.

Then either type an equation, insert text, or create a graph.

As you insert various equations, text and graphics into a worksheet, you can arrange them however you like. You can also lock certain regions so they cannot be edited.

Deleting regions

Moving regions

Inserting blank lines between regions

Aligning regions

Separating regions

Locking regions