100%(1)100% encontró este documento útil (1 voto)

29 vistas257 páginasmathcad

TRN-4010-003-01_SG-Ins_Lec_EN

© © All Rights Reserved

PDF, TXT o lea en línea desde Scribd

mathcad

© All Rights Reserved

100%(1)100% encontró este documento útil (1 voto)

29 vistas257 páginasTRN-4010-003-01_SG-Ins_Lec_EN

mathcad

© All Rights Reserved

Está en la página 1de 257

rP

TC

In

te

rn

al

se

nl

Copyright 2013 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.

User and training guides and related documentation from PTC Inc. and its subsidiary companies

(collectively "PTC") are subject to the copyright laws of the United States and other countries

and are provided under a license agreement that restricts copying, disclosure, and use of such

documentation. PTC hereby grants to the licensed software user the right to make copies in

printed form of this documentation if provided on software media, but only for internal/personal use

and in accordance with the license agreement under which the applicable software is licensed.

Any copy made shall include the PTC copyright notice and any other proprietary notice provided

by PTC. Training materials may not be copied without the express written consent of PTC. This

documentation may not be disclosed, transferred, modified, or reduced to any form, including

electronic media, or transmitted or made publicly available by any means without the prior written

consent of PTC and no authorization is granted to make copies for such purposes.

Information described herein is furnished for general information only, is subject to change without

notice, and should not be construed as a warranty or commitment by PTC. PTC assumes no

responsibility or liability for any errors or inaccuracies that may appear in this document.

nl

The software described in this document is provided under written license agreement, contains

valuable trade secrets and proprietary information, and is protected by the copyright laws of the

United States and other countries. It may not be copied or distributed in any form or medium,

disclosed to third parties, or used in any manner not provided for in the software licenses agreement

except with written prior approval from PTC.

rn

al

se

DAMAGES AND CRIMINAL PROSECUTION. PTC regards software piracy as the crime it is,

and we view offenders accordingly. We do not tolerate the piracy of PTC software products, and

we pursue (both civilly and criminally) those who do so using all legal means available, including

public and private surveillance resources. As part of these efforts, PTC uses data monitoring and

scouring technologies to obtain and transmit data on users of illegal copies of our software. This

data collection is not performed on users of legally licensed software from PTC and its authorized

distributors. If you are using an illegal copy of our software and do not consent to the collection

and transmission of such data (including to the United States), cease using the illegal version, and

contact PTC to obtain a legally licensed copy.

te

Important Copyright, Trademark, Patent, and Licensing Information: See the About Box, or

copyright notice, of your PTC software.

UNITED STATES GOVERNMENT RESTRICTED RIGHTS LEGEND

rP

TC

In

This document and the software described herein are Commercial Computer Documentation and

Software, pursuant to FAR 12.212(a)-(b) (OCT95) or DFARS 227.7202-1(a) and 227.7202-3(a)

(JUN95), and are provided to the US Government under a limited commercial license only. For

procurements predating the above clauses, use, duplication, or disclosure by the Government

is subject to the restrictions set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data

and Computer Software Clause at DFARS 252.227-7013 (OCT88) or Commercial Computer

Software-Restricted Rights at FAR 52.227-19(c)(1)-(2) (JUN87), as applicable. 01282013

PTC Inc., 140 Kendrick Street, Needham, MA 02494 USA

PRINTING HISTORY

Fo

Document No.

TRN-4010-M02-EN-LM-P01

Printed in the U.S.A

Date

Description

10/21/2013

Mathcad Prime 3.0 Essentials

Welcome to PTC University!

With an unmatched depth and breadth of product development knowledge,

PTC University helps you realize the most value from PTC products. Only

PTC University offers:

In

te

rn

al

se

nl

Methodology is a proven proprietary approach used by PTC to develop and

deliver learning solutions.

Flexible Delivery Options PTC University ensures you receive the same

quality training programs regardless of the learning style. Our extensive

experience, innovative learning techniques, and targeted learning modules

facilitate the rapid retention of concepts, and higher user productivity.

Premier Content and Expertise A thorough instructor certification process

and direct access to the PTC product development and PTC consulting

organizations means that only PTC courses can give you highly-qualified

instructors, the most up-to-date product information and best practices

derived from thousands of deployments.

Global Focus PTC University delivers training where and when you need it

by providing over 100 training centers located across 35 countries offering

content in nine languages.

Delivering Value A role-based learning design ensures the right people

have the right tools to do their jobs productively while supporting the

organizations overall performance goals.

rP

TC

The course you are about to take will expose you to a number of learning

offerings that PTC University has available. These include:

Fo

personal demonstrations, hands-on workshops, assessments, and

post-classroom tools.

Pro/FICIENCY - This Web-based, skills assessment and

development-planning tool will help improve your skills and productivity.

eLearning Libraries - 24/7 access to Web-based training that will

compliment your instructor-led course.

Precision LMS - A powerful learning management system that will manage

your eLearning Library and Pro/FICIENCY assessments.

corporate learning programs designed to your organizations specific goals,

current skills, desired competencies and training preferences.

Whatever your learning needs are, PTC University can help you get the most

out of your PTC products.

North America

nl

Tel: (888) 782-3773

Fax: (781) 370-5307

Technical Support (Monday - Friday)

Tel: (800) 477-6435

Fax: (781) 707-0328

License Management and Contracts

Tel: 877-ASK-4-PTC (877-275-4782)

Fax: (781) 707-0331

se

Europe

Tel: +800-PTC-4-HELP (00-800-78-24-43-57)

al

Asia

rn

information.

Fo

rP

TC

In

te

In addition, you can access the PTC Web site at www.ptc.com. Our Web

site contains the latest training schedules, registration information, directions

to training facilities, and course descriptions. You can also reach technical

support, and register for online service options such as knowledge base

searches, reference libraries and documentation. You can also find general

information about PTC, PTC Products, Consulting Services, Customer

Support, and PTC Partners.

Precision Learning

The Precision Learning Methodology

PTC developed the Precision Learning methodology to provide you with an

effective, comprehensive learning experience. This methodology is based on

a cycle of learn, assess and improve.

In

te

rn

al

se

nl

Live Classroom (either in-center or on-site)

Virtual Class (live training delivered over the Web)

Web-based Training

Assessing using Pro/FICIENCY, PTCs Web-based skills assessment and

development planning tool.

Improving through the review of self-paced learning materials available in

PTC University.

rP

TC

a comprehensive library of self-paced and virtual courses corresponding

to PTC products.

Fo

training program, focused on measuring the increase in your effectiveness

with PTC products.

More information is available for all of these offerings in the training section of

PTC.com at http://www.ptc.com/services/training/index.htm.

PTCs classes are based on the proven instructional design principal of Tell

Me, Show Me, Let Me Do:

Topics are introduced through a short presentation, highlighting the key

concepts.

These key concepts are then reinforced by seeing them applied in the

software application.

You then apply the concepts through structured exercises.

After the course, a Pro/FICIENCY assessment is provided in order for you to

assess your understanding of the materials. The assessment results will also

identify the class topics that require further review.

At the end of the class, you will either take a Pro/FICIENCY assessment

via your PTC University account, or your instructor will provide training on

how to do this after the class.

Each student that enrolls in a PTC class has a PTC University account. This

account will be automatically created if you do not already have one. As part

of the class, you receive additional content in your account:

nl

Recommended Learning Report based on your results.

A Web-based training version of the course, based on the same

instructional approach of lecture, demonstration and exercise. The

Recommended Learning Report will link directly to sections of this training

that you may want to review.

Fo

rP

TC

In

te

rn

al

se

Please note that Web-based training may not be available in all languages.

The Web-based training is available in your account for one year after the

live class.

PTC uses a role-based training approach. The roles and the associated

training are graphically displayed in a curriculum map. Curriculum maps are

available for numerous PTC products and versions in the training section of

PTC.com at http://www.ptc.com/services/edserv/learning/paths/index.htm.

Please note that a localized map may not be available in every language and

that the map above is partial and for illustration purposes only.

Fo

rP

TC

In

te

rn

al

se

nl

Before the end of the class, your instructor will review the map

corresponding to the course you are taking. This review, along with instructor

recommendations, should give you some ideas for additional training that

corresponds to your role and job functions.

Guide Layout

The information in this guide is organized as topics to aid students in finding

information after the class is complete. Each topic is divided into the following

sections:

al

se

nl

Concept this section contains the initial introduction to the topic and is

presented during the class lecture.

Theory this sections provides detailed information introduced in the

Concept.

Procedure This section provides step-by-step instructions on how to

complete the topic within MATHCAD. Procedures are short, focused,

and simple exercises that cover the specific topics to which they apply.

Procedures are found in this Student Handbook only. Not every topic has a

Procedure as there are knowledge topics that can not be exercised.

Exercise Exercises are longer than procedures, and may cover multiple

topics, so not every topic will have an associated exercise. Exercises are

typically more involved and use more complicated models. Exercises are

found in the printed Exercise Guide and the online exercise HTML files.

rn

Additionally, these topics are organized into modules. Except for the first

module, all modules are grouped to keep similar functionality together.

Fo

rP

TC

In

te

The first module is a process module. In this module, you will find the generic

process used to solve the common types of Behavioral Modeling problems.

Training Agenda

12

13

14

15

16

17

18

19

20

21

22

3-D Plotting

Boolean Conditions

Symbolics

Solving

Optimization

Differential Equations

Programming

Data Exchange

Data Analysis

Project Day 2

Challenge Exercise Solutions

Fo

rP

TC

In

te

rn

al

Day 2

Module

Module

Module

Module

Module

Module

Module

Module

Module

Module

Module

nl

Getting Started

Documenting and Formatting

Entering and Editing Math

Variables

Functions

Range Variables

Controlling Calculations

Vectors and Matrices

Units

2-D Plotting

Project Day 1

se

01

02

03

04

05

06

07

08

09

10

11

Module

Module

Module

Module

Module

Module

Module

Module

Module

Module

Module

Day 1

rP

TC

Fo

al

rn

te

In

se

nl

Table of Contents

Mathcad Prime 3.0 Essentials

Getting Started ............................................................................1-1

Opening Mathcad ....................................................................1-2

The Mathcad Workspace ..........................................................1-5

Mathcad Worksheets ...............................................................1-6

Saving Mathcad Files ...............................................................1-7

se

nl

Text Regions ..........................................................................2-2

Embedding Math in a Text Region ..............................................2-4

Options for Formatting Worksheets .............................................2-6

Understanding Mathcad Templates .............................................2-7

rn

al

Using Operators......................................................................3-2

Entering and Evaluating a Mathematical Expression .......................3-5

Formatting Math Regions ..........................................................3-9

Formatting Mathematical Results.............................................. 3-11

Implied Multiplication.............................................................. 3-12

rP

TC

In

te

Variables ....................................................................................4-1

Defining a Variable ..................................................................4-2

Numerically Evaluating a Variable ...............................................4-5

Defining a Global Variable .........................................................4-7

Assigning an Expression Retroactively ........................................4-9

Using Literal Subscripts .......................................................... 4-11

Fo

Functions ...................................................................................5-1

Defining a User-Defined Function ...............................................5-2

Inserting a Built-In Function .......................................................5-5

Design of Experiments Functions ...............................................5-8

Using Deprecated Functions......................................................5-9

Range Variables ..........................................................................6-1

Defining a Range Variable.........................................................6-2

Using a Range Variable ............................................................6-7

Controlling Calculations ...............................................................7-1

Controlling Calculations ............................................................7-2

Using Calculation Options .........................................................7-5

Using Areas ...........................................................................7-6

Vectors and Matrices ...................................................................8-1

Vectors and Matrices ...............................................................8-2

Defining Vectors and Matrices....................................................8-5

Nested Arrays ...................................................................... 8-14

Using Array Operators and Functions ........................................ 8-17

Units ..........................................................................................9-1

Selecting a Unit System............................................................9-2

Using Units ............................................................................9-4

Adding Units to Arrays and Range Variables .................................9-9

Using Angular Units ............................................................... 9-13

Using Temperature Units ........................................................ 9-14

se

nl

Plotting Data in 2-D ............................................................... 10-2

Plotting Functions in 2-D ......................................................... 10-5

2-D Plot Formatting ............................................................... 10-8

2-D Trace Formatting ........................................................... 10-11

2-D Axes Formatting ............................................................ 10-14

Using Units with 2-D Plots ..................................................... 10-18

rn

al

Structural Engineering Project Day 1 ...................................... 11-2

Mechanical Engineering Project Day 1 .................................... 11-4

rP

TC

In

te

Plotting Functions in 3-D ......................................................... 12-2

Formatting a 3-D Plot ............................................................. 12-6

Plotting Data in 3-D ............................................................... 12-8

Plotting Multiple Traces ........................................................ 12-11

Fo

Using Boolean Operators ........................................................ 13-2

Writing Equations Using Boolean Operators................................ 13-3

Creating Conditional Statements .............................................. 13-4

Using Piecewise Continuous Functions...................................... 13-5

Symbolics ................................................................................ 14-1

Symbolics ............................................................................ 14-2

Symbolic Calculation.............................................................. 14-5

Symbolic Algebra .................................................................. 14-8

Solving..................................................................................... 15-1

Solving for Roots of Equations ................................................. 15-2

Numerically Solving Systems of Linear Equations ........................ 15-7

Numerically Solving Systems of Nonlinear Equations.................. 15-12

Symbolically Solving Systems of Equations .............................. 15-15

Modifying the Convergence and Constraint Tolerance................. 15-17

Optimization ............................................................................. 16-1

Constrained Optimization ........................................................ 16-2

Differential Equations ................................................................ 17-1

Ordinary Differential Equations................................................. 17-2

Programming ............................................................................ 18-1

Creating a Program ............................................................... 18-2

Conditional Statements .......................................................... 18-6

Looping Constructs.............................................................. 18-12

nl

Importing Data ...................................................................... 19-2

Exporting Data...................................................................... 19-6

Using the Excel Component .................................................... 19-8

al

se

Data Analysis ....................................................................... 20-2

Smoothing Data .................................................................... 20-4

Interpolating Data ................................................................ 20-10

Regressing Data ................................................................. 20-16

te

rn

Structural Engineering Project Day 2 ...................................... 21-2

Mechanical Engineering Project Day 2 .................................... 21-3

Fo

rP

TC

In

rP

TC

Fo

al

rn

te

In

se

nl

1

y

Module

nl

Getting Started

se

Module Overview

In this module, you learn how to open Mathcad and save Mathcad files.

Objectives

Fo

rP

TC

In

te

rn

al

Open Mathcad files.

Save Mathcad files.

2013 PTC

Module 1 | Page 1

Opening Mathcad

This process enables you to open Mathcad, a new worksheet,

or an existing file.

To get started:

se

nl

worksheet.

Open a new Mathcad worksheet.

Open an existing Mathcad file.

rP

TC

In

te

rn

al

Worksheet

Worksheet or an Existing

Mathcad File

Fo

Opening Mathcad

Open Mathcad and display a blank worksheet.

Open a new Mathcad worksheet.

Open an existing Mathcad file.

Module 1 | Page 2

2013 PTC

Task 1:

Open Mathcad.

button.

rP

TC

In

te

rn

al

se

Task 2:

nl

Prime 3.0.

Mathcad opens and displays a

blank worksheet.

Fo

2. Click New

. A new

worksheet tab opens.

2013 PTC

Module 1 | Page 3

Task 3:

.

nl

click Open

button and

Fo

rP

TC

In

te

rn

al

se

Select any appropriate Mathcad

file and click Open.

Module 1 | Page 4

2013 PTC

The Mathcad workspace consists of worksheets and user

interface items.

The Mathcad workspace contains the following user interface items:

Mathcad Prime button

Ribbon

Quick Access toolbar

Status Bar

nl

se

rn

al

interface items:

Fo

rP

TC

In

te

button When selected, you can access

commands related to files such as Open, Save, and Print.

Ribbon The ribbon contains tabs that group related commands. The

following tabs are available:

Math Contains operators, symbols, constants, and units.

Input/Output Contains data input and output elements.

Functions Contains Mathcad built-in functions.

Matrices/Tables Contains matrices, table operators, and functions.

Plots Contains commands to insert and format plots.

Math Formatting Contains math, results, and label formatting

commands.

Text Formatting Contains text and paragraph formatting commands.

Calculation Contains calculation options, controls, and error tracing.

Document Contains documentation and page options.

Getting Started Contains help, tutorials, and various other supporting

resources.

Quick Access toolbar Contains frequently used commands. By default,

the New, Open, Save, Undo, and Redo commands are located here. You

can customize this by right-clicking a command or icon located in the

ribbon and selecting Add to Quick Access Toolbar.

Status Bar Located at the bottom of the Mathcad window and contains:

Find and Replace commands.

A Zoom Slider.

Page and Draft View icons.

2013 PTC

Module 1 | Page 5

Mathcad Worksheets

Display and calculate your work in Mathcad worksheets.

Math, text, and other elements

are contained in regions in your

worksheet. The following types of

regions are available:

nl

Math

Table

Plot

Solve Block

Image

Text Block or Box

In

Mathcad Worksheets

te

rn

al

se

Math

Table

Plot

Solve Block

Image

Text Block or Box

Fo

rP

TC

Mathcad worksheets are where you display and calculate your work. You can

have multiple worksheets open in Mathcad at once. To display a worksheet,

select the tab for that worksheet. Math, text, and other elements are contained

in regions in your worksheet. The following types of regions are available:

The Document tab contains commands that enable you to customize your

worksheet. The following commands are available:

Page Orientation Portrait or Landscape.

Margin Type Standard, Narrow, or Wide.

Show Grid Show or hide gridlines.

View Print or Draft view.

Zoom Slider Increase or decrease the zoom level of the page.

Headers and Footers Add headers and footers.

Module 1 | Page 6

2013 PTC

Mathcad enables you to select from three file types when saving

files.

To save a Mathcad file, select one of

the following file types to Save As:

se

nl

MCDX

MCTX

XPS

te

rn

al

Type from Save As

In

To save a Mathcad file, select one of the following file types to Save As:

Fo

rP

TC

