An Introduction to Mathcad



Similar documents
Lecture 2 Mathcad Basics

Quick Tour of Mathcad and Examples

Summary of important mathematical operations and formulas (from first tutorial):

Excel 2007 Basic knowledge

0 Introduction to Data Analysis Using an Excel Spreadsheet

Years after US Student to Teacher Ratio

MATHEMATICS FOR ENGINEERING BASIC ALGEBRA

Microsoft Excel 2010 Tutorial

Introduction to the TI-Nspire CX

Beginner s Matlab Tutorial

Excel Basics By Tom Peters & Laura Spielman

CATIA Basic Concepts TABLE OF CONTENTS

Basic Formulas in Excel. Why use cell names in formulas instead of actual numbers?

Intro to Excel spreadsheets

This activity will show you how to draw graphs of algebraic functions in Excel.

CAHSEE on Target UC Davis, School and University Partnerships

Excel Tutorial. Bio 150B Excel Tutorial 1

Microsoft Excel 2010 Part 3: Advanced Excel

Quickstart for Desktop Version

Excel Guide for Finite Mathematics and Applied Calculus

ecollege AU Release Notes - ClassLive ClassLive

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

Solving Systems of Equations Using Mathcad Charles Nippert Solving A System of Equations By Symbolically Figure 1 After Step 1

Getting Started with Excel Table of Contents

Mathematical goals. Starting points. Materials required. Time needed

The Center for Teaching, Learning, & Technology

Activity 6 Graphing Linear Equations

Click on the links below to jump directly to the relevant section

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

By Clicking on the Worksheet you are in an active Math Region. In order to insert a text region either go to INSERT -TEXT REGION or simply

VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University

Formulas, Functions and Charts

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

Using Excel (Microsoft Office 2007 Version) for Graphical Analysis of Data

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Q&As: Microsoft Excel 2013: Chapter 2

Maple Quick Start. Introduction. Talking to Maple. Using [ENTER] 3 (2.1)

How to make a line graph using Excel 2007

Grade Level Year Total Points Core Points % At Standard %

This activity will guide you to create formulas and use some of the built-in math functions in EXCEL.

Excel 2003 A Beginners Guide

Year 9 set 1 Mathematics notes, to accompany the 9H book.

Using Casio Graphics Calculators

Graphing Parabolas With Microsoft Excel

Statgraphics Getting started

Formulas & Functions in Microsoft Excel

Excel 2007 A Beginners Guide

Lies My Calculator and Computer Told Me

USING EXCEL ON THE COMPUTER TO FIND THE MEAN AND STANDARD DEVIATION AND TO DO LINEAR REGRESSION ANALYSIS AND GRAPHING TABLE OF CONTENTS

2. Select Point B and rotate it by 15 degrees. A new Point B' appears. 3. Drag each of the three points in turn.

Excel -- Creating Charts

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

Gerrit Stols

Handout: Word 2010 Tips and Shortcuts

SECTION 2-1: OVERVIEW SECTION 2-2: FREQUENCY DISTRIBUTIONS

Microsoft Excel 2013 Tutorial

Preface of Excel Guide

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

GeoGebra. 10 lessons. Gerrit Stols

Microsoft Excel Understanding the Basics

Linear Equations. 5- Day Lesson Plan Unit: Linear Equations Grade Level: Grade 9 Time Span: 50 minute class periods By: Richard Weber

Introductory Handbook for the TI-89 Titanium

Introduction to Microsoft Word 2003

Classroom Tips and Techniques: The Student Precalculus Package - Commands and Tutors. Content of the Precalculus Subpackage

Plotting: Customizing the Graph

PTC Mathcad Prime 3.0 Keyboard Shortcuts

Getting Started on the Computer With Mouseaerobics! Windows XP

IDEAL AND NON-IDEAL GASES

Programming with Mathcad Prime

Solving Rational Equations

Excel Level Two. Introduction. Contents. Exploring Formulas. Entering Formulas

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

ECDL. European Computer Driving Licence. Spreadsheet Software BCS ITQ Level 2. Syllabus Version 5.0

