mathcad - chapter 01

Download Mathcad - Chapter 01

Post on 08-Nov-2015

26 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Introduccin al Mathcad

TRANSCRIPT

  • Chapter 1

    An Introduction to MathcadThis chapter is intended to quickly teach you some fundamental Mathcad concepts. We will onlytouch the surface of many Mathcad concepts. In later chapters, we will get into more depth, andbuild on the concepts covered in this chapter. This chapter also teaches techniques to create andedit Mathcad expressions.Chapter 1 will:

    Show how to do simple math in Mathcad.Teach how to assign and display variables.Explain how to create and edit math expressions.Demonstrate how to create and edit math expressions.Demonstrate the editing cursor and the different forms it takes.Discuss the use of operators.Demonstrate how to wrap a math region.Briefly discuss the Mathcad toolbars.Introduce and define math and text regions.Introduce built-in and user-defined functions.Introduce units.Introduce arrays and subscripts.Discuss the variable ORIGIN.Describe the difference between literal and array subscripts.Introduce range variables.Introduce X-Y plots.Encourage completing several Mathcad tutorials.

    BEFORE YOU BEGINIf you don't already have Mathcad installed on your computer, take a few minutes and install theincluded version of Mathcad 14. This is the full unexpiring version of Mathcad. This will allow you tofollow along and practice the concepts discussed in this book. It will also give you access toMathcad Help and Mathcad Tutorials.

    Essential Mathcad is based on the the US version of Mathcad. It is also based on the USkeyboard. There may be slight differences in Mathcad versions sold outside the United States.

    We suggest that you read and do the exercises in the Mathcad tutorial before or just after readingthis chapter. You can open the Mathcad tutorial by clicking Tutorials from the Help menu. Thisopens a new window called the Mathcad Resources window. In this window you will see a list ofMathcad tutorials. Click the Getting Started Primers. each of these primers is excellent. You maychoose to them all, but for the purpose of this chapter, focus on the following topics: Entering MathExpressions, Building Math Expressions, Editing Math Expressions, First Things First, andAdding Text and Images. This chapter cannot replace the experience gained by completing theMathcad tutorials.

    Matchcad BasicsWhenever you open Mathcad, a blank worksheet appears. You can liken this worksheet to a cleansheet of calculation paper waiting for you to put information on it.

    Let's begin with some simple math. Type 5 3 8 . You should get the following:5 3 8

  • Now type 2 3( ) 2 10 . You should get the following:2 3( ) 2 10

    You can also assign variable names to these equations. To assign a value to a variable, type thevariable name and then type the colon : key. For example, type a1:5+3.

    a1 5 3Now type a1=. This evaluates and displays the value of a variable a1.

    a1 8Let's assign another variable. Type b1:(2+3)*2.

    b1 2 3( ) 2Now type b1=. This displays the value of variable b1.

    b1 10Now the values are assigned to variable a1 and variable b1, you can use these variable inequations. Type c1:a1+b1.

    c1 a1 b1Now type c1=. You should get the following result:

    c1 18TIP!! As you begin using variables, it is important to understand the following Mathcadprotocol. In order to use a previously defined variable, the variable must be definedabove or to the left of where it is being used. In other words, Mathcad calculates from leftto right, top to bottom.

    As you can see, Mathcad does not require any programming language to perform simpleoperations. Simply type the equations as you would write them on paper.

    CREATING SIMPLE MATH EXPRESSIONS

    There are two ways to create a simple expression:The first way is to just type as you would say the expression.For example,

    you say 2 plus 5, so you would type 2+5.you say 2 to the 4th power, so you would type 2^4.you say the square root of 100, so you type \100.

    The second way to create a simple expression is to type and operator such as +,-,*,or /. This willcreate empty placeholders (black boxes) that you can then click to fill in the numbers or operands.For example,

    if you press + key anywhere in your worksheet, you will get the following:

    Click on the first placeholder and type 2, then press TAB or click in the second placeholder and

  • type 5. Your expression should now look like this:

    2 5In this example, 2 and 5 are operands of the + operator.

    You can use the procedure with any operator. Let's try the exponent operator. Press ^ to create theexponent operator. You can also click XY on the calculator toolbar. You should have the following:

    Click in the lower placeholder and type 2, then press TAB or click in the upper placeholder andtype 4. Your expression should now look like this:

    24

    These methods of creating expressions work very well for creating simple expressions. As yourexpressions become more complex, there are few things we must learn.

    EDITING LINES

    Creating more complex math expressions is very easy once you learn the concept of the editinglines. These are similar to a two-dimensional cursor with a vertical and a horizontal component.There is a vertical editing line and a horizontal editing line. As an expression gets larger, theediting lines grow larger to contain the expanding expression. Notice how in the previous examplesthe editing lines just contained a single operand. Pressing the spacebar will cause the editing linesto grow to hold more of the expression. For example, if you type 2+5 spacebar, you get thefollowing:

    Whatever is held between the editing lines become the operand for the next operator. So, if youtype 2+5 spacebar^3, you get the following:

    2 5( )3

    In this case (2+5) is the x operand for the operator x to the power of y. Notice how the editing linesnow contain only the number 3. This means that if you type any operator, the number 3 is theoperand for the operator. Thus, if you type +4, you get the following:

    2 5( )3 4

    But, if you press the spacebar first, the editing lines expand to enclose the whole expression. hisexpression becomes the operand for the next operator. Thus, if you now type +4, you get thefollowing:

    2 5( )3 4The whole expression became the operand for the addition operator.

    It is very important to understand this concept of using the editing lines to determine what theoperand is of your next operator. You can also use parenthesis to set the operand for operators.Pressing the single quote ' adds a pair of opposing parentheses.

  • The following example will help reinforce these concepts. Let's create the following expression:

    12

    13

    2

    45

    27

    To create this expression, use the following steps:

    1. Type 1/2 spacebar. The editing lines now hold the fraction 1/2. This becomes the operand forthe subtraction operator.

    2. Type - 1/3 spacebar spacebar. The editing lines should now hold both fractions. This becomesthe operand for the power operator.

    3. Type ^2 spacebar. The editing lines should now hold the entire numerator. This becomes theoperand for the division operator.

    4. Type / \ (or use the square root icon on the math toolbar) 4/5 spacebar spacebar . Thismakes everything under the radical the operand for the addition operator.

    5. Type + 2 / 7. This completes the example.

    Notice how during each step, the spacebar was used to enlarge the editing lines to include theoperand for the following operator.The Mathcad tutorial has additional example that provide worthwhile practice.

    EDITING EXPRESSIONS

    Another important concept to know is how to edit existing expressions. In order to understand this

  • concept, it is important to understand how to move the vertical editing line. This vertical editing linecan be moved left and right using the left and right arrow keys. You can also toggle the verticalediting line from the right side to the left side and back by pressing the INSERT key. Forexpressions that are more complex you can also use the up and down arrows to move both editinglines.

    Selecting Characters

    If you click anywhere in an expression and then press the spacebar, the editing lines expand toinclude more and more of the expression. How the editing lines expand depend on where youbegin and on what side the vertical editing line is on. The editing lines work differently in differentversions of Mathcad. The best way to understand how they work is to experiment and to follow theexamples in the Mathcad tutorial.

    TIP!! I have found that if you begin with the vertical editing line on the right side of thehorizontal editing line, the expansion of the editing lines makes more sense. The generalrule is that as the editing lines expand and cross an operator, the operand for thatoperator is then included within the lines.

    Deleting Characters

    You can delete characters in your expressions by moving the vertical editing line adjacent to thecharacter. If the vertical editing line is to the left of the character, press the DELETE key. If thevertical editing line is to the right of the character press the BACKSPACE key.

    To delete multiple characters, drag-select the portion of the expression you want to delete. If thevertical editing line is to the left of the highlighted area press the DELETE key. If the vertical editingline is to the right of the highlighted area, press the BACKSPACE key.

    Deleting and Replacing OperatorsTo replace an operator, place the editing lines so that the vertical editing line is just to the left ofthe operator. Next, press the DELETE key. This will delete the operator, usually leaving a hollowbox symbol where the operator used to be. Now, type a new operator, and it will replace the boxsymbol. See Figure 1.1.

    You may also have the vertical editin