MCDX The default save format for Mathcad files is a Mathcad MCDX

document (.mcdx).

MCTX You can save your document as a template that can be used to

create future worksheets.

XPS You can also select an XML Paper Specification format (.xps). The

XPS format is Microsofts electronic paper file format and is similar to

a PDF.

2013 PTC

Module 1 | Page 7

Task 1:

click Save

button and

.

Type a file name in the File name

field.

nl

as type drop-down menu. The

default save format is the native

Mathcad file format (.mcdx).

se

4. Click Save.

Fo

rP

TC

In

te

rn

al

Module 1 | Page 8

2013 PTC

2

nl

Module

se

Module Overview

many options for formatting worksheets. In this module, you learn how to work

with text regions and use various options for formatting Mathcad worksheets.

al

Objectives

Fo

rP

TC

In

te

rn

Work with text regions.

Embed math in a text region.

Use various options for formatting Mathcad worksheets.

Use Mathcad templates.

2013 PTC

Module 2 | Page 1

Text Regions

Mathcad supports calculation documentation through the use

of text regions.

Text regions:

Are text blocks or text boxes.

Contain resize handles.

Have a text style that you can view

on the Text Formatting tab which

determines:

Font

Size

Color

Other standard text properties

al

se

nl

rn

te

Text Regions

In

You can insert a text region by selecting the Document or Math tabs.

rP

TC

A text block by pressing CTRL+SHIFT+T.

A text box by pressing CTRL+T.

Fo

A text block is a text region that extends the full page width and does not

overlap with other regions in the worksheet. A text box is a text region that

expands as text is typed and can be moved across the worksheet. Text boxes

contain a resize handle to control the width of the region.

Each text region has an associated text style. A style determines the font,

size, color, and other standard text properties. The current text style displays

in the Text Font group of the Text Formatting tab. You can change the text

style globally or locally.

The Formatting tab also enables you to:

Alter justification.

Add bullets or numbers to lists.

Decrease or increase font size.

Locally modify text.

Module 2 | Page 2

2013 PTC

Task 1:

2. In the Text Font group, click the

Font drop-down list and select

a font.

nl

Task 2:

Size drop-down list and select

a size.

se

U

Formatting text in Mathcad

Prime.

worksheet and press CTRL+T to

insert a text box.

rn

al

the text region.

te

Fo

rP

TC

In

2013 PTC

Module 2 | Page 3

You can insert a math region in a text block or a text box.

You can embed:

Expressions

Definitions

Functions

Matrices

nl

se

You can insert a math region in a text block or a text box. The embedded

math region is live. Mathematical functions, equations, and definitions are

evaluated as if they were located outside of the text.

The embedded math region can include:

rn

al

Expressions

Definitions

Functions

Matrices

Fo

rP

TC

In

te

Module 2 | Page 4

2013 PTC

Task 1:

worksheet. Right-click and select

Insert Text Box from the context

menu.

2. In the text box, type The

acceleration due to gravity,.

nl

to embed a math

Region

region in the text region.

al

the math region and type is a

Mathcad built-in variable..

se

evaluate the acceleration due to

gravity (g).

te

rn

complete embedding the math

region inside of the text region.

Fo

rP

TC

In

2013 PTC

Module 2 | Page 5

Mathcad enables you to create readable, aesthetically pleasing

worksheets.

nl

Separating overlapping regions.

Displaying grids and adjusting the grid size.

Editing the worksheet header and footer.

Moving selected text regions using the arrow keys.

You can format worksheets using one or more of the following options:

se

worksheets using one or more of the following options:

te

rn

al

Insert and delete blank lines by right-clicking a blank area between two

regions and selecting Add Space or Remove Space.

Separate overlapping regions by selecting both regions, right-clicking, and

selecting Separate Regions Vertically or Separate Regions Horizontally.

Toggle the worksheet grid off and on by selecting the Document tab. In the

rP

TC

In

.

Page group, click Show Grid

Adjust the grid size by selecting the Document tab. In the Page group, click

Grid Size and select Standard or Fine from the Grid Size drop-down list.

To edit the header or footer, select the Document tab. In the Headers and

Footers group, click Header

Fo

Footer

the Headers and Footers group, you can:

Insert a page number.

Insert the last saved date.

Insert the file name or the full file path.

To move a math or text region, select it and use the arrow keys on your

keyboard.

Module 2 | Page 6

2013 PTC

Templates are an important aspect of calculation management

within an organization.

Mathcad templates can specify the following:

nl

Math styles

Text styles

Page defaults

Headers and footers

Numerical formats

Unit systems

Calculation mode

Plot values

se

rn

al

organization. You can have multiple templates: a single corporate standard

or separate templates for a variety of tasks that need to be standardized.

Templates have the extension .mctx and are identical in form to a .mcdx

worksheet.

Mathcad templates can specify the following:

Fo

rP

TC

In

te

Text styles Available on the Text Formatting tab.

Page defaults Available on the Document tab.

Headers and footers Available on the Document tab.

Numerical formats Available on the Math Formatting tab.

Unit systems Available on the Math tab.

Calculation mode Available on the Calculation tab.

Plot values Available on the Plots tab.

Templates are often starting points for new worksheets in which all document

settings have been established. Your personal templates are stored in the

My Templates folder. You can also share your templates by saving them to

the Shared Templates folder.

To use a Mathcad template, click Prime

the following options:

From My Templates

From Shared Templates

From Default Templates

Alternately, you can select a template from the Recently Used Templates

section.

Once your new worksheet has been created using the template, save your

worksheet as a .mcdx file using a new file name.

2013 PTC

Module 2 | Page 7

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 2 | Page 8

2013 PTC

3

nl

Module

se

Module Overview

In this module, you learn how to input math in a Math region in Mathcad, edit

the mathematical expressions you typed, and format the evaluated results.

al

Objectives

Fo

rP

TC

In

te

rn

Use and modify operators.

Enter and evaluate a mathematical expression.

Format math regions.

Format mathematical results.

Use implied multiplication.

2013 PTC

Module 3 | Page 1

Using Operators

Operators are symbols, such as the plus sign (+) and the

minus sign (-), that link variables and numbers together to form

expressions.

When typing or modifying a

mathematical expression in Mathcad

you can:

nl

Insert an operator.

Identify the operands.

Modify an existing operator.

se

Using Multiple Operators

Using Operators

al

Operators are symbols, such as the plus sign (+) and the minus sign (-), that

link variables and numbers together to form expressions. When typing or

modifying a mathematical expression in Mathcad you can:

Fo

rP

TC

In

te

rn

or by selecting an operator from the Operators and Symbols group of the

Math tab.

Identify the operands Operands are the variables and numbers linked by

the operators. The operands linked by an operator are easily identified by

clicking the operator.

Modify an existing operator You can modify an existing operator by

clicking it and inserting a new operator, or by deleting it and inserting

a new operator.

Module 3 | Page 2

2013 PTC

Task 1:

Insert an operator.

1. Click in the worksheet and insert the Square Root and Nth Root

operator.

Select the Math tab.

In the Operators and Symbols group, click Operators

operator.

nl

se

desired operator.

2. Type 2+3 in the placeholder under the Square Root operator. The

cursor appears to the right of the 3 when complete.

al

rn

that appears.

operator.

In

Division

te

rP

TC

or Determinant

operator. Type 10+9 in the placeholder. The

cursor appears to the right of the 9 when complete.

Fo

that appears.

Inline Division

operator.

appears. Click outside of the

region to complete.

An alternate method of

inserting an operator

is to use the keystroke

shown in the tooltip for

the operator.

2013 PTC

Module 3 | Page 3

Task 2:

Identify operands.

1. Using the expression typed in for the previous task, click any operator.

2. Note that the operator color changes to blue and blinks. The operands

associated with the blue highlighted operator highlight in gray.

3. Click other operators and note how the operands change.

Task 3:

Modify an operator.

nl

Task 1, click the + operator in the

numerator.

se

expression.

click the + operator in the

denominator.

te

rn

Root

operator. Note the

operand location.

al

Fo

rP

TC

In

Module 3 | Page 4

2013 PTC

Expression

A mathematical expression in Mathcad is typed in a Math region

using natural math notation.

You can use the following items to

insert and evaluate mathematical

expressions:

nl

Placeholders

Operators

Symbols

Constants

Expression

se

rn

rP

TC

Placeholders

te

Placeholders

Operators

Symbols

Constants

In

al

using natural math notation. Mathcad assembles and evaluates the parts of

an expression using the rules of precedence. You can use the following items

to insert and evaluate mathematical expressions:

Fo

can type a constant, variable, or another expression. If you do not fill in the

placeholder, an error message appears when you click outside of the region.

derivatives, and summations. You can type an appropriate number, variable,

or expression in each placeholder. To navigate to each placeholder, you can

use one of the following methods:

Click in each placeholder individually.

Press the arrow keys.

2013 PTC

Module 3 | Page 5

Fo

rP

TC

In

te

rn

al

se

nl

Operators, Symbols, and Constants are all found on the Math tab in

the Operators and Symbols group. You can use them when entering a

mathematical expression.

Module 3 | Page 6

2013 PTC

Expressions

Task 1:

the term shown.

Insert operators by

selecting the Math

tab. In the Operators

and Symbols group,

O

se

U

rn

operator.

al

cursor on the right side of the

term. Press (the minus symbol)

and type 100 in the placeholder.

nl

,

click Operators

and select the desired

operator.

rP

TC

In

te

4. Insert the Pi

constant.

Select the Math tab.

In the Operators and Symbols

group, click Constants

Fo

Select Pi

2013 PTC

Pi displays in a different

color. This denotes

that Pi is labeled as a

constant.

Module 3 | Page 7

Task 2:

you created in the previous task.

2. Press = (equal sign).

You can also insert the

Evaluation operator

by selecting the Math

tab, clicking Operators

nl

, and selecting

Evaluation

Fo

rP

TC

In

te

rn

al

se

Module 3 | Page 8

2013 PTC

Formatting can be applied to all math regions in a worksheet

or in selected regions.

Formatting math regions can include:

Math font properties.

Label styles.

se

nl

al

te

rn

regions. Each math region has a math font style associated with variables

and constants. A style determines the font, size, color, and other standard

text properties. You can view the style you are using in a math region in the

Math Font group on the Math tab when the region is selected.

In

rP

TC

Label styles.

You can also add highlighting to a math region. This is an effective method

for drawing attention to a region or a set of regions.

Fo

Each region, math or text, is an individual entity that you can move or position

within a workspace. You can move these regions individually or as a group.

2013 PTC

Module 3 | Page 9

Task 1:

g=, and click outside of the

region. The built-in variable g is

evaluated as shown.

nl

Constant from the Label Styles

drop-down menu.

se

color options. The built-in

variable name g changes to a

red font as shown.

to restore

Highlight a region.

te

Task 2:

rn

al

the labels to the default style.

In

created previously, evaluating g.

rP

TC

Fo

and select

Highlight Color

the color yellow from the color

options. The region is highlighted

as shown.

This completes the procedure.

Module 3 | Page 10

2013 PTC

You can apply results formatting globally or to one or more

regions in your worksheet.

The following formatting options are

available:

Result Format

Display Precision

Show Trailing Zeros

Complex Values

Formatting Tab

nl

se

You can apply results formatting globally or to one or more regions in your

worksheet. The following formatting options are available:

Fo

rP

TC

In

te

rn

al

Result Format You can select the display format of numeric results from

this drop-down list. The following options are available:

General

Decimal

Scientific

Engineering

Percent

Display Precision Controls the number of digits displayed to the right

of the decimal point.

To set the zero threshold for your worksheet, set the result format to

Decimal and then modify the display precision. Any result smaller than

the selected display precision is displayed as zero.

Show Trailing Zeros Toggles the display of trailing zeros to the right of

the decimal point. The display precision selected controls the number

of trailing zeros displayed.

Complex Values Displays the result in Cartesian or Polar form.

To remove any changes and return to the default result formatting, click Clear

Format.

2013 PTC

Module 3 | Page 11

Implied Multiplication

Mathcad supports implied multiplication.

Implied multiplication:

Insert by typing a numerical

constant followed by a variable.

Use is not supported with the

following variables:

i, j.

nl

se

Implied Multiplication

al

the Multiplication operator between constants and variables.

te

rn

operator when one is not explicitly specified. To use implied multiplication,

you must type a numerical constant followed by a variable.

rP

TC

In

inserted between the leading constant and the variable. Clicking outside of

the region suppresses the operator for display and printing purposes. You can

create the same expression by explicitly typing the Multiplication operator.

Fo

There are two variables in which Mathcad does not insert an implied

Multiplication operator. These two variables are reserved suffixes and are the

letters i and j. These are reserved for complex numbers using i or j notation.

You can select these letters as variables, but you must always explicitly type

the Multiplication operator.

Module 3 | Page 12

2013 PTC

4

y

Module

nl

Variables

se

Module Overview

In this module, you learn how to define and evaluate variables, assign an

expression retroactively, and use literal subscripts.

al

Objectives

Fo

rP

TC

In

te

rn

Define a variable.

Evaluate a variable.

Define a global variable.

Assign an expression retroactively.

Use literal subscripts.

2013 PTC

Module 4 | Page 1

Defining a Variable

A variable may equal a scalar, array, string, or range of scalar

values.

Variables in Mathcad:

al

se

nl

Variable names may include the following:

Upper and lowercase letters.

Digits (0-9).

Underscore (_) character.

Symbols.

Literal subscripts.

Constants.

The following restrictions apply to variable names:

Variable names cannot start with a digit.

All characters must have the same font.

Mathcad does not distinguish between variable and function names.

rn

Defining a Variable

te

Often you must define values as variables that you can use in subsequent

calculations.

In

and select Definition

rP

TC

names in Mathcad may include:

Upper and lowercase letters.

Digits (0-9).

Underscore (_) character.

Symbols.

Literal subscripts.

Constants.

Fo

Variable names cannot start with a digit.

All characters must have the same font.

Mathcad does not distinguish between variable and function names.

Expressions may contain a variable that has been previously defined to

the left or above the location of its current use. Math regions are read and

processed left to right, top to bottom.

Module 4 | Page 2

2013 PTC

If the variable used in the expression has not been previously defined, an error

message displays and the undefined variable is circled in red. Even if more

than one variable is undefined, Mathcad flags only one variable at a time.

Fo

rP

TC

In

te

rn

al

se

nl

function name. If you redefine these names the previous or built-in meaning

no longer works.

2013 PTC

Module 4 | Page 3

Task 1:

Define a variable.

2. Select the Math tab. In the

Operators and Symbols group,

click Operators

and select

nl

O

se

U

al

Fo

rP

TC

In

te

rn

placeholder:

A scalar.

An expression.

An array.

A string.

A range variable.

Definition

. The Definition

operator and a placeholder

appears.

Module 4 | Page 4

2013 PTC

Mathcad evaluates variables and expressions in a left-right,

top-down order.

Variables and expressions in

Mathcad:

nl

changes, provided the default Auto

Calculation mode is enabled.

Are evaluated to the right or below

where they are defined.

variable in Mathcad directly in the

definition statement.

Definition Statement

In

te

rn

al

se

a Variable

rP

TC

expressions immediately update as you make changes, provided you have

the Auto Calculation mode enabled, which is the default mode.

Fo

You can evaluate a variable to the right of where it is defined or below where it

is defined. If a variable is redefined to the left or below the original definition,

the variable takes on the new definition value when evaluated.

You can also evaluate a variable directly in the definition statement. The

result is bound to the assigned variable name.

2013 PTC

Module 4 | Page 5

Task 1:

Select the Math tab. In the

Operators and Symbols group,

and select

click Operators

Definition

rn

al

placeholder after the Definition

operator.

se

nl

SHIFT : to insert the

Definition operator.

The keystrokes display

in the hovertext

description of the

operator.

In

te

x3. Select the Math tab. In the

Operators and Symbols group,

and select

rP

TC

click Operators

Fo

Evaluation

variable:

To the right of where

it is defined.

Below where it is

defined.

You can also evaluate

a variable in the

definition statement,

binding the result to

the assigned variable

name.

Module 4 | Page 6

2013 PTC

Mathcad also uses a definition construct called a global

definition.

nl

Custom units and unit

abbreviations.

Material properties.

Other variables and functions that

remain the same.

specify:

se

al

Global definitions are similar to other variable definitions except they are

evaluated first. When a worksheet is opened, Mathcad scans the entire

document twice. The first scan processes global definitions. The second

scan processes other variable definitions.

te

rn

function is available to all other definitions in your worksheet, regardless of

whether the definitions appear above or below the global definition.

Custom units and unit abbreviations.

Material properties.

Other variables and functions that remain the same.

rP

TC

In

Fo

redefined in the same worksheet. Any attempt to redefine the variable name

results in an error.

2013 PTC

Module 4 | Page 7

Task 1:

the variable name global.

adheres to the same

rules and restrictions

as a local variable

name.

nl

3. Click Operators

from the

Operators and Symbols group.

se

rP

TC

In

te

rn

A global variable

definition can contain

variables that have

been globally defined

to the left or above

where they are being

used.

al

Evaluation group.

Task 2:

Fo

to the right of where you have

defined the global variable. Type

global.

2. Press = (equal sign) to evaluate

the variable.

Once a variable name

is used to define a

global variable, it

cannot be redefined in

the same worksheet.

Any attempt to redefine

the variable name

results in an error.

Module 4 | Page 8

2013 PTC

Mathcad enables you to retroactively assign an expression to a

variable or function name.

nl

it is useful to retroactively assign an

expression.

al

se

Figure 1 Expression to be

Retroactively Assigned

rn

Expression

te

Fo

rP

TC

In

in the worksheet.

2013 PTC

Module 4 | Page 9

Task 1:

expression shown.

se

nl

the cursor on the left side of the

expression as shown.

al

. A placeholder

te

Definition

appears.

and select

rn

click Operators

Operators and Symbols group,

rP

TC

In

and click outside of the region.

Fo

Module 4 | Page 10

2013 PTC

Mathcad provides literal subscripts for use in variable names.

You use literal subscripts in Mathcad

for:

Variable names.

Representing derivatives in partial