Intermediate PowerPoint

BusinessObjects: General Report Writing for Version 5


Introduction to Microsoft Excel 2010

0.8 Rational Expressions and Equations

10.1. Solving Quadratic Equations. Investigation: Rocket Science CONDENSED

Excel 2007: Basics Learning Guide

EL-9650/9600c/9450/9400 Handbook Vol. 1

Math Common Core Sampler Test

Word Processing programs and their uses

Brief Introduction to Vectors and Matrices

Session 7 Bivariate Data and Analysis

Experiment 1A: Excel Graphing Exercise

Microsoft Word defaults to left justified (aligned) paragraphs. This means that new lines automatically line up with the left margin.

Computer Training Centre University College Cork. Excel 2013 Level 1

Microsoft Excel Tutorial

Review of Fundamental Mathematics

Introduction to Microsoft Excel 2007/2010

LAYOUT OF THE KEYBOARD

Plots, Curve-Fitting, and Data Modeling in Microsoft Excel

Basic Excel Handbook

OA3-10 Patterns in Addition Tables

Windows XP Pro: Basics 1

Creating Custom Crystal Reports Tutorial

EXCEL SPREADSHEET MANUAL

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt

Transcription:

An Introduction to Mathcad Sidney Young; Department of Chemistry; University of South Alabama Mobile AL 36688-0002. syoung@jaguar1.usouthal.edu ; Department of Chemistry; Medical Technology and Physics; Monmouth University; West Long Branch, NJ 07764. tzielins@monmouth.edu Author Ferguson; Department of Chemistry; Worcester State College; Wocester MA 01602-2597 aferguson@worchester.edu by Copyright Sidney H. Young and Theresa Julia Zielinksi, 1996, 1997, 1998, 2000, 2001, 2002. All rights reserved. You are welcome to use this document in your own classes but commercial use is not allowed without the permission of the authors. Why use MATHCAD? MATHCAD is a software program that uses a unique method to manipulate formulas, numbers, text, and graphs. Unlike programming languages, the equations are written as they would appear in a mathematics reference book, against a background screen in which descriptive text may be placed arbitrarily. The equations may be solved analytically or numerically by using functions from a pull-down menu bar. Descriptive text may be placed anywhere inside the document. MATHCAD also produces one-, two-, or three-dimensional plots which may be embedded anywhere in the document. There is also on on-line reference system to assist users. Any document on the screen can be printed out in its entirety on any windows compatible printer. The combination of equations, text, and diagrams in an open-screen environment makes application development easy. Students in particular would benefit from the interactive development of MATHCAD documents for studying various topics in physical chemistry. What version of Mathcad should you use? This depends on the type of computer you have and what you have available. This document was originally written and saved as a Mathcad 6.0+ document. This version was modified using Mathcad 2001i. You can open it with version 2001i and any higher version of Mathcad. Higher versions may have some differences in how higher powered features are performed. Check your manual for individual version differences. page 1