differential equations.

nl

se

Variable names.

Representing derivatives in partial differential equations.

click Subscript

You create literal subscripts by selecting the Math tab. In the Style group,

and type the subscript text.

Fo

rP

TC

In

te

rn

al

appear similar, but are different. Literal subscripts represent a

variable name. Array subscripts identify an element of an array,

specified by the subscript.

2013 PTC

Module 4 | Page 11

Task 1:

type v. Select the Math tab. In

the Style group, click Subscript

. Note the cursor position.

nl

outside of the math region.

Fo

rP

TC

In

te

rn

al

se

Module 4 | Page 12

2013 PTC

5

y

Module

nl

Functions

se

Module Overview

In this module, you learn how to define and evaluate user-defined and built-in

functions.

al

Objectives

Fo

rP

TC

In

te

rn

Define a user-defined function.

Insert a built-in function.

2013 PTC

Module 5 | Page 1

A user-defined function is a mathematical expression that

provides a unique output for one or more input values.

User-defined functions in Mathcad are defined using the Definition

operator.

se

nl

Upper and lowercase letters.

Digits (0-9).

Underscore (_) character.

Symbols.

Literal subscripts.

Constants.

Function names have the following restrictions:

Function names cannot start with a digit.

All characters must have the same font.

Mathcad does not distinguish between variable and function names.

al

In

te

rn

output for one or more input values. These input values are referred to as the

arguments of the function and are always enclosed in a pair of parentheses.

Mathcad contains built-in functions and enables the input of user-defined

functions.

rP

TC

Fo

Digits (0-9).

Underscore (_) character.

Symbols.

Literal subscripts.

Constants.

The following restrictions apply to user-defined function names:

Function names cannot start with a digit.

All characters must have the same font.

Mathcad does not distinguish between variable and function names.

User-defined function expressions may contain a variable that has been

previously defined to the left or above the location of its current use. Math

regions are read and processed left to right, top to bottom.

If the variable used in the expression has not been previously defined, an error

message displays and the undefined variable is circled in red. Even if more

than one variable is undefined, Mathcad flags only one variable at a time.

Module 5 | Page 2

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

or function name. If you redefine these names, their previous or built-in

meaning no longer works.

2013 PTC

Module 5 | Page 3

Task 1:

and press SHIFT+9.

nl

function, x,y, in the placeholder.

and select

al

. The Definition

Definition

operator and a placeholder

appears.

se

click Operators

Operators and Symbols group,

In

te

rn

the region.

Fo

rP

TC

Module 5 | Page 4

2013 PTC

Mathcad provides a library of built-in functions.

nl

se

Discrete Transform functions.

Statistics, Probability, and Data Analysis functions.

Design of Experiments functions.

Differential Equation Solvers.

File Access functions.

Finance functions.

Image and Signal Processing functions.

Probability Distribution.

Solving and Optimization functions.

Vector and Matrix functions.

Miscellaneous functions.

te

rn

al

In

rP

TC

Mathcad provides a library of built-in functions in the following areas:

Core Mathematical functions.

Discrete Transform functions.

Statistics, Probability, and Data Analysis functions.

Design of Experiments functions.

Differential Equation Solvers.

File Access functions.

Finance functions.

Image and Signal Processing functions.

Probability Distribution.

Solving and Optimization functions.

Vector and Matrix functions.

Miscellaneous functions.

Fo

To access these functions, select the Functions tab. You can also directly

type in a built-in function. Built-in functions are not font sensitive, but they are

case sensitive and you must spell them correctly.

2013 PTC

Module 5 | Page 5

Task 1:

the Functions group, click All Functions

. The Functions dialog

box appears on the left side of the worksheet.

2. Expand the Trigonometric function category.

rP

TC

In

te

rn

al

se

nl

category or by name.

Fo

the function into the worksheet.

Module 5 | Page 6

type in a built-in

function. Built-in

functions are not font

sensitive, but they are

case sensitive and

you must spell them

correctly.

2013 PTC

placeholder and press = (equal

sign).

To insert a function

in the worksheet,

select the Functions

tab. In the Functions

group, click a function

category and select the

desired function.

Fo

rP

TC

In

te

rn

al

se

nl

2013 PTC

Module 5 | Page 7

Design of Experiments (DOE) functions and plots enable you

to analyze the resulting data from experiments performed in a

DOE or Robust Design process.

You can use these functions for:

Analyzing and screening factors, and plotting results.

Developing statistical models.

Performing Monte Carlo simulations.

te

rn

al

se

nl

In

rP

TC

the resulting data from experiments performed in a DOE or Robust Design

process. You can use these functions for:

Fo

Create, analyze, or modify design matrices using Mathcads built-in

functions.

Analyzing and screening factors, and plotting results.

Screen factors by calculating their effects, level effects, and interactions.

Plot experimental results using the plot functionality.

Developing statistical models.

Mathcad DOE functions offer different types of regression analysis.

Performing Monte Carlo simulations.

You can generate random numbers for Monte Carlo simulations as well

as create a Monte Carlo sample for a given function.

Module 5 | Page 8

2013 PTC

Deprecated functions are functions that are not available in

Mathcad Prime.

Deprecated functions:

Work if typed in a worksheet, or imported in a legacy worksheet.

Are supported by Mathcad Prime for several releases.

nl

Deprecated functions are functions that are not available in Mathcad Prime.

Deprecated functions:

se

Work if typed in a worksheet, or imported in a legacy worksheet.

Are supported by Mathcad Prime for several releases.

Fo

rP

TC

In

te

rn

al

Prime. The Mathcad Prime Help files contain a list of the deprecated

functions and the existing alternative functions.

2013 PTC

Module 5 | Page 9

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 5 | Page 10

2013 PTC

6

y

Module

nl

Range Variables

se

Module Overview

In this module, you learn how to define, evaluate, and use a range variable.

Objectives

Fo

rP

TC

In

te

rn

al

Define a range variable.

Use a range variable.

2013 PTC

Module 6 | Page 1

Range variables are variables that are equal to a sequence or

range of values.

You can use a range variable to:

nl

values.

Define a vector or array,

element-by-element.

Control the domain of a 2-D plot.

Every range variable must have:

rP

TC

In

te

rn

al

se

A starting value.

An ending value.

A second value specified, if not

using a unit step.

Definition and Evaluation

Fo

As shown previously, a variable can be equal to a scalar, expression, or

a string. Variables can also be equal to a sequence or range of values.

Iterative processes in Mathcad worksheets depend on ranges of values or

range variables.

Use a range of values to:

Iterate a function over a range of values.

Define a vector or array, element-by-element.

Control the domain of a 2-D plot.

To evaluate a function over a range of points, you must define a range

variable and pass the range to the function.

Module 6 | Page 2

2013 PTC

in

operator.

Every range variable must have:

Fo

rP

TC

In

te

rn

al

se

nl

A starting value.

An ending value.

A second value specified, if not using a unit step.

2013 PTC

Module 6 | Page 3

Task 1:

worksheet and type the variable

name force.

nl

Select Definition

operator.

Select the Math tab.

In the Operators and Symbols

se

al

rn

, and

Operators

selecting the desired

operator.

operator by selecting

the Math tab, clicking

In

te

range followed by a comma, 1,.

Two placeholders and the Range

operator appear.

Fo

rP

TC

and type 5 in the second

placeholder.

Module 6 | Page 4

determined by the

difference between

the first and second

value in the range. The

range variable has a

constant step size over

the entire range.

2013 PTC

Task 2:

worksheet and type the variable

name force1.

2. Insert the Definition

operator.

3. Type 1..20 in the placeholder.

O

se

Fo

rP

TC

In

te

rn

al

worksheet, type force1, and

press =.

Task 3:

nl

operator rather than

typing ...

2013 PTC

Module 6 | Page 5

nl

variables, Mathcad displays

only the first 12 values in the

range. To view the remaining

values:

Click the three dots in the

evaluation display.

The navigator window

appears. Place the cursor

over the window and click and

drag to view the entire range

variable.

Fo

rP

TC

In

te

rn

al

se

Module 6 | Page 6

2013 PTC

You can use range variables to iterate a function over a range.

To use range variables to iterate a

function:

te

rn

al

se

nl

Define the range variable.

Evaluate the function using the

range variable.

In

rP

TC

cumbersome. To evaluate a range of points:

Fo

Define the range using a range variable.

Evaluate the function by passing the range variable to the function.

2013 PTC

Module 6 | Page 7

Task 1:

worksheet and define the

function shown.

You can insert any

operator by selecting

the Math tab, clicking

nl

, and

Operators

selecting the desired

operator.

Fo

rP

TC

In

te

rn

al

function and evaluate.

se

the range and the step size over

which the function iterates.

Module 6 | Page 8

2013 PTC

7

y

Module

nl

Controlling Calculations

se

Module Overview

re-enabling regions and automatic calculations, selecting calculations

options, and using areas.

al

Objectives

Fo

rP

TC

In

te

rn

Control calculations.

Use calculation options.

Use areas.

2013 PTC

Module 7 | Page 1

Controlling Calculations

By default, Mathcad opens in Auto Calculation mode. In this

mode, all results are automatically updated.

You can control calculations in

Mathcad by:

Calculation mode.

Disabling and re-enabling a

specific region or group of regions.

nl

Controlling Calculations

se

results are automatically updated. When Mathcad is in Auto Calculation

mode, a green circle appears in the message line on the lower-left corner of

the window.

rn

al

The numerical results and graphs you see in your window are always

up-to-date when in Auto Calculation mode. If your worksheet contains

several computationally intensive equations, scrolling through the worksheet

becomes time consuming as Mathcad updates all calculations as you scroll.

te

rP

TC

In

Disabling and re-enabling a specific region or group of regions to prevent

their evaluation.

If you have disabled a region, or group of regions, the following rules apply:

Fo

You can edit the disabled region but the result is not recalculated, and any

regions that depend on the disabled region are not affected.

The disabled regions are not affected by changes to other regions.

Module 7 | Page 2

2013 PTC

Task 1:

2. In the Controls group, click Stop

.

All Calculations

nl

in the Controls group. A gray

circle now appears in the

message line on the lower-left

corner of the window.

se

mode, select the Calculation

tab.

Calculation

te

Task 2:

rn

al

message line on the lower-left

corner of the window.

rP

TC

In

variable, x, and the function,

Calc(x), shown.

Fo

2013 PTC

Module 7 | Page 3

Select the Calculation tab.

In the Controls group, click

.

Disable Region

nl

Task 3:

regions to indicate

that the regions are

disabled.

In

Disable Region

te

rn

Select the Calculation tab.

In the Controls group, click

al

se

shown.

rP

TC

dimming to indicate

that the regions are

now enabled.

Fo

Module 7 | Page 4

2013 PTC

Mathcad provides calculation options that can be used when

evaluating mathematical expressions.

The following calculation options are

available:

nl

Approximate Equality

ORIGIN in Strings

Strict Singularity Check

Multithreading

Units/Constants in Symbolics

se

rn

al

mathematical expressions. The following calculation options are available:

Fo

rP

TC

In

te

expressions and truncation functions. When this option is selected:

Two numbers must differ by less than the maximum accuracy of your

computers floating point processor to be considered equal.

Numbers from 10-307 to 10-307 are considered to be zero.

All decimal places are used in determining the floor, ceiling, or truncated

value of a number.

ORIGIN in Strings This option controls the integer associated with the

first character in a string. String functions consider the worksheet value for

ORIGIN to be the index of the first character when this option is selected.

Strict Singularity Check This option controls the matrix inversion algorithm

used by Mathcad. If this option is selected, Mathcad checks whether the

input matrix or the inverted matrix is singular or ill-conditioned.

Multithreading Enables multiple calculations to run in parallel. Speeds

up processing of large data sets and matrices.

Units/Constants in Symbolics Controls automatic labeling of certain

variables as built-in units and constants in symbolics.

You can access these options by selecting the Calculation tab. In the

Worksheet Settings group, click Calculation Options

required option.

2013 PTC

Module 7 | Page 5

Using Areas

Calculations in Mathcad can be enclosed in an area and

collapsed and/or disabled.

To enclose calculations in an area:

Insert an area.

Type calculations in the area.

In

te

rn

al

se

nl

rP

TC

Using Areas

Fo

disabled. Areas enable you to group, hide, and disable calculation regions

within the area.

To enclose calculations in an area:

Insert an area.

Type calculations in the area.

An area enables you to:

Group related calculations.

Collapse or expand sets of calculations.

Disable all the math regions within the area at once by clicking in the area,

selecting the Calculation tab and clicking Disable Region

Insert a page break.

Insert an area, or a worksheet header or footer.

Module 7 | Page 6

2013 PTC

8

y

Module

nl

se

Module Overview

In this module, you learn how to define and use vectors and matrices.

Objectives

Fo

rP

TC

In

te

rn

al

Define vectors and matrices.

Extract elements from an array.

Nest arrays.

Use array operators and functions.

2013 PTC

Module 8 | Page 1

A variable can be comprised of a group of data in the form of a

vector or matrix.

You can insert an array in Mathcad

by:

Manual entry.

Defining each element using a

range variable.

Importing data from a file.

nl

Elements in an array:

By default, have a starting index of

0, referred to as the array ORIGIN.

se

al

rn

matrix. You can insert an array in Mathcad by:

In

te

Manual entry.

Defining each element using a range variable.

Reading in the array directly from a file.

rP

TC

is an array containing a single column.

Fo

The row and column index starting point default for the array elements is a

built-in variable in Mathcad. This variable is named ORIGIN and by default is

set to 0. You can globally set this variable by selecting the Calculation tab.

In the Worksheet Settings group, select 0 or 1 from the ORIGIN drop-down

list. You can also set this variable locally or globally using a definition in

the worksheet.

IMPORTANT! For the examples used in this training, the array

ORIGIN is equal to 1.

A range variable and a vector may look similar, but they are two distinct

quantities and Mathcad treats them differently.

Some differences to consider:

A range variable is evaluated as a sequence of values, one at a time. A

vector or matrix evaluates all values simultaneously.

It is not possible to extract a single element from a range. It is always

possible to extract a single element from a vector or matrix.

Module 8 | Page 2

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

matrix is used to store and access information.

2013 PTC

Module 8 | Page 3

Scenario

Change the array ORIGIN both globally and locally.

Task 1:

select 0 or 1 from the ORIGIN

drop-down list.

Task 2:

al

rn

operator.

capital letters) in the worksheet

se

nl

by default.

In

te

operators by selecting

the Math tab, clicking

rP

TC

, and

Operators

selecting the desired

operator.

Fo

in the placeholder and click

outside of the region.

This reassigns the

array ORIGIN from the

insertion point to the

end of the worksheet.

Module 8 | Page 4

2013 PTC

You can define a vector or matrix in Mathcad using various

methods.

You can define a vector or matrix in

Mathcad by:

nl

Manual entry.

Populating an array

element-by-element.

Using range variables.

rn

al

se

Using Manual Entry

Using Range Variables

In

te

Element-by-Element

rP

TC

Manual entry by selecting the Matrices/Tables tab. In the Matrices and

Fo

Tables group, click Insert Matrix

required.

You can insert a matrix containing up to 144 elements using this method.

Populating a matrix element-by-element by defining each element in the

array.

To populate an array using this method, you must use a matrix subscript

operator

to identify each element. You can locate the Matrix Index

by selecting the Matrices/Tables tab. In the Matrices and Tables group,

click Vector and Matrix Operators

operator.

Populating a matrix using range variables.

Here the definition process is automated by using an iterative variable:

a range variable representing the index.

2013 PTC

Module 8 | Page 5

A scalar.

A string.

An array.

A variable or function that evaluates to a scalar, string, or array.

Fo

rP

TC

In

te

rn

al

se

nl

Module 8 | Page 6

2013 PTC

Scenario

Define a vector or matrix manually, element-by-element, and using range

variables.

Task 1:

nl

operator. Do not remove your

cursor from the math region.

se

U

al

, and

Operators

selecting the desired

operator.

operators by selecting

the Math tab, clicking

In

te

rn

Select the Matrices/Tables

tab.

In the Matrices and Tables

group, click Insert Matrix

Fo

rP

TC

.

Click and drag to select a 3x3

matrix.

three columns appears. Each

element is represented by a

placeholder.

placeholders. To navigate

between placeholders, use the

mouse, use the arrow keys, or

press TAB.

2013 PTC

Module 8 | Page 7

Task 2:

the worksheet.

2. Insert the Matrix Index

operator.

You can also insert

nl

operator by selecting

the Matrices/Tables

tab, clicking Vector

and Matrix Operators

rP

TC

In

operator.

te

rn

al

element in the placeholder as

shown.

se

desired operator.

Fo

array.

Module 8 | Page 8

2013 PTC

Array and inserting the

Evaluation

operator.

nl

Task 3:

In

te

rn

al

se

represent the index of the vector.

The following are some

important guidelines:

The range variable

for the index usually

begins at the origin.

The subscript value

must be integer

valued and take unit

steps most of the

time.

a matrix using this

procedure. The

subscript notation

used is in the form row,

column.

rP

TC

shown, define the elements in

the vector.

Fo

array may depend on

the range variable.

the vector name vector1 and

inserting the Evaluation

operator.

2013 PTC

Module 8 | Page 9

You can extract elements in arrays and use them in functions

and definition statements.

You can extract three types of data

from a matrix or array:

nl

A single element.

An entire column or row.

A subset, or submatrix of data.

rn

al

se

te

In

rP

TC

You can extract elements from arrays and use them in functions and definition

statements.

There are three basic types of data that you can extract from a matrix or array:

Fo

A single element.

An entire column or row.

A subset, or submatrix of data.

You can use the built-in submatrix function to extract a subset of data from an

array. The submatrix function returns the data in a matrix consisting of the

specified number of rows and columns.

Module 8 | Page 10

2013 PTC

Scenario

Extract basic types of data from an array.

Task 1:

nl

te

rn

al

operators using one of

the following methods:

Select the Math

tab, click Operators

se

operator.

Fo

rP

TC

In

required operator.

Select the

Matrices/Tables

tab, click Vector and

Matrix Operators

, and select the

required operator.

Type the shortcut

for the required

operator.

shown, separated by a comma,

in the index placeholder.

Vectors require only

a single subscript

containing the row

index.

operator.

2013 PTC

Module 8 | Page 11

Task 2:

insert the Matrix Column

operator.

index placeholder.

te

operator.

rn

al

Task 3:

se

nl

operator.

rP

TC

In

index placeholder.

operator.

Fo

Task 4:

to which you want to assign the

extracted data, and insert the

Definition

Module 8 | Page 12

operator.

2013 PTC

Select the Matrices/Tables tab.

In the Matrices and Tables group, click Vector and Matrix

.

Functions

Select submatrix.

nl

the Functions tab.

rP

TC

In

te

rn

al

se

arguments as shown. Do not click outside of the math region.

The arguments required for the submatrix function are:

The name of the array that contains the data to extract.

The row to start extracting data.

The row to stop extracting data.

The column to start extracting data.

The column to stop extracting data.

operator to evaluate the

extracted data.

Fo

2013 PTC

Module 8 | Page 13

Nested Arrays

An array may contain an element that is another array.

se

nl

array is called a nested array.

In

te

rn

al

rP

TC

Array

Nested Arrays

Fo

An array may contain elements that are other arrays. An array that is

embedded within another array is called a nested array.

When initially evaluating an array containing a nested array, Mathcad

indicates the nested array using a shorthand notation. This shorthand

indicates the dimensions (rows, columns) of the nested array and encloses

the dimensions in brackets.

Module 8 | Page 14

2013 PTC

Scenario

Display nested arrays by extracting them and by specifying the result format.

Task 1:

se

nl

1. Define the two matrices shown. The matrix Nest is nested in the

matrix P.

al

operator.

In

te

rn

row and column location of the

nested array, 2,2.

rP

TC

operator.

Task 2:

Fo

2013 PTC

Module 8 | Page 15

Select the Matrices/Tables tab.

nl

to de-select it.

Fo

rP

TC

In

te

rn

al

se

Module 8 | Page 16

2013 PTC

You can use vectors and arrays when working with operators

and functions in Mathcad.

You can find operators and functions

used with vectors and arrays:

se

nl

Matrices and Tables group.

You can also find Vector and

Matrix operators on the Math tab.

Operators and Symbols group.

You can also find Vector and Matrix

functions on the Functions tab.

Functions group.

rn

al

Arguments

te

the Vectorization Operator

In

rP

TC

You can use vectors and arrays when working with operators and functions in

Mathcad. You can find operators and functions used with vectors and arrays:

Fo

Matrices and Tables group.

You can also find Vector and Matrix operators on the Math tab.

Operators and Symbols group.

You can also find Vector and Matrix functions on the Functions tab.

Functions group.

Many functions that typically use a scalar argument also accept a vector.

This is termed implicit vectorization, which means passing each element,

one-by-one, to the function as an argument.

When a matrix is passed to the same function for element-by-element

processing, an error often occurs or incorrect answers result as shown on

the slide.

You can use element-by-element processing of a function or operator by

selecting the Vectorization

and Math tabs.

2013 PTC

Module 8 | Page 17

Array Functions

The Vector and Matrix Functions category located in the Matrices and Tables

group on the Matrices/Tables and Functions tabs contains a list of functions

that operate on arrays.

The following functions are useful when working with vectors and matrices:

Fo

rP

TC

In

te

rn

al

se

nl

length Returns the number of elements in a vector.

last Returns the index of the last element in a vector. The number

returned depends on the value of ORIGIN.

max and min Returns the maximum or minimum element in an array.

stack Places the arrays one on top of the other.

augment Places the arrays side-by-side.

Module 8 | Page 18

2013 PTC

Scenario

Use the Vectorization operator.

Task 1:

se

U

arguments, F1(b), as shown.

Press SPACEBAR until the entire

function name highlights.

nl

In

te

rn

al

operator.

Select the Matrices/Tables

tab.

In the Matrices and Tables

group, click Vector and Matrix

.

rP

TC

Operators

Select Vectorization

Fo

Vectorization

operator by one of the

following methods:

Selecting the

Math tab, clicking

,

Operators

and selecting the

Vectorization

operator.

Press CTRL ^ .

2013 PTC

Module 8 | Page 19

operator.

Fo

rP

TC

In

te

rn

al

se

nl

Module 8 | Page 20

2013 PTC

9

y

Module

nl

Units

se

Module Overview

In this module, you learn how to select a unit system and use units in

calculations.

al

Objectives

Fo

rP

TC

In

te

rn

Select a unit system.

Use units in calculations.

Add units to arrays and range variables.

Use angular and temperature units.

2013 PTC

Module 9 | Page 1

Mathcad currently supports three systems of units.

The SI system is the default unit

system for Mathcad. You can modify

this by selecting the Math tab and

selecting the commands in the Units

group.

systems:

nl

CGS

USCS

se

Mathcad currently supports three systems of units.

al

The SI system is the default unit system for Mathcad. Mathcad also supports

the following unit systems:

rn

CGS

USCS

In

te

Every unit system has a set of base dimensions and derived units associated

with it. Mathcad stores all units in terms of the base units for a particular

dimension. Because of this, unit results are initially returned in the base

units for the default system of units.

rP

TC

For example, if you select the SI system as the default unit system:

Length is initially returned in meters, m.

Mass is initially returned in kilograms, kg.

Time is initially returned in seconds, s.

Fo

You can select the default unit system by selecting the Math tab. In the Units

, and select a unit system. Regardless of

group, click Unit System

the unit system selected, you can use units from other systems to define

variables and evaluate results.

Module 9 | Page 2

2013 PTC

Task 1:

2. In the Units group, click Unit System

rn

al

se

nl

all of the evaluated values that have a unit into the new

base unit. Definitions do not change.

Fo

rP

TC

In

te

2013 PTC

Module 9 | Page 3

Using Units

Mathcad enables you to multiply values by built-in units or

custom defined units.

Using Mathcad you can:

Add units to variable definitions.

Change units.

Define a custom unit.

with Units

nl

You can add units to a variable definition by typing them in or by selecting the

se

Math tab. In the Units group, click Units

Mathcad uses the units in calculations and, if possible, simplifies the result

units to a base unit from the default unit system specified for the worksheet.

You can then rescale the results of a calculation in terms of a different unit.

al

Select the Math tab.

rn

1.

2.

te

.

Mathcad redisplays the result in terms of unsimplified base units.

rP

TC

In

units-aware product. The unit checking feature may prevent costly mistakes

in calculations that involve multiple units. Mathcad converts all units to base

units internally. Therefore, you can add or subtract different units from the

same dimension, if the equation is dimensionally correct. If you attempt to

add variables containing units from different dimensions, an error message

appears. If the equation contains any dimensionless or unitless values, they

are treated as though they came from an incompatible dimension.

Fo

Built-in units are predefined variables and you can overwrite them with a

variable of the same name. For example, you can rewrite the built-in unit

m, representing meters, to represent any quantity, but any subsequent

results depending on meters represented by m do not make sense and may

generate an error. To avoid overwriting predefined variables, if you evaluate

the variable you are using, Mathcad evaluates a built-in unit.

Although Mathcad provides an extensive list of built-in units, you can also

use custom units. You can define your own unit if:

Mathcad does not recognize the unit you need.

You want to use a different abbreviation that Mathcad does not recognize.

To create custom units or unit abbreviation definitions, define the custom unit

as a variable at the top of the worksheet or globally. If defined at the top, you

can use a custom unit or unit abbreviation just like a built-in unit anywhere to

the right or below where it is defined to rescale results.

Module 9 | Page 4

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

Once defined, you can use the custom units the same way you use built-in

units, but they do not display in the Units group.

2013 PTC

Module 9 | Page 5

Task 1:

worksheet and type the variable

name mass.

nl

Select Definition

operator.

Select the Math tab.

In the Operators and Symbols

U

al

rn

operators by selecting

the Math tab, clicking

the appropriate group,

and selecting the

desired operator or

symbol.

se

te

In

operator.

Fo

rP

TC

Mathcad does

not require the

Multiplication operator

when using units.

You can use implied

multiplication.

In the Units group, click Units

.

Select the kg unit.

You can also type

a unit directly in the

worksheet.

Module 9 | Page 6

2013 PTC

Task 2:

Change units.

defined in the previous task.

2. Click to the right of the equation.

Press BACKSPACE until the kg

unit is deleted.

nl

O

se

U

te

Task 3:

rn

al

The abbreviation

lb refers to pound

mass, while lbf is the

abbreviation for pound

force.

the Units group. Click outside

of the region. Mathcad rescales

and redisplays the result. This

result is now locked and will not

be rescaled if the unit system

changes.

rP

TC

In

worksheet and type the unit

variable name cfs.

Fo

operator.

A custom unit can

also be defined

globally by inserting

the Global Definition

operator.

as shown and click outside of the

region. The custom unit must

contain one of Mathcad's built-in

units.

2013 PTC

Module 9 | Page 7

you have just typed, select the

variable name cfs.

5. In the ribbon, select the Math

tab.

6. Click Labels

group.

list.

se

nl

unit to the right or below

where it is defined

in the worksheet to

rescale results.

al

appear in the Units

group.

Fo

rP

TC

In

te

rn

Module 9 | Page 8

2013 PTC

Mathcad enables you to add units to arrays and range variables.

In Mathcad you can add units to:

nl

Arrays.

Range variables.

se

with Units

rn

al

Definition with Units

te

You can add units to array elements and range variables.

In

rP

TC

Add a unit to the entire array.

Fo

When adding units to range variables, you should add the unit to each

element in the range variable definition. A dimensioned range variable must

always specify the second value in the range in the appropriate dimension,

even if the step size is equal to one. If this is not specified, an error message

appears.

2013 PTC

Module 9 | Page 9

Variables

Task 1:

worksheet and type the variable

name Shear.

nl

O

se

Select Definition

operator.

Select the Math tab.

In the Operators and Symbols

al

te

rn

, and

Operators

selecting the desired

operator.

operators by selecting

the Math tab, clicking

rP

TC

In

placeholder.

Select the Matrices/Tables

tab.

In the Matrices and Tables

group, click Insert Matrix

Fo

.

Click the cursor and drag to

highlight a 5x1 matrix and

release. A 5x1 matrix of blank

placeholders appears in the

original placeholder for the

variable.

Module 9 | Page 10

2013 PTC

nl

placeholders. Press SPACEBAR

to highlight the entire matrix.

operator.

, and

te

Task 2:

rn

al

selecting kip.

se

insert it by selecting the Math

Fo

rP

TC

In

shown.

matrix element and multiply by

the unit shown.

Elements of an array

can be from different

systems. Mathcad also

supports arrays with

mixed dimensions.

2013 PTC

Module 9 | Page 11

Task 3:

and insert the Definition

operator.

2. Complete the following:

nl

operator.

Type psi in the placeholder.

Press COMMA. Two placeholders and the range variable operator

appear.

se

operator.

Type psi in the placeholder.

In

te

rn

al

operator.

Type psi in the placeholder.

Fo

rP

TC

type the variable name Press

and press =.

The variable is

evaluated in the default

units for the worksheet.

You can then change

these to the desired

unit, as shown.

Module 9 | Page 12

2013 PTC

Mathcad assumes that values provided for functions requiring

an angular argument are in radians.

You must specify degrees when

using them in Mathcad.

nl

se

te

rn

al

argument are in radians. If you use a number or a variable as a function

argument without a unit associated to it, the function uses that argument as if

it is in radians. If you use degrees, you must specify them. The number or

variable that you use as the argument must have degrees in the definition.

Fo

rP

TC

In

radians. You can then edit the result and use degrees as the unit.

2013 PTC

Module 9 | Page 13

Temperature units do not follow a typical multiplicative

relationship with other temperature units.

Mathcad supports the following temperature units:

nl

Kelvin.

Rankine.

Degrees Fahrenheit.

Change in degrees Fahrenheit.

Degrees Celsius.

Change in degrees Celsius.

se

rn

al

return results that have the quantity temperature associated with them. The

most common temperature scales are Fahrenheit and Celsius. In Mathcad,

these temperature units do not follow a typical multiplicative relationship with

other temperature units. These scales have a multiplicative factor and an

additive constant in the transformation. Kelvin and Rankine temperatures are

related in the usual multiplicative manner.

te

convert results when finding the difference between two temperatures.

rP

TC

In

Fo

converted internally to degrees K, the default temperature unit. The resulting

difference was then evaluated as 0 K. When 0 K is then converted to

Fahrenheit, the result is -459.67. Degrees are measured against the

absolute zero while a change in degrees represents the change between

two temperatures.

Temperature differences are also required when you add two temperatures,

because doing so implies a change from the current temperature.

Module 9 | Page 14

2013 PTC

Task 1:

type the variable name Temp.

nl

Select Definition

operator.

Select the Math tab.

In the Operators and Symbols

rn

al

, and

Operators

selecting the desired

operator.

se

operators by selecting

the Math tab, clicking

In

te

rP

TC

unit.

Select the Math tab.

In the Units group, click Units

Fo

.

Select F.

by selecting the Math

tab, clicking Units

, and selecting

the desired unit. Use

implied multiplication

when defining units.

You can insert a

degrees Celsius

temperature unit using

the same method.

2013 PTC

Module 9 | Page 15

Task 2:

degrees Kelvin or Rankine.

temperature variable using

Kelvin as shown.

nl

containing the temperature

evaluation to the right of the K.

Press BACKSPACE until the K

is deleted.

te

rn

temperature unit as shown.

Press .

al

Task 3:

se

unit and click outside of the

region to evaluate.

operator.

rP

TC

Multiplication

In

Fo

4. Click to the right of the K and press BACKSPACE until the K is deleted.

Insert a F temperature unit. Click outside of the region to evaluate.

Module 9 | Page 16

2013 PTC

10

y

Module

nl

2-D Plotting

se

Module Overview

In this module, you learn how to plot data and functions on a 2-D plot.

Objectives

Fo

rP

TC

In

te

rn

al

Plot data in 2-D.

Plot functions in 2-D.

Format a 2-D plot and axes.

Use units with 2-D plots.

2013 PTC

Module 10 | Page 1

You can plot data stored in vectors on 2-D plots.

2-D plots of data in Mathcad have

the following properties:

nl

default.

A simple legend is shown along

the vertical y-axis.

Axes limits are automatically

selected based on the properties

of the data set.

Both axes are automatically

partitioned and numbered.

rP

TC

In

te

rn

al

se

Fo

You can plot data stored in vectors on 2-D plots. When plotting vectors of

data, you must store the data to be plotted in two vectors of equal length. The

data must be free of strings or variables, and functions which do not equal

scalar quantities. For large vectors, you can determine the number of rows

using the built-in rows function.

You can create vectors by:

Manually typing them in.

Using a function or a range variable.

Importing them from a data source, such as Microsoft Excel.

Once plotted, the graphs have the following properties:

They are plotted as a line plot by default.

A simple legend is shown along the vertical y-axis.

Axes limits are automatically selected based on the properties of the data

set.

Both axes are automatically partitioned and numbered.

Module 10 | Page 2

2013 PTC

Task 1:

y, as shown.

nl

Select the Plots tab.

In the Traces group, click

rn

al

Select XY Plot

. A blank

plot region appears.

se

Insert Plot

Fo

rP

TC

In

te

and type x in the x-axis

placeholder as shown. Click

outside of the plot region to

display the plot.

2013 PTC

Module 10 | Page 3

Task 2:

nl

rn

al

.

Symbol

Select x.

In the Styles group, click Line

se

Select the Plots tab.

In the Styles group, click

In

te

.

Style

Select (none). The data

displays as data points.

Fo

rP

TC

Module 10 | Page 4

2013 PTC

You can plot functions of a single independent variable on 2-D

plots.

In Mathcad you can plot:

User-defined functions.

Built-in functions.

A quickplot.

te

rn

al

se

nl

rP

TC

In

Mathcad you can plot:

User-defined functions.

Built-in functions.

A quickplot.

Quickplots have the following properties:

Fo

The horizontal axis must be populated with the independent variable, not

previously defined.

The plot is made over a default domain of 10 to 10, if possible.

2013 PTC

Module 10 | Page 5

Task 1:

function, select an

independent variable

that you have not

previously used in the

worksheet.

se

Insert Plot

nl

Select the Plots tab.

In the Traces group, click

rn

al

Select XY Plot

. A blank

plot region appears.

Fo

rP

TC

In

te

arguments, Plot(x), in the

vertical axis placeholder. Type

the independent variable, x, in

the horizontal axis placeholder.

Click outside of the plot region to

display the plot.

Task 2:

specifies the plot domain.

For a smooth plot, the

second value specified

must create a small

step.

Module 10 | Page 6

2013 PTC

nl

Task 3:

Type the function name and

arguments, Plot(x), in the

vertical axis placeholder. Type

the independent variable, x, in

the horizontal axis placeholder.

Click outside of the plot region to

display the plot.

rn

al

se

BACKSPACE until the number

deletes, as shown.

In

te

placeholder. Click outside of the

plot region to display the plot.

Fo

rP

TC

the remaining axis

limits using the same

procedure.

2013 PTC

Module 10 | Page 7

Mathcad provides several options for formatting a 2-D plot.

Plot formatting features in Mathcad

include:

se

nl

Adding horizontal markers.

rn

al

There are many formatting features available for 2-D plots in Mathcad.

Features discussed here are:

Fo

rP

TC

In

te

This feature adds vertical lines to a plot at specified locations.

Adding horizontal markers.

This feature adds horizontal lines to a plot at specified locations.

Module 10 | Page 8

2013 PTC

Task 1:

function, select an

independent variable

that you have not

previously used in the

worksheet.

nl

Select the Plots tab.

In the Traces group, click

rn

al

Select XY Plot

. A blank

plot region appears.

se

Insert Plot

Fo

rP

TC

In

te

arguments, Plot(x), in the

vertical axis placeholder. Type

the independent variable, x, in

the horizontal axis placeholder.

Click outside of the plot region to

display the plot.

Task 2:

region.

2. Insert a vertical marker.

Select the Plots tab.