Part I - Preliminary Exercises 1. Begin your MATHCAD session by opening the MathSoft Apps Group in Windows and double clicking on the MATHCAD icon. You may wish to work through the Mathcad Tutorial before you start the set of exercises in this document. Exit the tutorial session before doing this set of exercises. 2. Simple keyboard practice. Notice the structure of a Mathcad page. It is like a white piece of paper. The vertical line marks the right edge of the current page. The area to the right of that line is a separate page. Sample the various pull down menus. Notice how groups of possible actions are grouped together. Entering simple equations onto the MATHCAD page. (Use the space to the right of this text on the screen Enter 16-8/2= Note how the division sign behaves. Pressing = produces the numerical result of the operation. When entering expressions for calculation, do not put in spaces. Mathcad will put them in for you, and if you put them in, Mathcad will think you are entering text, not an expression to be evaluated. To produce (16-8)/2, one should either type the entry with the parentheses included, or type 16-8, highlight the entire operation using the space bar, and then press the division button. What ever is highlighted, i.e. in the blue box, will appear in the numerator. Try this step now. The hierarchy of operator evaluation follows the commonly used standards for computer programing. Powers are followed by multiplication and division, followed by addition and subtraction. Pressing the = evaluates the mathematical sequence and returns the numerical value to the right of the equal sign as you saw above.. To take the power of a function use the carat symbol (Shift-6). Evaluate 4 squared. Practice now with other squares. You can make your practice exercises right here in this document using the pages on the right portion of the screen or print this document and create your own collection of answers to the exercises. Save your file periodically in case of a computer glitch. You can also annotate your document with text regions. This will give you a personalized tutorial document that you can refer to if you forget something you learned here. You can also add sample exercises to your personal document as the semester proceeds. This is important because you may need to refer to techniques from one exercise to the next and you don't want to waste time recreating a technique that was already constructed in your practice file. Most users of Mathcad have a file of techniques that they can refer to for new work. Start you file of techniques today. page 2

3. Variables Variables are easily defined in MATHCAD. If you wish to set x to 10 type x:10. The colon acts as the PASCAL operator :=, which is what you see on the screen. This operation assigns the values 10 to the variable x. Now enter y:= 2*x^2+15. Type only the characters shown in bold This defines y in terms of x. Next evaluate y by typing y= The answer 215 should appear on the screen. Each entry that you typed should lie below the previous one to form a column of expressions. MATHCAD evaluates expressions from top to bottom and left to right on the screen. Sequential entries of equations and data must follow the order for MATHCAD to give the result that you desire. Syntactically incorrect entries will result in various types of MATHCAD error messages. If you want a function y which changes as x is changed, one must use a function definition. The following examples are functions, and you can see that as the variable changes the value of the function changes. Try the following functions and evaluate them at different values of x. y(x):=6+x (Remember that typing the colon button gives := on the screen ) z(x,y):= 3*x+9*y-5 (What is z(1,1)?) Note that x and y above act as dummy variables. page 3

4. Range Variables Some variables act as indices for identifying the elements of arrays of numbers. These are called range variables. They have the form x i where x is the name of a variable and i is an index, also called a step variable. Typically, i ranges from 0 up to any positive integer. For example 0 and 1 in x 0 and x 1 would be two values in the range of the step variable that identifies each element in the array x. x 0 and x 1 are the first two elements in the x array. To define a range variable, one can use the colon and define each member independently. Alternatively, one may use a step variable. The following procedure will define a range of a step variable for an array xx containing the first ten even numbers. Step 1 for the range i:= 0...9 type i:0;9 Step 2 for the array xx i := 2(i+1) type xx[i:=2*(i+1) Notice how the colon acts as the assignment operator, and the semicolon sets the end of the range, so that i ranges from 0 to 9. If one wanted to have a range such as 0, 2, 4, 6, 8, 10, one would type i:=0,2;10. Here the initial value is 0; the 2 tells the program to change the values of i by increments of 2 by telling Mathcad the next integer in the series ending at 10. Range values can also go in descending order by making the second number smaller than the first as in I:=0, -2;-20. We can also use range variables for a noninteger series of numbers. page 4

Type xx = to see how xx is defined at this point. Now extend the definition by typing xx[10:=20 The left bracket [ is used as a subscript operation key for range variables. Type xx = see that the range variable has been extended to include the new value of xx. Type k:1,1.1;2 What do you see? Type k= What are the values for k? How might this be useful? Next try Type xx[12:=24 Type xx[11= Not only has x 12 been defined, but so has x 11 (which has been set to zero.). In this way, range variables may be defined from 0 to the highest index. Do not confuse range variables with subscripts on variable names. Subscripts that are part of a variable name are typed by using a period immediately to the right of the variable name. For example, enter the following: A.ini the result A ini appears on the screen. This is an example of a literal subscript. These are part of the of the variable name. On the other hand an array subscript represents a reference to an array element in a vector or matrix. This distinction is important for work in quantum chemistry. On the right side of the page try creating some range varaiable ranges. How would you create a range variable that extended from 1.0x10^-2 to 1.0x10^2 in increments of 0.002? 5. Graphics MATHCAD has a strong graphics program, which plots range variables against each other or against an index. Suppose we wish to graph x 2 from -2 to +2 by increments of 0.04. This involves 101 points. Set up the range variables for t going from -2 to +2 and define a range variable xsq in which each element is equal to t2. Enter: j: 0;100 t[j: -2+ j/25 xsq[j:t[j^2 note: use the space bar to enclose the t[j in a blue selection box before typing ^2 Now use the graphics pull-down Menu bar and choose XY plot. A square appears on the screen. Click on the black dot at the middle of the vertical axis and enter xsq[j Click on the dot at the middle of the horizontal axis and enter t[j (Other dots are used for manually entering upper and lower limits for the ordinate and abscissa of the graph). It is possible to graph two- and three-dimensional functions. Some of the sample exercises obtained from the WWW show this feature. You will see more of these later. page 5

6. Multiple line graphs. MATHCAD can also be used to prepare multiple line graphs. As an example of this you can prepare two representations of typical potential functions. Enter r.e:1.0 D:100 a: 6/r.e and r:0.5,0.53;3.0 Note what appears on your screen. In the space on the right here type in the following equations. Be very careful. The two equations are the Morse potential and the Leonard Jones 6-12 potential. You can find graphs of these two functions in many physical chemistry texts. V.M(r):D*(1-e^-a*(r-r.e))^2 and V.LJ(r):D*((r.e/r)^12-2*(r.e/r)^6) +D This equation has two parts. Enclose the first part (between the : and the - ) in a blue box before typing the negative sign. These equations make use of the literal subscript concepts. Be careful how you type these onto the MATHCAD page. This time start the graph by pressing the @ symbol below the equations. Enter r in the place holder on the x axis. Enter V.M (r), V.LJ(r) into the y axis place holder. (Yes, use a comma. It is the comma that lets you put two functions on the same graph) The graph will not look very informative as the upper limit on the y axis is too large. Click on the place holder for the upper value of the y axis. The number should become highlighted. Press delete once. Then enter 200 as the new upper limit into the blank place holder. The resulting graph should look familiar. page 6

7. Evaluating mathematical expressions: Mathcad can be used to evaluate expressions. Here we see a calculation of pressure as a function of volume using the van der Waals equation. Notice how the index i is used below to compute a series of volumes. There are two types of subscripts in Mathcad. One is a real index as shown here. It is called a vector subscript and is created by using the [ key followed by the number or the varying index. The other is an index that is part of the name of a variable. This is called a literal subscript and it is created by using the period '.' followed by the letter or number that is to be part of the variable name. We saw this before in previous exercises in this worksheet. Here we will study the PV behavior of a gas with the van der Waals equation. R := 82.05 b := 23.7 T := 4.2 a := 3.41 10 4 First we define the parameters that we will use in the calculation. Notice that Mathcad uses the := to associate a number with a variable name. The same := is used to define functional relationships as shown here for P(V). Next we write the van der Waals equation. Notice how we write the equation with P as a function of V. P vw ( V) P ideal ( V) i := 0.. 100 V n i 35 ( 200 35) := + i 100 P vwi := n := 10 R T := V b := R T V P vw ( V i ) a V 2 P ideali := P ideal ( V i ) Notice how the equation looks like what you would write on a page in your notebook. This is one of the advantages of using Mathcad. Note that vw is a literal subscript and is included to distinguish it from P ideal the pressure calculated from the ideal gas equation. Here we define the range for the calculation of the volumes. Notice how we must be sure to specify each variable and its range of values. View the array V i and examine its contents. Notice how you don't need to type in all these values if you can find a way to calculate them. Once the V i are defined it is an easy step to define Pvw i and Pideal i. The parameter n is included to allow us to easily change the range of V values and with them the range of P vw and P ideal values, something we will want to do in the exercise to follow. We already saw how easy it is to prepare graphs with Mathcad. Practice this on the page to the right. Be sure to place it at a level below that of the equation defining Pvw i. Fill in the place holders with Pvw i and V i. Be careful about which type of subscript you use here. vw is a literal subscript and i is an range subscript. Remember that most of the time you will need only to place the x and y variable names in the place markers for them. Mathcad will generate the scale of the graph for you. However if you want to adjust the formatting of the graph then you can use the Graph pull down menu or double click on the graph itself. Try this and see what happens. page 7

Exercise: Add P ideal to the graph by clicking on Pvw i, using the space bar to highlight all of Pvw i in the blue box, typing a comma, and then P.ideal[i followed by the Enter key. Notice that the graphs for P vw and P ideal are very different. Examine the effect of temperature on the relationship between P vw and P ideal by changing the value of T to 6, 8, 10, 15, 25, and 50 and observing the effects of the changes in temperature on the two graphs. Notice that by the time you get to T = 50 (a temperature of 50 K), the pressures have gotten awfully large (what units are P vw and P ideal in?) To see the effect of pressure on the relationship between P vw and P ideal, keep T = 50, change the value n above to 2, 4, and 10, and observe the effect of the changes on the two graphs. What conclusion can you draw about the difference between the accuracy of the van der Waals Equation and the accuracy of the ideal gas equation for this gas at 50 K and pressures less than 10 (whatever the units are). Keep n = 10 and go back and check some of the lower temperatures (T = 4, 6, 8). What general conclusion can you come to about the temperatures and pressures at which the van der Waals and ideal gas equations produce significantly different results? In drawing these conclusions keep in mind that the van der Waals parameters in this example came from helium, whose boiling point is 4.2 K. What role do you think the boiling point of a substance plays in determining the range of temperatures and pressures at which the van der Waals and ideal gas equations produce significantly different results? Gas Law Exercise: Prepare a graph for the variation of pressure as a function of volume with the Redlich-Kwong equation of state for the same data range used in the van der Waals sample given above. Practice changing the range of the calculation and the range shown in the plot for the x and y axis. What units of volume do you have here? Quantum Chemistry Exercise: Prepare a graph for the wave function for a particle in a box with n=4. Add to the graph the square of the wave function. Describe the difference between the two graphs. Note to students: By now you have the rudimentary skills to do many homework problems in physical chemistry. Most of these require a function and values for the variables. You can also prepare graphs of data and annotate a worksheet like this one using Mathcad's text feature. This means that you can write lab reports using this software. page 8

8. Units: Units are easy to use in Mathcad. You will need to look in the Mathcad manual to see the correct spelling of the many units you will use in physical chemistry. Mathcad 2001i and higher versions of Mathcad support the mole. To see the correct spelling of the unit names you can pull down the menu for units in the Insert collection in the standard tool bar at the top of the mathcad screen. Select Insert Units. This opens a window in which the current system of units is identified and a scroll of types of units available. Find the energy entry. In the square brackets you will see that Joules are written as joule when included as a unit in a calculation. More information about units is given in the Mathcad manual or use the Help menu. Here we review only a few of the basics. Most of the time you will use the help menu. Learn how this functions and what it contains. mass := 25 kg acc := 9.81 m sec 2 F := mass acc F = 245.25 kg m sec -2 Here the mass is defined for a problem. The unit kg is added to the definition by multiplication. The same procedure is used for the acceleration. Then we define the force as F. Typing F = where the ordinary equal sign is used yields the result of the calculation including units. Whenever units are used to define a variable then units are produced in the answer. The calculation is now extended to include momentum. Notice the time unit. time := 5 sec F momentum := time momentum = 49.05 kg m sec -3 Units are important for checking equations to be sure a derivation is correct. If units are incompatible then Mathcad will give you an error message. wrong := mass + acc Gas Law Exercise: Calculate the pressure when 200 grams of CO 2 are confined to a volume of 2 liters at 400 o C. Include all required units. Repeat the exercise using the van der Waals equation. Quantum Chemistry Exercise: Calculate the energy of the n=4 energy level for the particle in the one dimensional box. The particle has the same mass as a hydrogen atom and the box is 1.0 mm wide. page 9

9. Integrals: Numerical integrals are easily performed using MATHCAD. To evaluate an integral open the calculus palette and choose the definite integral symbol. Clicking this produces an integral sign with place holders for the upper and lower limits, the function and variable. Fill in this so that you evaluate the integral of exp(-x 2 ) from 0 to 2. When you enter this expression be sure to remember that exp means e. Notice how the power in a power is handled by MATHCAD. 2 0 e x2 dx = 0.882 Gas Law Exercise: Evaluate the work that an ideal gas would do if it expanded reversibly and isothermally from 1.0 liters to 5.0 liters at 27 o C. Check your text for the requisite integral to evaluate. Quantum Chemistry Exercise: Show that the wave function for a particle in a box is normalized. The wave function is ψ(x)= 2 a sin n π x. you will need to learn the meaning of normalized to complete this a exercise. More extensive exercises with integrals will wait for a future tutorial worksheet. Many of the Mathcad documents on the Mathcad web page give examples of integrals and differentials that you can add to your collection of examples of techniques. 10. Iterations: Sometimes we want to do a whole of set of steps in a single calculation. In this case you must create a vector in order to get a sequential set of iteration steps. You already examined examples of using an index in previous sections of this set of notes. Here we extend that idea. F := 1 F := 1 0 1 i := 0.. 10 F := F + F i+ 2 i+ 1 i Here we define the first two elements of the vector F. F is a vector of a set of numbers such that the next number is the sum of two previous numbers. We would like to generate the remaining values without typing them in one by one. We can use an index and vary the index systematically. The subscript here is created using the [ key. First define the range for the set of numbers you wish to calculate. Then define the function that creates each element in the vector. Typing F = immediately below the definition of F i+2 produces the desired vector. Mathcad repeats the calculation until all i are exhausted. Exercise: Change i to 30 and see what happens. Click on the vector array and determine the number of entries it contains. How long did the calculation take? page 10

One thing you must always remember. Mathcad processes the equations and data you provide in a sequential manner. Your exercises must have equations in the right order in order to function. By way of example move the equation here for F i+2 to a region below the matrix array. You do this by creating a selection box around the equation with the mouse. Release the mouse key and move the mouse so that a hand is seen on the boarder of the selection box. Now depress the left mouse key again and while holding it in the depressed position drag the mouse and move the equation. Try using the same technique to change the size of one of the graphs above in this document. 11. Solving equations. In physical chemistry we are often asked to solve equations by finding the roots that satisfy the equation. Here we see some simple examples of solving equations. Mathcad will even let you solve differential equations but that is a story for later. When solving an equation with Mathcad we must help the software get started. We do this by providing an initial guess for the root in which we are interested. f( x) := x 2 4 x + 3 Here we have a quadratic equation. We will use the root function of Mathcad to find the roots. Prepare a graph of f(x) as a function of x. You might consider using a range for x of -3 to +10. Can you detect the two roots in this graph? Adjust the range and visually determine the roots. Now use your guesses to find what Mathcad says the roots are. Here to the right I have typed in 3.5 and 0.5. Replace these with your roots and try several other initial guesses. Get Mathcad's answer by typing ans= to the right of the root expression. ans is the variable name that holds the values of the roots. x := 3.5 ans := root( f( x), x) x := 0.5 ans := root( f( x), x) page 11

x 2 4 x + 3 = 0 Here we rewrite the quadratic expression as a symbolic expression. The bold = sign is created by typing ctrl=. Now we will use symbolic menu to find the roots in a more direct way. Place the blue cursor next to the x and highlight the x with a blue selection box r editing lines. From the Symbolic dropdown menu choose solve for variable. The answer should immediately appear. Try this and compare your answer to the one above. g( x) := x e x 1 x :=.5 ans := root( g( x), x) ans = 0.567 Consider the function to the left. Provide an estimate for the the point at which g(x) is zero. Use the root function as shown and then type ans= Check that the answer actually does give a value for g(x) that is zero or close to zero. 0 = x e x 1 W( 1) = x 3 = 4 x :=.5 gg( x) := x 3 4 ans := root( gg( x), x) ans = 1.587 Here we try the symbolic approach. High light the x with a blue selection box and choose solve for variable. You should observe what is shown here to the left. MATHCAD gives no solution to this problem symbolically! This can happen and then you must use other strategies. The success Mathcad has in solving a problem is dependent on your skill and the algorithms programmed into the software. Here is another symbolic expression. Highlight the x with a blue selection box and choose solve for variable from the Symbolic menu. What do you get from this. Not very useful is it. This approach to solving equations with Mathcad is limited and when it fails you must use alternative methods. Like all good scientists we must have multiple approaches for solving problems. Here we describe an alternative to that cubic expression to the upper right. We define a new function and ask for the root. Don't forget to give a new initial guess or else Mathcad will use what ever was left over from calculations done above. Vary the initial value for x to see what latitude you have in your initial guess in this case. Try small, large, negative and decimal values. page 12

values. 12. An Equation with two variables. Using a solve block to find the values of x and y that satisfy a set of equations in x nd y. A solve block is a group of commands and equations in which the instructions for solving a system of equations is contained. Within the solve block you provide the initial guess for the solution, the the word given, the constraints (equalities and inequalities etc. the function to be operated upon, and the method of operation to be applied to the function. The procedure is outlined here below for the system of simultaneous equations shown below. x := 2 y := 2 Provide initial guesses for x and y. Given The word 'Given' marks the start of a solve block.this word must be typed carefully so that it is a Math operation not a text item. x 2 + y 2 = 10 x y = 1 Since there are two unknowns Mathcad requires two symbolic equalities. These are the two simultaneous equations we want to solve. xval := yval xval 2.679 = yval 1.679 Find( x, y) To the left we see the correct form of using the Find Mathcad function. The Find function ends the solve block. Here are the results. To display them I typed the matrix followed by an ordinary = sign. Try this your self for practice. The second matrix can be added to the page by copying and pasting. Given x 2 + y 2 = 10 x xval := Find ( x, y ) yval y = 5 Another example. In this case I chose a different second equation with the same initial guess values. Here we see that you get a red version of the expression, when the software can't solve the equations. I wonder why this happens. What do you think? page 13

13. Preliminary remarks on symbolic manipulation Differentiation x e x2 Highlight the variable x with a blue selection box and choose differentiate on variable from the Symbolic pull down menu. This yields: ( ) 2 x 2 exp x 2 ( ) exp x 2 Try this for your self in the space to the left. Integration x e x2 This time highlight the variable and then choose integrate on variable from the Symbolic menu. You should obtain 1 2 exp( x2) Substitution u 2 + 1 Highlight this and copy. x e x2 Highlight the x variable and then choose Substitute for variable from the Symbolic menu. You should obtain: ( ) 2 exp ( u ) 2 u 2 + 1 + 1 Try this for yourself in the space to the left. page 14

14. Some preliminary remarks on matrices. Matrices are powerful mathematical tools. One primary use is to solve a set of simultaneous equations. You may learn more about this later in your physical chemistry course. 1 2 AA := 1 2 2 0 0 1 4 1 1 0 1 0 1 2 1 4 BB := 2 1 Matrices are created using the Matrices symbol from the math palette or by choosing Matrices from the Math menu. Here we have matrices AA and BB. We can form the product of these two matrices using the normal rules of matrix algebra. 1.643 xx := AA 1 1.571 BB xx = 0.714 0.357 Notice the names of the variables and the use of mathematical symbols to do the multiplication. Acknowledgment: TJZ acknowledges the National Science Foundation for support of the 1997 NSF-UFE Workshop on "Numerical Methods in the Undergraduate Chemistry Curriculum Using the Mathcad Software" and the organizers (Jeff Madura, Andrzej Wierzbicki and Sidney Young, University of South Alabama). page 15

se is not allowed page 16