In the Markers group, click

. A

Add Vertical Marker

vertical marker appears on the

plot.

2013 PTC

Module 10 | Page 9

callout and press BACKSPACE

to delete the number. Type 6

in the callout and click outside

of the plot region. The marker

moves to the location specified.

se

Select the Plots tab.

nl

marker by placing the

cursor over the marker.

The cursor changes

to a double-headed

arrow. Click the

marker and drag it

to the desired location.

. The marker is

al

deleted.

Fo

rP

TC

In

te

rn

Module 10 | Page 10

2013 PTC

Mathcad enables you to plot multiple traces on a single plot.

Once plotted, you can individually

format each trace. Formatting

options include:

nl

Line type, weight, and color.

Trace type.

se

rP

TC

In

te

rn

Symbol style

Symbol weight

Line type

Line weight

Color

Trace type (line, points, bar)

Fo

al

Mathcad enables you to plot multiple traces on a single plot. Once plotted,

you can individually format each trace. Formatting options include:

2013 PTC

Module 10 | Page 11

Task 1:

nl

y2(x), and the independent

variable, x, shown.

se

te

rn

Select XY Plot

. A blank

plot region appears.

al

Insert Plot

Select the Plots tab.

In the Traces group, click

In

placeholder.

rP

TC

4. Add a trace.

Click in the vertical axis

placeholder.

Select the Plots tab.

In the Traces group, click Add

Fo

. A second vertical

Trace

axis placeholder appears.

placeholder and type y2(x) in the

second vertical axis placeholder,

as shown.

Module 10 | Page 12

2013 PTC

Task 2:

Format a trace.

expression, y1(x). Any formatting

selections will be applied to this

trace.

Click Symbol

select x.

Select the Plots tab.

In the Styles group, make the

following selections:

select (none).

nl

, and

Fo

rP

TC

In

te

rn

al

Trace Color and Trace

Thickness.

se

, and

2013 PTC

Module 10 | Page 13

Mathcad provides many options to format axes on a 2-D plot.

The formatting options available for

the 2-D plot axes include:

nl

Axes Formatting

Log scale

Cross axes at 0,0

Tick marks

Tick mark values

Axis expressions

rP

TC

In

te

rn

al

se

Fo

Mathcad provides many options to format axes on a 2-D plot. The formatting

options available for the 2-D plot axes include:

Axes Formatting

Log scale Plot using a logarithmic scale.

Cross axes at 0,0.

Tick marks Add or remove tick marks from the axes.

Tick mark values Add or remove values from the tick marks on the

axes.

Axis expressions Add or remove the axes expressions.

Mathcad also provides a feature that enables you to change the displayed

format and precision of the axis limits and markings. The options available

are:

General

Decimal

Module 10 | Page 14

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

Scientific

Engineering

Percent

2013 PTC

Module 10 | Page 15

Task 1:

nl

y2(x), and the independent

variable, x, shown.

se

te

rn

Select XY Plot

. A blank

plot region appears.

al

Insert Plot

Select the Plots tab.

In the Traces group, click

In

placeholder.

rP

TC

4. Add a trace.

Click in the vertical axis

placeholder.

Select the Plots tab.

In the Traces group, click Add

Fo

. A second vertical

Trace

axis placeholder appears.

placeholder and type y2(x) in the

second vertical axis placeholder,

as shown. Click outside of the

plot region to display the plot.

Module 10 | Page 16

2013 PTC

nl

O

se

al

and last tick marks. Editing the

second tick mark changes the

numbering interval for the axis.

To edit the tick marks:

Click to the right of the 0 on the

x-axis. The first, second, and

last values on the axis change

to black, indicating that you

can edit them.

Press BACKSPACE to delete

the 0 and type 1.0.

Repeat for the second and

last value. Type 1.5 to replace

the second value. Type 5.0 to

replace the last value.

Click outside of the plot region

to display the plot.

Task 2:

rP

TC

In

te

rn

Cursor over the y-axis.

The cursor changes to a

double-headed arrow.

Click the cursor and drag it to

a new location.

Fo

2013 PTC

Module 10 | Page 17

In Mathcad, you can plot a function or data with units.

To plot a function or data with units:

Define the data or function.

Plot the data. Include the units in

the axis expression.

Click outside of the plot region.

te

rn

al

se

nl

In

rP

TC

In Mathcad, you can plot a function or data with units. To plot a function, or

data, with units:

Define the data or function.

Plot the data. Include the units in the axis expression.

Click outside the plot region.

Fo

The tick marks are not associated with units. Only the axis

expressions can have units.

Module 10 | Page 18

2013 PTC

Task 1:

rn

Insert Plot

al

Select the Plots tab.

In the Traces group, click

se

nl

1. Create the data matrices for Shear, in kip, and Position, in ft, as

shown.

rP

TC

In

te

Select XY Plot

. A blank

x-y plot region appears.

Fo

placeholder. Type Position in

the x-axis placeholder. Click

outside of the plot region.

2013 PTC

in the plot arguments,

the data is plotted

using default units.

Module 10 | Page 19

Task 2:

the N in the y-axis placeholder.

2. Press BACKSPACE to delete the

N. Type kip in the placeholder.

3. Place the cursor to the right of

the m in the x-axis placeholder.

nl

m. Type ft in the placeholder.

Click outside of the region.

Fo

rP

TC

In

te

rn

al

se

Module 10 | Page 20

2013 PTC

11

y

Module

nl

Project Day 1

se

Module Overview

Using Mathcad and the skills that you have learned so far complete one of

the projects in this module.

al

Objectives

Fo

rP

TC

In

te

rn

Define variables.

Create and evaluate equations.

Use operators.

Define range variables.

Create and use matrices.

Create a 2D plot.

2013 PTC

Module 11 | Page 1

In this project, you analyze a simply supported beam.

5.

nl

O

Figure 1 Beam Section

rP

TC

In

te

6.

se

4.

3.

al

2.

slope, and deflection at the

supports.

Input the deflection equation

for the deflection along the

length of the beam.

Differentiate the deflection

equation to derive the equation

for slope, moment, and shear.

Plot the deflection, slope,

moment, and shear.

Calculate the average shear

stress at the intersection

between the flange and the

web at the location of maximum

shear.

Format the Mathcad document

with headers and footers.

rn

1.

steps:

Fo

In this project, you analyze a simply supported beam. The beam section is a

914x305x201 I beam and has the following properties:

t=20.2 mm

h=903.3 mm

b=303.3 mm

s= 15.1 mm

Ix=325253 cm4

E=120 kN/mm2

The beam is a simply supported beam with the following dimensions and load:

L=15 m

a= 5 m

W=18 kN

Module 11 | Page 2

2013 PTC

1.

2.

3.

4.

5.

Fo

rP

TC

In

te

rn

al

se

nl

6.

Input the deflection equation for the deflection along the length of the

beam.

Differentiate the deflection equation to derive the equation for slope,

moment, and shear.

Plot the deflection, slope, moment, and shear.

Calculate the average shear stress at the intersection between the

flange and the web at the location of maximum shear.

Format the Mathcad document with headers and footers.

2013 PTC

Module 11 | Page 3

In this project, you calculate the critical speed of a shaft bearing

with an asymmetrical load, and how the critical speed varies

with load location.

Complete the following exercise

steps:

y

nl

Figure 1 Shaft

In

te

rn

al

3.

4.

2.

calculate the critical speed of

the shaft.

Calculate how the critical

speed varies with load location.

Plot the results.

Format the Mathcad document

with headers and footers.

se

1.

Outer Diameter, D = 10 cm

Inner Diameter, d = 9 cm

Shaft Length, l = 1 m

Fo

rP

TC

In this project, you calculate the critical speed of a shaft bearing with an

asymmetrical load, and how the critical speed varies with load location. The

shaft has the following properties:

Mass, M = 10 kg

Load Location, a = 50 cm

Complete the following exercise steps:

1.

2.

3.

4.

Define the variables and calculate the critical speed of the shaft.

Calculate how the critical speed varies with load location.

Plot the results.

Format the Mathcad document with headers and footers.

Module 11 | Page 4

2013 PTC

12

y

Module

nl

3-D Plotting

se

Module Overview

In this module, you learn how to plot data and functions on a 3-D plot.

Objectives

Fo

rP

TC

In

te

rn

al

Plot data in 3-D.

Plot functions in 3-D.

Format a 3-D plot and axes.

2013 PTC

Module 12 | Page 1

You can create 3-D plots from a function of two variables.

The following data types can be

plotted:

nl

A vector-valued function.

In

te

rn

al

se

Figure 2 Vector-Valued

Function Plot

rP

TC

You can create 3-D plots from a function of two variables. The following data

types can be plotted:

Fo

A vector-valued function. The vector-valued function can have either one

or two variables and must contain three elements defining the x, y, and z

coordinates.

When you define a function and graph it in three dimensions, you are creating

a QuickPlot with a default domain of -10 to 10. Once the function is plotted

you can do the following:

Change the plot domain.

Change the trace type.

Check for singularities in the default domain.

Occasionally, the function being plotted has a singularity over the default

domain in both independent variables. When this function is plotted as

a QuickPlot, Mathcad issues an error message. It is not possible to

use range variables to control the domain of the plot. Therefore, the

ranges must be modified.

Module 12 | Page 2

2013 PTC

Task 1:

Select the Plots tab.

In the Traces group, click

nl

Insert Plot

rn

al

S, with no arguments, in the

placeholder. Click outside the

plot to display the surface plot.

se

Select 3D Plot

. A blank

plot region appears.

rP

TC

In

te

A QuickPlot always

appears over the

default domain of

10 to 10 for both

independent variables.

Fo

Task 2:

in task 1.

2. Click the x axis in the axis

selector. The x axis that appears

in both the axis selector and in

the plot is highlighted in blue.

2013 PTC

Module 12 | Page 3

nl

edit them, as shown.

In

Change the default domain to not include any values that cause a

singularity in the plotted function.

rP

TC

Task 3:

te

rn

al

se

the modified plot.

Fo

type the function name, Sing, no

arguments, in the placeholder.

Review the resulting error

message.

Module 12 | Page 4

2013 PTC

axis selector and modify the x

and y axis ranges as follows:

x axis Range from 2 to 5

y axis Range from 3 to 5

nl

view the modified results.

Fo

rP

TC

In

te

rn

al

se

2013 PTC

Module 12 | Page 5

Mathcad provides many options for formatting a 3-D plot.

3-D plot formatting options include:

Appearance.

Axes.

View control.

Suppressing the plot arguments.

se

nl

In

te

rn

al

rP

TC

Mathcad provides many options for formatting a 3-D plot. 3-D plot formatting

options include the following:

Appearance.

Axes.

View Control.

Suppressing the plot arguments.

Fo

Appearance

Appearance options are located on the Plots tab, in the Styles group. These

options enable you to add color to the traces and perform other basic

formatting changes. The following options are available:

Fill options

Line options

Symbol options

Color options

If there is more than one plot in the graph, these options are specific to each

plot. You can fill each plot with its own color, lines, and configure other

options.

You can also define the grid size per trace in the x and y directions by

selecting the number of points in the Traces group.

Module 12 | Page 6

2013 PTC

Axes

Axes options are located on the Plots tab, in the Axes group, and in the plot

region. You can modify the axis tick marks and tick mark values.

To modify a specific axis click the axis using the Axis Selector in the

upper-right corner of the plot. The Editable Axis, located on the right side of

the plot, can then be used to edit the tick mark values.

View Control

nl

To modify the view and orientation of the plot use the View Control located in

the upper-left corner of the plot. The View Control options enable you to spin,

pan, zoom, or reset the view of the plot.

se

To clean up the appearance of a 3-D plot, suppress the display of the plot

argument(s) on the bottom of the plot. To toggle the arguments on and off:

Fo

rP

TC

In

te

rn

al

Suppressing the arguments gives a cleaner look to the plot within the

Mathcad document.

2013 PTC

Module 12 | Page 7

You can store data in various formats. The format that is passed

to the 3-D plot operator affects how the plot is rendered.

You can plot data as:

se

nl

An m x n matrix.

rP

TC

In

te

rn

al

Matrix Plot

Fo

You can store data in various formats. The format that is passed to the 3-D

plot operator affects how the plot is rendered.

You can plot data as:

A three column matrix. The three columns in the matrix represent the x,

y, and z coordinates.

An m x n matrix. Mathcad plots each element as an elevation in the z-axis

versus its respective row, x-axis, and column, y-axis, index.

Module 12 | Page 8

2013 PTC

Task 1:

nl

Select the Plots tab.

In the Traces group, click

se

Insert Plot

al

Select 3D Plot

. A blank

plot region appears.

Fo

rP

TC

In

te

rn

placeholder. Click outside the

plot to display the data plot.

Each column in the matrix represents the x, y, and z coordinates.

Each row represents one point.

The points are formatted to appear larger than the default. Click in

the plot region and you can format this as follows:

Select the Plots tab.

.

In the Styles group, click Trace Thickness

Select the thickness required to display the data points.

2013 PTC

Module 12 | Page 9

Task 2:

nl

O

se

Insert Plot

Select the Plots tab.

In the Traces group, click

al

Select 3D Plot

. A blank

plot region appears.

rP

TC

In

te

rn

Type the matrix name MM in

the placeholder. Click outside

the plot to display the data plot.

To format the plot click in the

plot region and select the

Plots tab.

In the Styles group, click

Fo

Symbol

circular dot.

In the Styles group, click Line

and select (none).

Style

trace thickness for

better visibility.

4. Review the plot. Note that each point is plotted as an elevation in the

z-axis versus its respective row, x-axis, and column, y-axis, index.

This completes the procedure.

Module 12 | Page 10

2013 PTC

You can plot multiple traces on a single plot.

se

nl

existing plot.

al

rn

te

You can plot multiple traces on a single plot, or add traces to an existing plot.

Fo

rP

TC

In

By default, the second trace appears as the same type as the first. You can

then modify each plot to the appropriate type.

2013 PTC

Module 12 | Page 11

Task 1:

nl

O

se

Insert Plot

Select the Plots tab.

In the Traces group, click

te

rn

P, with no arguments, in the

placeholder.

al

Select 3D Plot

. A blank

plot region appears.

rP

TC

In

Select the Plots tab.

In the Traces group, click

Fo

. A second

Add Trace

placeholder appears.

Type the function name only,

Q, with no arguments, in the

placeholder. Click outside

the plot to display the surface

plots.

A QuickPlot always

appears over the

default domain of

10 to 10 for both

independent variables.

Module 12 | Page 12

2013 PTC

Task 2:

Click in the plot region and select the first trace, P.

Select the Plots tab.

and select the dot symbol.

and select (none).

se

Select the second trace, Q in the plot region.

Select the Plots tab.

nl

rP

TC

In

te

rn

al

display the plot.

Fo

2013 PTC

Module 12 | Page 13

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 12 | Page 14

2013 PTC

13

y

Module

nl

Boolean Conditions

se

Module Overview

In this module, you learn how to use Boolean operators to create equations,

conditional statements, and Piecewise Continuous functions.

al

Objectives

Fo

rP

TC

In

te

rn

Use Boolean operators.

Use Piecewise Continuous functions.

2013 PTC

Module 13 | Page 1

You can use Boolean operators to evaluate Boolean expressions

and specify constraints in solve blocks.

You can locate Boolean operators by

selecting the Math tab and clicking

Operators

and Symbols group. You can use

them to:

rn

al

se

nl

systems of equations.

Create conditional statements.

Document equations which do not

need to be evaluated.

te

In

rP

TC

You can use Boolean operators to evaluate Boolean expressions and specify

constraints in solve blocks. You can locate Boolean operators by selecting

from the Operators and Symbols

the Math tab and clicking Operators

group. They include Comparison and Logical operators. You can use them to:

Fo

Create conditional statements.

Document equations which do not need to be evaluated.

Module 13 | Page 2

2013 PTC

All equations used inside a solving construct must use Boolean

operators.

The Equal To

operator is

the most commonly used Boolean

operator when solving a system of

equations.

nl

to Operator

se

al

All equations used inside a solving construct must use Boolean operators.

te

rn

The Equal To

operator is the most commonly used Boolean operator

when solving a system of equations. You can use it to express equality

between two sides of an equation. A Boolean Equal To operator appears as

a bold equal sign to distinguish it from the Evaluation operator.

Fo

rP

TC

In

Mathcad does not evaluate equations created with Boolean operators unless

they are used in a Mathcad program or another construct requiring a Boolean

condition. Therefore, it is ideal to use Boolean operators for documenting

equations.

2013 PTC

Module 13 | Page 3

Boolean operators, unlike other operators, can only return a

zero or one.

Mathcad returns the following results

for a conditional statement:

nl

Boolean operator is true, the

Boolean operator returns a one.

If the expression using the

Boolean operator is false, the

Boolean operator returns a zero.

se

al

rn

Boolean operators, unlike other operators, can only return a zero or one. They

are useful in performing tests or comparisons within conditional expressions.

In

te

If the expression using the Boolean operator is true, the Boolean operator

returns a one.

rP

TC

If the expression using the Boolean operator is false, the Boolean operator

returns a zero.

Boolean expressions are those whose results are either true or false. For

example, 1 > 2 is Boolean because its value is false, represented as a 0 in

Mathcad. The Boolean operators enable you to set up expressions, which

you can evaluate like any other Mathcad expression.

Fo

You can use Boolean operators to write functions that are not uniform over a

range. You can then integrate and differentiate these functions.

Module 13 | Page 4

2013 PTC

A function that is not uniform over its range is known as a

Piecewise function.

To create Piecewise Continuous

functions using Boolean operators:

nl

which the function is to be

evaluated.

Define the function using Boolean

operators.

Graph the function to validate the

results.

rP

TC

In

te

rn

al

se

Function

Function Graph

Fo

A function that is not uniform over its range is known as a Piecewise function.

Mathcad has six Piecewise Continuous built-in functions.

To create Piecewise Continuous functions using Boolean operators:

Define a range of values over which the function is to be evaluated.

Define the function using Boolean operators.

Graph the function to validate the results.

2013 PTC

Module 13 | Page 5

Task 1:

function.

which you will evaluate the

function.

nl

operators or constants

by selecting the Math

tab. In the Operators

and Symbols group,

select the desired

operator or constant.

U

al

te

rn

insert functions in the

worksheet by selecting

the Functions tab. In

the Functions group,

click All Functions

se

use in the Piecewise Continuous

function.

rP

TC

In

. Expand the

appropriate group,

and select the desired

function.

Fo

function.

Type the function name and

arguments g(x).

Insert the Definition

operator.

Insert the if function.

Select the Functions tab.

In the Functions group, click

.

All Functions

Expand the Piecewise

Continuous group, and

select the if function.

4. Complete the placeholders as

shown.

Module 13 | Page 6

2013 PTC

to validate.

nl

for the g(x) trace to

make identification

clearer.

Fo

rP

TC

In

te

rn

al

se

2013 PTC

Module 13 | Page 7

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 13 | Page 8

2013 PTC

14

y

Module

nl

Symbolics

se

Module Overview

Objectives

Fo

rP

TC

In

te

rn

al

Use symbolic calculation features.

Use symbolic algebra.

2013 PTC

Module 14 | Page 1

Symbolics

Mathcad can perform operations on symbolic expressions,

expressions that contain variables or mathematical symbols,

and return results in symbolic form.

You can perform symbolic

calculations on:

Variables

Functions

nl

results in terms of:

Undefined variables and functions.

se

al

rn

Symbolics

rP

TC

In

te

All the calculations shown in Mathcad to this point have been numeric.

Numeric calculations require that all variables and functions involved be

defined to the left or above where the calculation is made. They always

return answers in terms of floating point numbers. Numeric calculations

rely on built-in algorithms and tolerances to perform calculations quickly

and accurately.

Mathcad can also perform operations on symbolic expressions, expressions

that contain variables or mathematical symbols, and return results in symbolic

form.

Fo

may or may not be defined in the worksheet. They can also return results in

terms of floating point numbers, or undefined variables and functions. They

also may reveal relationships among variables that may not be apparent

from numeric results.

Symbolic evaluations are performed by clicking the Symbolic Evaluation

expressions containing Mathcad operators, including integrals, derivatives,

matrix operations (most matrix functions), summations, and products.

Mathcad simplifies the expression by performing arithmetic and combining

like terms. If the variables used in the expressions have an assigned value

you receive a numeric result.

Examples:

Derivatives

Module 14 | Page 2

2013 PTC

Indefinite Integrals

Definite Integrals

Fo

rP

TC

In

te

rn

al

se

nl

answer is exact. Numeric evaluation results in an approximate,

floating point answer.

2013 PTC

Module 14 | Page 3

PROCEDURE - Symbolics

Task 1:

evaluated symbolically, as

shown.

nl

evaluate expressions

that have variables not

assigned to numeric

values.

se

U

rn

.

group, click Symbolics

Select Symbolic Evaluation

al

operator.

Select the Math tab.

In the Operators and Symbols

the expression, as shown. Insert

te

rP

TC

In

The Symbolic

Evaluation operator

can also be inserted

by selecting the Math

tab. In the Operators

and Symbols group,

Fo

click Operators

and select Symbolic

Evaluation

Module 14 | Page 4

2013 PTC

Symbolic Calculation

When you evaluate an expression with the Symbolic Evaluation

operator, Mathcad simplifies the result by performing arithmetic

and combining like variables.

Symbolic keywords provide an

additional level of control over

symbolic evaluation.

nl

se

With Keyword

Symbolic Calculation

te

rn

al

Mathcad simplifies the result by performing arithmetic and combining like

variables. It is a live operator, meaning that if you make a change to the

worksheet anywhere above or to the left of the expression, Mathcad updates

the result automatically. It also uses previously defined functions and

variables to reduce expressions where appropriate.

rP

TC

In

To perform more complex symbolic operations, you can insert a keyword that

specifies the operation before the symbolic equals sign. Symbolic keywords,

located in the Operators and Symbols group, Symbolic section, provide an

additional level of control over symbolic evaluation.

Evaluating a definite integral, using the Symbolic Evaluation operator, results

in a symbolic expression as shown in Figure 1.

Fo

You can have the result appear as a floating point approximation by using the

keyword float as shown in Figure 2.

When you apply a keyword to an expression containing a variable that has an

assigned value, Mathcad first replaces the variable with its value and then

applies the keyword. If you do not want Mathcad to substitute the assigned

value of a variable before applying the keyword you can use one of the

following clear functions:

clear(x,y,..) Clears variables both symbolically and numerically.

clearsym(x,y,...) Clears variables symbolically but not numerically. The

subscript sym is a literal subscript.

2013 PTC

Module 14 | Page 5

Task 1:

symbolically evaluated.

nl

the expression. Insert the float

keyword.

Select the Math tab.

In the Operators and Symbols

U

al

rn

keyword by selecting

the Math tab, clicking

se

Select float.

In

te

and

Symbolics

selecting the desired

keyword.

rP

TC

click outside the expression to

evaluate.

Task 2:

to an equation.

Fo

symbolically evaluated.

2. Position the cursor to the right of

the expression. Insert the solve

keyword.

3. Position the cursor to the right of

the solve keyword and type ,xx.

4. Position the cursor to the right

of solve,xx and insert the fully

keyword.

Module 14 | Page 6

2013 PTC

evaluate. The detailed result

shows the value of yy for which

the solution is undefined.

Task 3:

nl

the calculation as shown for

which the intermediate steps are

to be displayed.

2. Position the cursor to the right of the expression and insert the

explicit keyword.

rP

TC

In

te

rn

al

se

variables in an expression with their assigned values,

without performing any other operations. The explicit

command replaces each variable specified with its

assigned value. It does not replace any other variables

with their values, or perform any other numeric or symbolic

calculations on the expression.

Fo

3. Position the cursor to the right of the explicit keyword and type ,a,b,c

and click outside the region to evaluate.

If you evaluate a variable that is defined by an expression

containing other variables with assigned values, explicit

substitutes the expression in terms of the variables, not

their assigned values.

2013 PTC

Module 14 | Page 7

Symbolic Algebra

You can use keywords to algebraically simplify, expand, or

factor expressions.

Mathcad contains the following

algebraic keywords:

simplify

expand

factor

nl

se

Symbolic Algebra

factor expressions.

Fo

rP

TC

In

te

rn

al

common factors, and using basic trignometric and inverse function

identities.

expand Expands all powers and products of sums in an expression.

factor Factors an expression into a product, if the entire expression can

be written as a product.

Module 14 | Page 8

2013 PTC

15

y

Module

nl

Solving

se

Module Overview

al

unknown through large systems of linear, and nonlinear equations, with

multiple unknowns. Mathcad also offers two built-in functions to numerically

and symbolically locate the roots of functions of single independent variables.

rn

Objectives

Fo

rP

TC

In

te

Numerically and symbolically solve for roots of equations.

Numerically and symbolically solve systems of linear equations.

Numerically and symbolically solve systems of nonlinear equations.

2013 PTC

Module 15 | Page 1

Mathcad enables you to numerically and symbolically solve for

the roots of functions of single independent variables.

There are two built-in functions to

numerically solve for the roots of

functions of a single independent

variable.

The root function.

The polyroots function.

nl

by using the solve keyword on the

symbolic key word toolbar.

rn

al

se

te

In

rP

TC

Mathcad enables you to numerically solve for the roots of functions of single

independent variables.

Mathcad offers two built-in functions to numerically locate the roots of

functions of single independent variables:

The root function.

The polyroots function.

Fo

You can use the root function for all types of functions. You can use it in

two formats:

A two-argument case, which uses a guess value to search for the root.

A four-argument case, which uses a range over which to search for the root.

The root function, two-argument case, has the format:

root(f(t),t)

where:

f(t) is the function.

t is the guess value for the root of the function.

You can make a guess by assigning the independent variable before the

function, and using this variable in the function definition. Mathcad attempts

to provide a solution near the guess value. Different guesses may yield

Module 15 | Page 2

2013 PTC

different results, or may return the same result. The results depend on the

guess value and its location with respect to the actual root. It is useful to plot

the functions prior to evaluating the root.

The root function, four-argument case, has the format:

root(f(t),t,A,B)

where:

t is the independent variable of the function.

A and B define the interval in which Mathcad searches for the root.

nl

No guess values are required for this format. The values of the function

at each endpoint of the range must be of opposite sign. This ensures that

there is a root in the range. You can evaluate multiple roots of a function by

giving different boundary conditions.

se

al

rn

polyroots(v)

where:

te

In

rP

TC

Mathcad provides the ability to solve for roots symbolically by selecting the

Math tab. In the Operators and Symbols group click Symbolics

click the solve keyword.

and

Fo

for roots.

The roots are returned in a vector.

No guess value is required.

Results can include complex values.

Results can be in terms of other variables.

The solve keyword is not limited to polynomials.

If an equation has a periodic solution the solve keyword returns a single

value from the set of solutions. To view a detailed solution, add the modifier

fully after the keyword solve, separated by a comma.

2013 PTC

Module 15 | Page 3

Task 1:

To insert any operator, select the Math tab, click Operators

nl

se

independent variable of the

function.

al

Select the Functions tab.

In the Functions group, click

rn

.

Solving

Select root.

In

te

placeholders.

operator to evaluate.

rP

TC

Fo

Task 2:

Select the Functions tab.

In the Functions group, click

.

Solving

Select root.

Module 15 | Page 4

2013 PTC

operator to evaluate.

Task 3:

nl

must be of opposite sign. This ensures that there is a root

in the range. You can evaluate additional roots using a

different range in the function statement.

se

rn

al

shown.

In

te

To insert a

matrix, select the

Matrices/Tables tab,

click Insert Matrix

rP

TC

desired matrix.

Fo

Select the Functions tab.

In the Functions group, click

.

Solving

Select polyroots.

5. Insert the Evaluation

2013 PTC

operator to evaluate.

Module 15 | Page 5

Task 4:

Select the Math tab.

.

Select solve.

In

te

rn

al

se

nl

3. Type ,x after the solve keyword and click outside the region to

evaluate.

Fo

rP

TC

Module 15 | Page 6

2013 PTC

Mathcad provides functions for solving systems of linear

equations with multiple unknowns.

Mathcad can solve a linear system

of equations by:

In

te

rn

al

se

nl

Using a solve block.

rP

TC

Mathcad provides functions for solving systems of linear equations with

multiple unknowns. Mathcad can solve a linear system of equations by:

Fo

Using a solve block.

Mathcad can solve a linear system of equations using the built-in function

lsolve. The system must be written in matrix notation.

The format for the lsolve function is:

lsolve (M,v)

where:

M is the matrix of coefficients for the linear system.

v is the vector of constants for the linear system.

To solve a system of equations using lsolve:

1.

constant matrix.

2013 PTC

Module 15 | Page 7

2.

The numbers used in the function can be real or complex, and the

use of units is supported.

Assign a matrix containing the unknown variables to the function lsolve,

and evaluate the results.

lsolve returns the solution for the linear system of equations written in matrix

form.

Solve Blocks

nl

You can also solve a linear system using a solve block. Using solve blocks

enables you to write the problem using natural mathematical notation, so the

constraints, functions, and initial values are easier to identify, both for you

and for others reading your document.

se

Maximizes and minimizes functions subject to constraints.

Solves systems of ordinary differential equations.

You can numerically evaluate solve blocks, and units are supported within a

solve block.

rn

al

Each solve block includes guess values, a set of constraints, and a solving

function. All solve blocks follow a similar setup. The difference is the function

that you use to close the solve block.

Fo

rP

TC

In

te

The solve block first evaluates the constraints using the guess values to

check for errors and determine the domain of the solution. This can dictate

whether real or complex solutions are returned. If the problem is treated as

real and complex results are encountered during the solution, absolute values

are taken. If the type is complex, complex results are carried out as is. To

find a complex solution, you must provide a complex guess. Mathcad does

not look in the complex plain without a complex guess.

Module 15 | Page 8

2013 PTC

Equations

Scenario

se

In

te

rn

al

form, using a coefficient matrix,

M, and a column matrix of

constants, v.

Task 1:

nl

Numerically solve the following system of linear equations using the built-in

lsolve function and a solve block.

rP

TC

Select the Functions tab.

In the Functions group, click

Fo

.

Solving

Select lsolve.

coefficient matrix, M, and the

column matrix of constants, v, in

the placeholders.

4. Retroactively assign a matrix

containing the unknown variables

to the function lsolve and

evaluate the results.

The Isolve function

enables you to use real

or complex numbers

and supports the use

of units.

2013 PTC

Module 15 | Page 9

Task 2:

This example does not have any constants to define.

nl

worksheet and insert a solve

block.

Select the Math tab.

In the Regions group, click

Fo

rP

TC

In

te

rn

the solve block, type a guess

value for each variable to be

solved, as shown.

al

se

. A solve

Solve Block

block region appears.

Module 15 | Page 10

2013 PTC

the solve block, define the

constraints shown using Boolean

operators.

nl

O

se

U

In

te

rn

al

block, close the solve block by

assigning the unknown variables

to the Find built-in function, as

shown.

The Find built-in function

returns a solution that

satisfies Mathcad's internal

convergence tolerance,

defined by the built-in variable

TOL.

following operators:

Equal To

Greater Than

Greater Than or

Equal To

Less Than

Less Than or Equal

To

rP

TC

solve block in matrix

form.

Fo

Your answer may not

display exactly zero.

This display depends

on the Results setting.

The Results setting is

located in the Results

group on the Math

Formatting tab.

2013 PTC

Module 15 | Page 11

Equations

You can also use a solve block to solve systems of nonlinear

equations.

You can solve nonlinear systems

using the following format for the

solve block:

In

te

rn

al

se

nl

Guess values

Constraint listing

Solution statement

rP

TC

You can also use a solve block to solve systems of nonlinear equations using

the following format for the solve block:

Fo

Guess values

Constraint listing

Solution statement

The solve block returns one solution, even if the system has multiple

solutions. Mathcad uses the guess values as a starting point to find the

solution. Different guesses may yield different solutions.

To find a complex solution, you must provide a complex guess. Mathcad

does not look in the complex plain without a complex guess.

Module 15 | Page 12

2013 PTC

Nonlinear Equations

Task 1:

and functions in the equation set.

This example does not

have any constants to

define.

se

nl

insert a solve block.

Select the Math tab.

In the Regions group, click

Fo

rP

TC

In

te

rn

al

the solve block, type the guess

values, as shown.

. A blank

Solve Block

solve block region appears.

2013 PTC

Module 15 | Page 13

of the solve block, define

the constraints shown, using

Boolean operators.

rP

TC

In

te

rn

that satisfies Mathcad's

internal convergence

tolerance, defined by

the built-in variable

TOL.

al

assigning the unknown variables

to the built-in function Find.

se

nl

following operators:

Equal To

Greater Than

Greater Than or

Equal To

Less Than

Less Than or Equal

To

Fo

Module 15 | Page 14

2013 PTC

Mathcad enables you to solve a system of linear or nonlinear

equations symbolically.

nl

symbolically use the solve keyword.

se

symbolically. To solve a system of equations symbolically use the solve

keyword.

Fo

rP

TC

In

te

rn

al

of the problem. It is much harder to solve a system of equations symbolically

than numerically. Solving systems of equations, inequality equations, or

periodic equations may produce some special results that do not have

meaning when evaluated numerically.

2013 PTC

Module 15 | Page 15

Equations

Task 1:

Select the Matrices/Tables

tab.

In the Matrices and Tables

group, click Insert Matrix

nl

.

Click and drag to select a 2x1

matrix.

Select the Math tab.

se

placeholders.

rn

al

Select solve.

rP

TC

In

te

Fo

a 2x1 matrix as shown.

Module 15 | Page 16

2013 PTC

Tolerance

Mathcad enables you to customize a solve block.

You can customize a solve block by:

tolerance.

Modifying the constraint tolerance.

nl

Constraint Tolerance

se

The Find function attempts to return an answer with an error satisfying the

built-in convergence tolerance, which is 0.001 by default. Mathcad enables

you to change the tolerance as required.

rn

al

Calculation tab. In the Worksheet Setting group, click TOL and select the

tolerance required. To locally modify the convergence tolerance, define it

in the worksheet.

te

rP

TC

In

constraint in a solve block must be met. Mathcad enables you to change the

tolerance as required.

You can globally modify the convergence tolerance by selecting the

Calculation tab. In the Worksheet Setting group, click CTOL and select

the tolerance required. To locally modify the constraint tolerance, define it

in the worksheet.

Fo

Tightening both tolerances may lead to a better solution, but keep in mind that

it may also place an unreasonable expectation on the solver and generate

an error.

2013 PTC

Module 15 | Page 17

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 15 | Page 18

2013 PTC

16

y

Module

nl

Optimization

se

Module Overview

optimization problems.

al

Objectives

Fo

rP

TC

In

te

rn

Solve a constrained optimization problem.

Solve an unconstrained optimization problem.

2013 PTC

Module 16 | Page 1

Constrained Optimization

Constrained optimization in Mathcad requires a solve block

construct because you specify the constraints that the variables

must satisfy.

Constrained optimization requires:

within the optimization.

Guess values for each independent variable.

nl

Define guess values for the variables.

Define the constraints.

To close the solve block, assign a vector of the variables to the function

maximize or minimize.

Evaluate the results.

al

se

rn

Constrained Optimization

te

because you must specify the constraints that the variables must satisfy.

In

rP

TC

within the optimization.

Guess values for each independent variable.

To solve a constrained optimization problem:

Fo

Define guess values for the variables.

Define the constraints.

Inequality constraints, using Boolean operators, are permitted.

To close the solve block, assign a vector of the variables to the function

maximize or minimize.

Note that the objective function used in the maximize or minimize

function is defined outside of the solve block.

Evaluate the results.

After solving a problem, validate that constraints were met and use the

variables selected to solve the problem to evaluate the function.

Module 16 | Page 2

2013 PTC

Task 1:

nl

weight.

In

te

rn

al

. A blank

Solve Block

solve block regions appears.

se

Select the Math tab.

In the Regions group, click

Fo

rP

TC

the solve block, define guess

values for the variables.

2013 PTC

Module 16 | Page 3

nl

solve block, define the deflection,

length, and diameter constraints

shown.

se

U

al

rn

minimize function

by selecting the

Functions tab. In

the Functions group,

solve block by assigning a vector

of the variables shown to the

function minimize.

In

te

,

click Solving

and select minimize.

Fo

rP

TC

evaluate the function.

Module 16 | Page 4

2013 PTC

Unconstrained Optimization

You can solve unconstrained optimization problems in Mathcad

with or without using a solve block.

To solve an unconstrained optimization problem:

Define guess values for each independent variable.

Assign the independent variables to the maximize or minimize function.

Evaluate the function.

nl

Unconstrained Optimization

se

without using a solve block. To solve an unconstrained optimization problem:

In

te

rn

al

Define guess values for each independent variable.

Assign the independent variables to the maximize or minimize function,

depending on the type of optimization.

The maximize and minimize functions return the values of the variables

specified that make the function take on its largest or smallest value

respectively.

Evaluate the function at the point found to determine the maximum or

minimum.

rP

TC

maximum or minimum. Mathcad issues an error message if this occurs. If

possible, it is a best practice to confirm the result with a plot. To view the point

and the function, plot the maximum or minimum point and the function.

Fo

determine the solution, starting at the guess value, and follow the steepest

gradient to find the local max or min.

2013 PTC

Module 16 | Page 5

Task 1:

function).

nl

Select the Math tab.

In the Regions group, click

rn

al

se

. A blank

Solve Block

solve block appears.

Fo

rP

TC

In

te

the solve block, define guess

values for each independent

variable, u and v, as shown.

Module 16 | Page 6

2013 PTC

independent variables u and v

to the maximize function and

evaluate the variables.

You can insert the

maximize function

by selecting the

Functions tab. In

the Functions group,

nl

and

click Solving

select maximize.

block.

rP

TC

Task 2:

In

te

rn

al

se

values and function to determine

the maximum.

Fo

function).

independent variable.

2013 PTC

Module 16 | Page 7

evaluate, as shown.

nl

found to determine the minimum

function value, as shown.

Fo

rP

TC

In

te

rn

al

se

Module 16 | Page 8

2013 PTC

17

y

Module

nl

Differential Equations

se

Module Overview

Objectives

Fo

rP

TC

In

te

rn

al

Solve an ordinary differential equation.

2013 PTC

Module 17 | Page 1

Mathcad can numerically solve ordinary differential equations

using the solve block approach.

Ordinary differential equations

(ODEs) depend on a single

independent variable, usually time, t.

Consider the spring-mass system

shown.

nl

se

al

Mathcad can numerically solve ordinary differential equations using the solve

block approach.

In

te

rn

differential equation. The solution is provided at a sequence of time steps

over a specified finite range of values. Currently, it is not possible to find a

general or symbolic solution to an ordinary differential equation.

Fo

rP

TC

A system of ordinary differential equations.

Differential algebraic equations.

Linear or nonlinear ordinary differential equations.

Higher order systems.

Initial value problems (IVPs).

Boundary value problems (BVPs).

Ordinary differential equations (ODEs) depend on a single independent

variable, usually time, t. Consider the spring-mass system shown.

Where:

The displacement function is x(t).

The forcing function is F(t).

The mass is M.

The spring constant is k.

The damping coefficient is c.

The ODE representing this system is given by the equation shown.

You can insert operators and derivatives by selecting the Math tab, clicking

Operators

Module 17 | Page 2

2013 PTC

You can also write the ODE representing the system by clicking the Prime

operator. Where each prime applied to x represents a derivative with

respect to t.

Fo

rP

TC

In

te

rn

al

se

nl

You can use a solve block to solve an ODE, system of ODEs, or differential

algebraic equations. The setup is the same as the solve block approach

presented in previous modules.

2013 PTC

Module 17 | Page 3

Task 1:

rP

TC

In

te

rn

al

se

nl

c, and forcing function F(t) for the system shown. Units are not

permitted.

Select the Math tab.

In the Regions group, click

Fo

. A blank

Solve Block

solve block region appears.

Module 17 | Page 4

2013 PTC

solve block, define the differential

equation and initial conditions.

nl

O

se

U

Fo

rP

TC

In

te

rn

al

function name only (do not use

arguments) assigned to the

odesolve function.

For an ODE with a single

unknown function, odesolve

requires two arguments and one

optional argument.

The first argument is a

function, or column vector of

functions, as they appear in

the solve block.

The second argument is the

right endpoint of the solution

interval, in this case 20.

The argument of the initial

conditions determines the left

endpoint.

The last argument is

optional. It is the number

of approximating points to use

over the interval.

If the optional argument is

omitted, as it is here, Mathcad

defaults the number of points to

1000.

or prime notation for

the ODE, but Mathcad

requires prime notation

for any initial conditions

of the derivatives.

function, select the

Functions tab, click

Differential Equation

Solving

, and

select odesolve.

Delete any unused

placeholders.

2013 PTC

Module 17 | Page 5

Task 2:

by odesolve. To utilize the solution, you can perform one of the

following steps:

single points shown.

al

se

nl

range of points shown. Define a

range variable, range, and use it

in the function evaluation.

Fo

rP

TC

In

te

rn

3. Plot the function over the solution domain. Define a range variable, t,

as shown, to define the domain of the plot.

Module 17 | Page 6

2013 PTC

18

y

Module

nl

Programming

se

Module Overview

enable you to loop and create conditional statements within a program

structure.

al

Objectives

Fo

rP

TC

In

te

rn

Create a program.

Use conditional statements.

Use looping constructs.

2013 PTC

Module 18 | Page 1

Creating a Program

Mathcad's programming operators enable the extension of

Mathcad's functionality when writing customized functions and

processes for calculations.

You can access Mathcad's programming operators by selecting the Math

.

nl

se

Creating a Program

te

rn

al

a multi-step container for Mathcad program-control operators. You can use

specific programming operators to specify local assignments to variables

or functions, loop over calculations, conditionally evaluate branches, add

breakpoints, trap errors, and return values.

In

the extension of Mathcad's functionality when writing customized functions

and processes for calculations.

rP

TC

tab, and clicking Programming

Fo

For loops.

While loops.

You cannot type in any of these commands from the keyboard; typing "for"

results in an error. Instead, you must use either a keyboard shortcut or insert

the operator.

Mathcad evaluates the sequence of statements in a program in the order

specified by the programming operators and then returns the result of the

last step. Although you can write a program as a series of expressions,

Mathcad enables you to group a calculation using a program and return

only the results you want. You can also incorporate features similar to those

found in other higher-level languages, such as conditional branches, error

handling, and recursive calls.

Module 18 | Page 2

2013 PTC

Task 1:

NewProg(a,b) and insert a

definition operator.

nl

O

se

U

al

Select the Math tab.

In the Operators and Symbols

group, click Programming

name, the arguments

are the variables

passed to the program

from the Mathcad

worksheet. You can

also use a variable

name.

Select Program

rn

.

.

rP

TC

In

te

programming

operators by selecting

the Math tab, clicking

Fo

,

Programming

and selecting the

desired programming

operator.

Task 2:

program started in the previous

task.

In each placeholder,

you can insert:

A local variable or

function definition.

A programming

operator, such as a

for loop.

2013 PTC

Module 18 | Page 3

operator. A left pointing arrow

with two placeholders appears.

nl

O

se

U

al

rn

All assignments

made using the Local

Assignment operator

are local to the program

and are not recognized

outside of the program.

Definitions made

outside and before

the program are not

overwritten inside the

program.

the right placeholder, and the

variable c in the left placeholder.

The expression, a/10, is now

locally assigned to the variable

c. Press SPACEBAR until the

entire expression highlights.

rP

TC

In

te

appears with a placeholder.

operator and type in the

expression shown.

Fo

bottom line highlights. Press

ENTER to add a new line.

To insert a line below

the selected line, place

the cursor to the right

of the line selected. If

it appears to the left

of the line selected,

Mathcad inserts the

line above the selected

line.

Module 18 | Page 4

2013 PTC

Task 3:

nl

O

se

U

rn

al

displays what is returned to the

Mathcad worksheet from the

program. The last line of the

program may contain:

A variable.

An expression.

A function.

A vector or matrix containing

variables or functions as

elements.

In the placeholder, type the

variable d.

the previous task, click in the last

placeholder.

rP

TC

In

te

To return multiple

values from a program,

place the values in a

vector or matrix on the

last line of a program.

Task 4:

Fo

passed to the program.

You can define the

variables before or

after the program

definition, or as

part of the program

evaluation.

including the variables in

parentheses. Insert the

Evaluation

operator.

Click outside of the region to

evaluate.

This completes the procedure.

2013 PTC

Module 18 | Page 5

Conditional Statements

Mathcad provides operators to enable conditional program

branching.

The operators that enable conditional

branching are:

if

else

else if

also if

nl

Conditional Statements

al

if

else

else if

also if

rn

se

operators that enable conditional branching are:

Fo

rP

TC

In

te

They use Boolean conditions to direct a program execution. The Boolean

condition must be a comparison or expression that evaluates to 0 (false) or

1 (true).

Module 18 | Page 6

2013 PTC

Scenario

The program will accept a number sent to the program. If the number is

odd it will return the word True. If the number is even it will return the word

False. A built-in function mod (modulus) is used in this program. The function

mod divides the first argument of the function by the second argument of the

function. The function returns the remainder of this integer division. The

remainder has the same sign as the first argument. Therefore:

nl

mod(x,2) of positive odd numbers is 1.

mod(x,2) of negative odd numbers is -1.

al

including argument, IsOdd(x),

Task 1:

se

Create this program twice, once using only if programming operators and

once using a combination of if and else operators.

rn

operator.

rP

TC

In

te

and insert a program construct.

Select the Math tab.

In the Operators and Symbols

group, click Programming

.

Fo

Select Program

programming

operators by selecting

the Math tab, clicking

Programming

and selecting the

desired operator.

2013 PTC

Module 18 | Page 7

operator and type in the

expression shown.

variable False, click

in the placeholder

and press the double

quotation key (). Type

False.

se

nl

expression highlights. Press

ENTER to create a new line.

Insert the if operator.

al

insert it by selecting the Function tab. In the Functions

te

rn

group, click All Functions

Theory/Combinatorics category and select mod. You can

insert all other operators by selecting the Math tab, clicking

Fo

rP

TC

In

Operators

equal sign (=) is a Boolean operator.

Module 18 | Page 8

2013 PTC

ENTER and type the variable word in the placeholder.

The value returned by the program is the variable on the last line of

the program. In this case, the last line contains the variable word.

al

se

nl

defined by the if statement is true:

Press SPACEBAR until the second line of the if construct

highlights.

Press ENTER as many times as needed to add additional

lines. Mathcad stacks the statements to be executed

below the condition.

rP

TC

Task 2:

In

te

rn

varying inputs, as shown.

including argument, IsOdd(x),

Fo

operator.

2013 PTC

Module 18 | Page 9

and insert a program construct.

Select the Math tab.

In the Operators and Symbols

group, click Programming

.

Select Program

nl

O

se

Programming

and selecting the

desired operator.

operators by selecting

the Math tab, clicking

rn

al

In

te

shown.

rP

TC

if construct highlights. Press

ENTER.

Fo

placeholder.

shown.

Module 18 | Page 10

2013 PTC

varying inputs, as shown.

Fo

rP

TC

In

te

rn

al

se

nl

2013 PTC

Module 18 | Page 11

Looping Constructs

Mathcad looping constructs enable you to iterate any

combination of expressions in a way that is difficult to execute

with range variables or other constructs.

Two program looping constructs are

available:

nl

For loops.

While loops.

rP

TC

In

te

rn

al

se

Construct

Fo

Looping Constructs

A loop is a block of code that causes one or more statements comprising the

body of the loop to iterate until a termination condition occurs. There are

two kinds of loops within Mathcad:

A for loop.

A while loop.

When using these constructs, do not type the words for and while. This does

not produce the operators.

You can use a for loop to iterate a calculation, or set of calculations, a fixed

number of times. The for loop construct contains three placeholders, with

the bottom placeholder indented. On the first line of the construct, the first

placeholder contains an index. The second placeholder contains a range, a

vector, or a list. The symbol shown between the placeholders reads " is an

element of " and is used because the index can be an element of a range, a

vector, or a list of numbers. The second line of the construct, the indented

Module 18 | Page 12

2013 PTC

When multiple placeholders are added within a loop, Mathcad creates a

double vertical black bar within the loop to indicate that the calculations are

part of the loop.

It is possible to nest for loops within one another. When using a nested for

loop to iterate over the rows and columns of an array, be sure that your index

starts at the array origin value for your sheet. Perform a quick check by

evaluating the built-in ORIGIN variable in your worksheet.

nl

Like for loops, you can use while loops to iterate a calculation or set of

calculations. Unlike for loops, while loops repeat based on the evaluation of

a Boolean condition. While a condition is met, the steps contained in the

loop repeat.

se

A while loop has two placeholders, one of which is indented. The placeholder

on the first line of the construct contains a condition that must be satisfied

to execute the statement(s) on the second line of the construct. Like the

conditional placeholder that appears to the right of an if operator, the

conditional placeholder here must also contain an expression or statement

which evaluates to true (1) or false (0). You can use comparative Boolean

operators to form conditional statements.

al

While loops are useful for converging processes. To avoid an infinite loop,

keep in mind that:

In

te

rn

The condition must involve a variable or variables whose values are

changed within the body of the loop; otherwise, the condition would always

remain true or false.

Fo

rP

TC

processing. Click OK to terminate the loop. You can disable evaluation of

the program by modifying the condition in the while loop before executing the

program again.

2013 PTC

Module 18 | Page 13

Task 1:

nl

O

se

U

rn

, and

Programming

selecting the desired operator.

al

and the first lines of the program,

as shown. You can insert

programming operators by

selecting the Math tab, clicking

numbers in the Fibonacci series

are both 1.0. After that, each

element in the series is the sum

of the previous two elements.

Set the origin for your worksheet

equal to 1.0.

Select the Calculation tab.

In the Worksheet Setting

group, click ORIGIN.

Select 1.

In

te

in the program shown:

The equal signs

are comprised of

Fo

rP

TC

the Equal To

operator.

The subscripts are

comprised of the

Matrix Index

operator.

The word return

is a Programming

operator.

Module 18 | Page 14

2013 PTC

se

U

rP

TC

In

te

rn

al

type i in the left placeholder. In

the right placeholder, type the

range 3..n.

nl

program and press ENTER. Click

in the placeholder displayed and

insert the for operator.

type the expression shown.

Fo

operator to create the subscripts.

Press SPACEBAR to highlight

the entire for loop and press

ENTER to add the final program

line.

It is necessary to

highlight the entire

loop; otherwise,

Mathcad adds a line

inside the loop.

2013 PTC

Module 18 | Page 15

last line of the program and

insert the return operator. Type

v with a subscript of n in the

placeholder. Select the Matrix

nl

Index

operator to create

the subscript.

root of a number.

te

rn

and the first two lines of the

program. Add a new line.

al

Task 2:

se

rP

TC

In

operators by selecting

the Math tab, clicking

, and

Operators

selecting the desired

operator.

Fo

and insert a while operator.

second line of the while loop and

press ENTER to add another line

to the while loop construct.

Module 18 | Page 16

2013 PTC

while loop placeholders, as

shown. When you finish, press

SPACEBAR until the while loop

highlights.

rn

al

Note that the program results

compare favorably to the results

from the square root operator.

se

nl

Insert the return operator. Type

rnew in the placeholder.

Fo

rP

TC

In

te

2013 PTC

Module 18 | Page 17

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 18 | Page 18

2013 PTC

19

y

Module

nl

Data Exchange

se

Module Overview

Mathcad enables you to import and export data to and from a worksheet in

a variety of formats.

al

Objectives

Fo

rP

TC

In

te

rn

Import data into Mathcad.

Export data from Mathcad.

2013 PTC

Module 19 | Page 1

Importing Data

Mathcad works with files and functionality from other

applications, such as Excel and Matlab.

There are a variety of methods that

you can use to import data into

Mathcad:

Excel.

Import data.

Import data from Excel.

se

nl

al

rn

Importing Data

In

te

Mathcad works with files and functionality from other applications, such as

Excel and Matlab. There are a variety of methods that you can use to import

data and functionality into Mathcad:

Fo

rP

TC

Copying data into a table creates a local copy of the data within the

Mathcad worksheet. When you use this method, there is no dependency

on an external file and the Mathcad array does not update if you make

changes to the external file.

Import data.

The READFILE function enables you to read data from Excel, delimited

text, and fixed width text files.

Import data from Excel.

The READEXCEL function enables you to read data from Excel.

Module 19 | Page 2

2013 PTC

Task 1:

datastep_07.xlsx, and open the

file.

columns A and B to the clipboard.

te

rn

al

se

nl

Mathcad worksheet and select

Paste. The data is pasted into

Mathcad as a table.

Fo

rP

TC

In

and type A1. Click in the top-right

placeholder and type A2.

2013 PTC

Module 19 | Page 3

nl

Task 2:

a table creates a

local copy of the data

within the Mathcad

worksheet. There is

no dependency on an

external file and the

Mathcad array does

not update if you make

changes to the external

file.

se

al

operator.

Select the Input/Output tab.

.

te

rn

The Browser dialog box appears. Browse to the file

interpolation.prn. Click Open.

rP

TC

In

operator.

Fo

Select the Functions tab.

.

In the Functions group, click File Access

Select the READFILE function.

Complete the first two placeholders as shown. Delete the remaining

placeholders.

The second argument is a string variable with a value that

can be delimited, fixed, or Excel.

Module 19 | Page 4

2013 PTC

Task 3:

nl

te

rn

al

operator.

Select the Input/Output tab.

In the Data Import/Export

group, click READEXCEL

se

data file name and path.

Type in the variable name EX

rP

TC

In

.

The READEXCEL dialog box

appears. Browse to the Excel

file datastep_07.xlsx. Click

Open.

Select rows 1 through 4 and

columns A and B.

Click Insert.

Fo

shown.

2013 PTC

Module 19 | Page 5

Exporting Data

Mathcad supports writing data stored in a vector or matrix to

a data file.

Mathcad provides multiple file output

options for exporting data to a data

file:

Tab delimited text.

Comma separated values.

Microsoft Excel.

nl

Exporting Data

se

Mathcad provides multiple file output options for exporting data to a data file:

Comma separated values.

Microsoft Excel.

Fo

rP

TC

In

te

rn

al

It is critical to store the data you want to output as a vector or matrix and not a

range or sequence of numbers. This file output link is dynamic. Each time

you recalculate the worksheet, Mathcad writes out the vector or matrix again.

This ensures that the output file reflects any changes to the variable.

Module 19 | Page 6

2013 PTC

Task 1:

Mathcad.

nl

operator.

se

the double quotation () key to type the filename as a string variable .

In

te

rn

al

OUT.xlsx, located in your current working directory. To

determine your current working directory, type CWD= in

your Mathcad worksheet.

Fo

rP

TC

directory and open the Excel file

OUT.xlsx.

This file output link is

dynamic. Each time

you recalculate the

worksheet, Mathcad

writes out the vector or

matrix again. This

ensures that the

output file reflects

any changes to the

variable.

2013 PTC

Module 19 | Page 7

An Excel component is an embedded Excel table inserted within

a Mathcad worksheet.

se

nl

exchange of data with an Excel

worksheet.

rn

al

The Excel component enables the exchange of data with an Excel worksheet

embedded as an object in a Mathcad worksheet. Using the Excel component

enables you to exchange data and use Excels functionality.

In

te

You can send values in your worksheet to Excel, use Excel functionality

to manipulate them, and then send new values back to your Mathcad

worksheet, as shown in Figure 1.

rP

TC

The Excel component is a local copy of the spreadsheet. You can save

the data in an Excel component as an external Excel file. There is no

link between the Mathcad Excel component and the saved Excel file. Any

changes made in the Mathcad Excel component are not reflected in the

external file and vice versa.

Fo

insert an Excel component.

Module 19 | Page 8

2013 PTC

Task 1:

nl

se

Excel component.

Select the Input/Output tab.

.

Fo

rP

TC

In

te

rn

al

blank Excel component appears.

2013 PTC

Module 19 | Page 9

expression.

Select the Input/Output tab.

.

Select Insert Input Expression

blank input expression appears.

nl

in the Inputs region of the component and selecting Insert

Input Expression.

se

Fo

rP

TC

In

te

rn

al

Matrix Index

in the subscript location. If you are writing to the first Excel

worksheet you do not have to specify the worksheet name.

The subscript A1 is equivalent to the subscript shown.

Module 19 | Page 10

2013 PTC

Task 2:

Calculate the sum of each row using Excel functionality and return

the results to Mathcad.

invoke in-place activation of the object. The Excel worksheet opens.

2. Type the following:

In the D1 cell, type =SUM(A1:C1).

In the D2 cell, type =SUM(A2:C2).

In the D3 cell, type =SUM(A3:C3).

te

rn

al

se

nl

3. Close the Excel application and return to the Mathcad worksheet. The

additions are listed in the Excel component.

rP

TC

In

expression.

Select the Input/Output tab.

In the Data Import/Export group, click Excel Component

Fo

A blank output expression appears.

2013 PTC

in the Outputs region of the component and selecting Insert

Output Expression.

Module 19 | Page 11

6. Modify the excel subscript by typing D1:D3 as the script variable.

The output expression can also be typed in directly. Use a

In

te

rn

worksheet, below the Excel

component. Type RowSum= to

display the results.

al

se

nl

Matrix Index

in the subscript location.

Fo

rP

TC

Module 19 | Page 12

2013 PTC

20

y

Module

nl

Data Analysis

se

Module Overview

Mathcad supports the analysis of data. Within Mathcad, you can smooth,

interpolate, and regress data.

al

Objectives

Fo

rP

TC

In

te

rn

Smooth data.

Interpolate data.

Regress data.

2013 PTC

Module 20 | Page 1

Data Analysis

Mathcad supports a variety of data analysis options.

The data analysis options supported

in Mathcad include:

nl

Smoothing

Interpolation

Regression

In

te

rn

al

se

rP

TC

Data Analysis

Fo

Smoothing

Kernel

Median

Super

Interpolation

Linear

Cubic Spline

Regression

Linear

Polynomial

General

You can find the applicable built-in functions by selecting the Functions tab.

Most of the functions used in data analysis are listed in one of the following

categories:

Curve Fitting and Smoothing

Module 20 | Page 2

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

Data Analysis

Interpolation and Prediction

2013 PTC

Module 20 | Page 3

Smoothing Data

A data smoother takes a set of data and returns a new set that

contains less noise than the original set; however, it still retains

the basic shape and properties of the original data.

Mathcad provides three smoothing

functions.

se

nl

medsmooth

ksmooth

supsmooth

rP

TC

In

te

rn

al

Smoothing Data

Fo

A data smoother takes a set of data and returns a new set that contains

less noise than the original set; however, it still retains the basic shape and

properties of the original data.

Mathcad provides three smoothing functions.

Function: medsmooth

The median smoothing function (medsmooth) takes a window of data

around a given data point and replaces that point with the median of

the values in the window. This function is the most robust of the three

smoothing functions. It is least likely to be affected by false data points.

Function: ksmooth

The kernel smoothing function (ksmooth) uses a Gaussian kernel to

compute and return local weighted averages of y. This function is most

useful when the data lies along a band of relatively constant width.

Module 20 | Page 4

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

Function: supsmooth

The super smoothing function (supsmooth) uses a local smoother that

returns a localized linear fit. This function is most useful when the data

lies scattered along a band whose width fluctuates. The supsmooth

function adaptively selects different bandwidths for different portions

of the data.

2013 PTC

Module 20 | Page 5

Task 1:

Type in the variable name Smooth and insert a Definition

operator.

Select the Input/Output tab.

se

nl

.

In the Data Import/Export group, click Data Filename

The Browser dialog box appears. Browse to the file smoothdata.prn.

Click Open.

al

te

rn

operator.

Select the Functions tab.

rP

TC

In

.

Select the READFILE function.

Complete the first two placeholders as shown. Delete the remaining

placeholders.

Fo

of the following values: delimited, fixed, or Excel.

operator, extract the first column

of the data and assign it to the

variable X1. Extract the second

column of the data and assign it

to the variable Y1.

Remember to set

ORIGIN equal to 1.

Module 20 | Page 6

2013 PTC

Task 2:

Type Msmooth and insert a Definition

Select the Functions tab.

operator.

nl

Select medsmooth.

Type in the arguments Y1,5 as shown. Delete any unused

placeholders.

te

rn

al

se

points as the original data. The arguments represent the

following:

First argument: A real vector of data, vy.

Second argument: The window size, n. The window size

must be an odd integer less than the number of elements

in the data vector, vy.

Fo

rP

TC

In

smoothed data on an x-y plot.

2013 PTC

Module 20 | Page 7

Task 3:

Type Ksmooth and insert a Definition

Select the Functions tab.

operator.

Select ksmooth.

Type in the arguments X1,Y1,0.1, as shown.

In

te

rn

al

se

nl

points as the original data. The arguments represent the

following:

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Third argument: The bandwidth of the smoothing window

b. Bandwidth is usually set to a few times greater than

the spacing between data points on the x-axis, depending

on the desired degree of smoothing.

Fo

rP

TC

smoothed data on an x-y plot.

Module 20 | Page 8

2013 PTC

Task 4:

Type Ssmooth and insert a Definition

Select the Functions tab.

operator.

Select supsmooth.

Type in the arguments X1,Y1 as shown.

rn

al

se

nl

points as the original data. The arguments represent the

following:

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Fo

rP

TC

In

te

smoothed data on an x-y plot.

2013 PTC

Module 20 | Page 9

Interpolating Data

Interpolation draws lines, or polynomial curves, between data

points to predict values that are not in the data set.

Mathcad supports several types

of interpolation. The following two

types are discussed here:

se

nl

Linear Interpolation

Cubic Spline Interpolation

rP

TC

In

te

rn

al

Interpolation

Interpolating Data

Fo

predict values not in the data set. Interpolation methods attempt to connect

all points, making no effort to describe the data using a set of parameters.

Mathcad supports several types of interpolation. The following two types

are discussed here:

Linear interpolation linterp function.

To find the interpolated value for x, linterp connects the two points

on either side of the x value with a straight line, and returns the

corresponding value of y that lies on the straight line for the given value

of x. You can evaluate the function at a given value of x, or over a range.

Linear interpolation is a straightforward process, but you should note the

following properties:

The resulting curve is not differentiable at any of the known data

values.

Module 20 | Page 10

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

the predict function.

Cubic Spline interpolation cspline function.

You can use cubic spline interpolation to obtain a smooth differentiable

curve where each section is represented by a cubic polynomial of the

form: ax3 + bx2 + cx + d.

You can use cubic splines to create well-behaved, differentiable

functions. Though they are not represented as closed form expressions,

you can use them in many of the same types of mathematical analyses.

Cubic spline interpolation is a two-step process, and involves both the

cspline and interp functions.

Mathcad initially uses the cspline function and requires that the second

derivative at each point is determined by the straight line through

the nearest two points. The output of the cspline function is a vector

containing the values of the second derivative of the desired spline at

each point of x. This vector is then used by the interp function.

The interp function is then used to construct interpolated points from

the output of the cspline function.

2013 PTC

Module 20 | Page 11

Task 1:

interpolation functions.

nl

The Browser dialog box appears. Browse to the file

interpolation.prn. Click Open.

operator.

Select the Input/Output tab.

se

al

In

te

rn

operator.

Select the Functions tab.

rP

TC

.

In the Functions group, click File Access

Select the READFILE function.

Complete the first two placeholders as shown. Delete the remaining

placeholders.

Fo

of the following values: delimited, fixed, or Excel.

operator, extract the first column

of the data and assign it to the

variable X2. Extract the second

column of the data and assign it

to the variable Y2.

Remember to set

ORIGIN equal to 1.

Module 20 | Page 12

2013 PTC

4. Create a range variable, range2. Use the built-in functions min and

max as shown.

Task 2:

nl

operator.

Select the Functions tab.

se

. The Functions

In the Functions group, click All Functions

dialog box appears on the left side of your worksheet.

Expand the Interpolation and Prediction category and select linterp.

Type in the arguments X2,Y2,range2 as shown.

rP

TC

In

te

rn

al

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Third argument: The value of the independent variable at

which you want an interpolated value or range of values.

Fo

interpolated data on an x-y plot.

2013 PTC

Module 20 | Page 13

Task 3:

function cspline.

set of data to be used by the interp function.

Type vs and insert a Definition

Select the Functions tab.

operator.

nl

. The Functions

dialog box appears on the left side of your worksheet.

Expand the Interpolation and Prediction category and select

cspline.

Type in the arguments X2,Y2 as shown.

Fo

rP

TC

In

te

rn

al

se

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Module 20 | Page 14

2013 PTC

Type CSinterp(range2) and insert a Definition

Select the Functions tab.

operator.

. The Functions

dialog box appears on the left side of your worksheet.

Expand the Interpolation and Prediction category and select interp.

Type in the arguments vs,X2,Y2,range2 as shown.

te

rn

al

se

nl

First argument: A vector of spline coefficients returned by

the spline function cspline.

Second argument: A real vector of data, vx, in ascending

order.

Third argument: A real vector of data, vy. The vectors vx

and vy must be the same size.

Fourth argument: The value of the independent variable

at which you want an interpolated value or range of

values.

Fo

rP

TC

In

interpolated data on an x-y plot.

2013 PTC

Module 20 | Page 15

Regressing Data

Parametric, or regression, methods approximate the parameters

of a function to a set of data.

Mathcad supports several types of

regression methods. The following

are discussed here:

se

nl

Linear Regression

Polynomial Regression

rP

TC

In

te

rn

al

Regressing Data

Fo

data. You can predict new points in the data set using the resulting function.

The model may attempt to represent the physics that generated the data, or it

may be a representation of the points in space.

Mathcad supports several types of regression. The following two types are

discussed here:

The line function finds the least squares and best fit line through a set

of x-y data. Least squares regression calculates a final fitted line that

minimizes the distance between each point in the data set and the final

fitted line. The output of the line function is a vector containing the

values of the coefficients for a line of the form, y = mx + b.

Polynomial regression polyfit function.

Polynomial regression fits a polynomial that minimizes the vertical

distance of all data points to a polynomial curve of degree n. You use

Module 20 | Page 16

2013 PTC

Fo

rP

TC

In

te

rn

al

se

nl

polynomial that best approximates the entire set of data.

You can use the polyfitc function to obtain the coefficients of the

regressed function. The output of polyfitc is a vector containing the

polynomial coefficients and other values. You can extract the coefficients

to generate the polynomial.

If only a numerical evaluation is required, use the polyfit function. You

use the polyfit function to construct the regressed points.

2013 PTC

Module 20 | Page 17

Task 1:

regression functions.

operator.

Select the Input/Output tab.

nl

.

In the Data Import/Export group, click Data Filename

The Browser dialog box appears. Browse to the file regression.prn.

Click Open.

se

rn

al

In

te

operator.

Select the Functions tab.

rP

TC

.

In the Functions group, click File Access

Select the READFILE function.

Complete the first two placeholders as shown. Delete the remaining

placeholders.

Fo

of the following values: delimited, fixed, or Excel.

operator, extract the first column

of the data and assign it to the

variable X3. Extract the second

column of the data and assign it

to the variable Y3.

Remember to set

ORIGIN equal to 1.

Module 20 | Page 18

2013 PTC

4. Create a range variable, range3. Use the built-in functions min and

max as shown.

Task 2:

Select the Functions tab.

nl

operator.

se

Select line.

Type in the arguments X3,Y3 as shown.

In

te

rn

al

First argument: A real vector of data, vx.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

rP

TC

y intercept and the slope of the

best fit line for the given data.

Fo

operator, extract the first element

of the vector and assign it to the

variable Int. Extract the second

element of the vector and assign

it to the variable Lslope.

intercept and slope.

2013 PTC

Module 20 | Page 19

polyfit.

se

nl

Task 3:

regressed data on a x-y plot.

Select the Functions tab.

operator.

te

rn

al

. The Functions

dialog box appears on the left side of your worksheet.

Expand the Design of Experiments category and select polyfit.

Type in the arguments X3,Y3,4 as shown.

Fo

rP

TC

In

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Third argument: The order of the regressed polynomial.

regressed data on a x-y plot. Plot

both the R1 and R2 functions

evaluated using the variable

range.

Module 20 | Page 20

2013 PTC

function to a variable P.

Type P and insert a Definition

Select the Functions tab.

operator.

. The Functions

In the Functions group, click All Functions

dialog box appears on the left side of your worksheet.

Expand the Design of Experiments category and select polyfitc.

Type in the arguments X3,Y3,4 as shown.

rn

al

se

nl

First argument: A real vector of data, vx, in ascending

order.

Second argument: A real vector of data, vy. The vectors

vx and vy must be the same size.

Third argument: The order of the regressed polynomial.

rP

TC

In

te

contains the coefficients listed in increasing powers of x, beginning

with the coefficient of x0.

Fo

2013 PTC

Module 20 | Page 21

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 20 | Page 22

2013 PTC

21

y

Module

nl

Project Day 2

se

Module Overview

Use the skills that you have learned so far in Mathcad to complete one of

the projects in this module.

al

Objectives

Fo

rP

TC

In

te

rn

Create a spec table.

Create a program.

Create and use matrices and matrix functions

Import data.

2013 PTC

Module 21 | Page 1

In this project, you import a table of beam sections for the beam

used in the Structural Engineering Day 1 project and select the

sections that satisfies given design criteria.

Complete the following exercise steps:

Import a table of beam sections.

Select sections that satisfy given design criteria.

For the sections that satisfy the given design criteria calculate the

maximum stress.

nl

1.

2.

3.

al

Select sections that satisfy given design criteria.

Maximum allowable deflection: ymax = 4 mm

Maximum width of beam: bmax = 300 mm

For the sections that satisfy the given design criteria calculate the

maximum stress.

Fo

rP

TC

In

3.

te

rn

1.

2.

se

In this project, you import a table of beam sections for the beam used in the

Structural Engineering Day 1 project and select the sections that satisfies

given design criteria.

Module 21 | Page 2

2013 PTC

In this project, you set a threshold limit for the critical speed

and vary the inner and outer diameter of the shaft used in the

Mechanical Engineering Day 1 project.

Complete the following exercise steps:

Set a threshold for the rpm.

Create a spec table varying the inner and outer diameter of the shaft.

Create a program to determine which combination of inner and outer

diameter satisfies the threshold rpm limit.

Plot the thickness of the shaft verses the critical speeds at each

thickness.

se

4.

nl

1.

2.

3.

In this project, you set a threshold limit for the critical speed and vary the

inner and outer diameter of the shaft used in the Mechanical Engineering

Day 1 project.

rn

Fo

rP

TC

4.

te

2.

3.

Rlimit=nc2=1.946x104 rpm

Create a spec table varying the inner and outer diameter of the shaft.

Create a program to determine which combination of inner and outer

diameter satisfies the threshold rpm limit.

Plot the thickness of the shaft verses the critical speeds at each

thickness.

In

1.

al

2013 PTC

Module 21 | Page 3

y

nl

O

se

U

al

rn

te

In

rP

TC

Fo

Module 21 | Page 4

2013 PTC

A

nl

Appendix

se

Module Overview

Fo

rP

TC

In

te

rn

al

this course. The solutions are presented in a step-by-step format.

2013 PTC

Appendix A | Page 1

- Compartir en Facebook, abre una nueva ventanaFacebook
- Compartir en Twitter, abre una nueva ventanaTwitter
- Compartir en LinkedIn, abre una nueva ventanaLinkedIn
- Copiar dirección de enlace en el portapapelesCopiar dirección de enlace
- Compartir por correo electrónico, abre un cliente de correo electrónicoCorreo electrónico