Using Arrays and Vectors to Make Graphs In Mathcad Charles Nippert

Similar documents
Using Mathcad to Perform Mathematics Charles Nippert

The Mathcad Workspace 7

Introduction to Microsoft Excel

Introduction to Mathcad

Pre-Lab Excel Problem

MET 107 Getting Started in Mathcad Document Set 1. The majority of these documents are taken from the Mathcad Resources (Help) pages.

Grade 8 FSA Mathematics Practice Test Guide

SHORT CUT GUIDE TO MATHCAD. J. (:. McGee and W. D. Holland

Getting Started with DADiSP

WEEK NO. 12 MICROSOFT EXCEL 2007

MOVING FROM CELL TO CELL

Name: Dr. Fritz Wilhelm Lab 1, Presentation of lab reports Page # 1 of 7 5/17/2012 Physics 120 Section: ####

Select the Points You ll Use. Tech Assignment: Find a Quadratic Function for College Costs

Module 1: Basics of Solids Modeling with SolidWorks

MatDeck tips. Basic. :=- assignment of variable values; assign value to variable a with code a := value

Put the Graphs for Each Health Plan on the Same Graph

MatDeck User Manual. Contents

Lab1: Use of Word and Excel

Introduction to Excel Workshop

Creating a Text Frame. Create a Table and Type Text. Pointer Tool Text Tool Table Tool Word Art Tool

BioFuel Graphing instructions using Microsoft Excel 2003 (Microsoft Excel 2007 instructions start on page mei-7)

Introduction to the workbook and spreadsheet

Microsoft Excel Lab: Data Analysis

Drawing Tools. Drawing a Rectangle

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates.

Adobe Illustrator CS Design Professional GETTING STARTED WITH ILLUSTRATOR

John's Tutorial on Everyday Mathcad (Version 9/2/09) Mathcad is not the specialist's ultimate mathematical simulator

Models for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:

ClassPad website: CASIO Education website:

Word Processing. 2 Monroe County Library System

FSA Geometry EOC Practice Test Guide

Introduction to Mathcad

1 Introduction to Matlab

Excel Basics 1. Running Excel When you first run Microsoft Excel you see the following menus and toolbars across the top of your new worksheet

Word Creating & Using Tables. IT Training & Development (818) Information Technology

Microsoft Excel Microsoft Excel

Using the Equation Palette

Excel R Tips. is used for multiplication. + is used for addition. is used for subtraction. / is used for division

FSA Algebra 1 EOC Practice Test Guide

Magazine Layout Design. and Adobe InDesign basics

CHAPTER 1 COPYRIGHTED MATERIAL. Getting to Know AutoCAD. Opening a new drawing. Getting familiar with the AutoCAD and AutoCAD LT Graphics windows

The HOME Tab: Cut Copy Vertical Alignments

Vision Pointer Tools

FSA Algebra 1 EOC Practice Test Guide

Coordinates - Activity 1 Plotting whole number ordered pairs.

SOLIDWORKS: Lesson 1 - Basics and Modeling. Introduction to Robotics

Cell Basics. Introduction

EXCEL 2007 TIP SHEET. Dialog Box Launcher these allow you to access additional features associated with a specific Group of buttons within a Ribbon.

Functions in Excel. Structure of a function: Basic Mathematical Functions. Arithmetic operators: Comparison Operators:

Introduction. Using Indents and Tab Stops. Google Documents Using Indents, Tabs, and Lists. Indenting Text. Page 1

San Francisco State University

Mathcad Lecture #1 In-class Worksheet Mathcad Basics

Creating a Basic Chart in Excel 2007

Gloucester County Library System EXCEL 2007

MICROSOFT EXCEL TUTORIAL HANDOUT

Technology Assignment: Scatter Plots

Get comfortable using computers

1. AUTO CORRECT. To auto correct a text in MS Word the text manipulation includes following step.

Introduction to Geogebra

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version):

SolidWorks 2½D Parts

The Fundamentals. Document Basics

To move cells, the pointer should be a north-south-eastwest facing arrow

For more info and downloads go to: Gerrit Stols

EXCEL BASICS: MICROSOFT OFFICE 2010

Autodesk Inventor - Basics Tutorial Exercise 1

The Ribbon The Ribbon contains multiple tabs, each with several groups of commands. You can add your own tabs that contain your favorite commands.

Cell to Cell mouse arrow Type Tab Enter Scroll Bars Page Up Page Down Crtl + Home Crtl + End Value Label Formula Note:

PowerPoint 2003 for Windows Version Technology Workshop: Basic PowerPoint Animation for Music Presentations

MATLAB Project: Getting Started with MATLAB

Three-Dimensional (Surface) Plots

Introduction to Microsoft Excel 2010

= 3 + (5*4) + (1/2)*(4/2)^2.

EXCEL BASICS: MICROSOFT OFFICE 2007

Chemistry Excel. Microsoft 2007

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0

Physics 251 Laboratory Introduction to Spreadsheets

Contents Microsoft Excel Lesson 1: Entering Text and Numbers...4 The Microsoft Excel Window...4 The Microsoft Office Button...

1. Move your mouse to the location you wish text to appear in the document. 2. Click the mouse. The insertion point appears.

STAT 311 (3 CREDITS) VARIANCE AND REGRESSION ANALYSIS ELECTIVE: ALL STUDENTS. CONTENT Introduction to Computer application of variance and regression

Total Number of Students in US (millions)

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB! Lab 02: Introduction to Photoshop Part 1

Graphing Calculator Tutorial

Creating 3D Text with LibreOffice

Introducing Gupta Report Builder

1. What specialist uses information obtained from bones to help police solve crimes?

Introduction to Microsoft Office PowerPoint 2010

Excel Core Certification

OVERVIEW DISPLAYING NUMBERS IN SCIENTIFIC NOTATION ENTERING NUMBERS IN SCIENTIFIC NOTATION

Mouse Basics. Dayton Metro Library

Chapter 7 Getting Started with Calc:

Designed by Jason Wagner, Course Web Programmer, Office of e-learning NOTE ABOUT CELL REFERENCES IN THIS DOCUMENT... 1

Microsoft Word 2003 for Windows, Part 2

Spreadsheet View and Basic Statistics Concepts

Basic Microsoft Excel Skills

Microsoft Excel 2013: Part 3 More on Formatting Cells And Worksheet Basics. To apply number formatting:

Experiment 1 CH Fall 2004 INTRODUCTION TO SPREADSHEETS

Microsoft Excel Using Excel in the Science Classroom

Contents Systems of Linear Equations and Determinants

Microsoft Word for Report-Writing (2016 Version)

Transcription:

Using Arrays and Vectors to Make Graphs In Mathcad Charles Nippert This Quick Tour will lead you through the creation of vectors (one-dimensional arrays) and matrices (two-dimensional arrays). After that, you will use these data structures to make plots and graphs. Begin by opening Mathcad. As before move the cursor down and to the right. Getting Started-Planning In this exercise, you will draw a three dimensional graph of a coil. You will use the parametric form of the equation of a coil. When written in vector notation the equation for a coil becomes: r() t = ( R sin( t), R cos( t), t). To make a plot you will need the values of this path function at a range of points. First, you will make an array that contains the values of the parameter t. Then, you will make one array for the values of the X coordinate,, a second array for the values of the y coordinates and a third array for the values of the z coordinate. Then you will use these three arrays to create a threedimensional graph. Arrays, vectors and matrices are groups of numbers in which each individual number or element is identified by a set of integers, called subscripts. The number of integers used to identify a particular element is called the dimension of the array. The arrays that you will create in this project are one-dimensional arrays, or vectors. Matrices are created similarly. The first element in a one-dimensional array is identified by the integer value of zero. The second element is identified by the integer one and so on. Therefore if the array named "x" contains 10 elements, the first element will be identified as x 0, and the last element will be identified as x 9. In this example, the "i-th" element of each of the three arrays will contain the numerical values of the corresponding x, y and z i-th point in a set of points that the graphing routine will use to end draw the plot. 1. Begin by defining a variable N that contains the maximum value of a subscript in an array. Create the variable definition by one of the following: (1) Type N:10 (2) Type N, then choose "View/Toolbars/Evaluation" from the menu options. Click the button. Then type "10". Press Enter after either of these two operations. 2. Create a "Range Variable", also known as a Running Variable". This is a variable that will contain the integers for all the values of all the array elements. In this example it will contain the integers zero through 10. Begin by creating a variable "i" and set it equal to zero as you did in step one. Do not press "Enter". Your screen should look something like figure 1.

Figure 1 After Step 2 3. Choose "View/Toolbars/Matrix" from the menu to make the Matrix dialog box appear. If the dialog box is already present, a small check will appear to the left of the word "Matrix". Click the button on the Matrix toolbar. In my screen, this symbol was the last symbol in the second row. Your screen should now look something like figure 2. Figure 2 After Step 3 To dots and a solid black rectangle and the blue inverted L. cursor appears in your equation. Use the "m..n button on the matrix dialog box to create a range variable

4. A "Range Variable" contains at least an upper and lower limit. Mathcad allows more complex forms of range variables in which the increment between each value is not one. For now we will limit ourselves to simple ranges in which the increment is one. The two dots after the zero are Mathcad's way of indicating that the variable "i is now a Range variable. The lower limit of that Range variable is zero. The solid black rectangle shows that Mathcad is waiting for the upper limit of the Range variable. Type "N" and press "Enter". The limits on the Range variable are now zero and the value contained in the variable "N" (the number 10 for now). 5. Now create and array or vector named "t" that contains values ranging from zero to 6π. Using these values, Mathcad will do calculations around three loops of the coil. The mathematical equation that allows us to calculate the values of the i parameter at N equally spaced points between zero and 6π is t i = 6π where i= N an integer from zero to N. Type the letter "t just below the definition of "i". Then press the key in the matrix dialog box. In my computer, this was the second key in the first row. A small black rectangle will appear to the right and a little below the "t. This indicates that the program is ready to accept a subscript for the array named t. Pressing the [ key is a shortcut to creating subscripts. Pressing the [ key can also create a subscript. Your screen should now look like figure 3.

Figure 3 After Step 5 This place holder indicates a subscript. Use the button or press the [ key to create a subscript. 6. Press the i key. The black rectangle will be replaced by the letter i. The variable t i now refers to each variable in a one-dimensional array named t. Notice that the right hand side of the equation given in step 5 contains the Greek letter π. To create Greek letters, open the Greek dialog box by choosing "View/Toolbars/Greek" menu option. A new dialog box showing Greek letters will appear. Your screen will now look something like Figure 4.

Figure 4. Figure 4 After Step 6 7. Finish entering the arithmetic assignment statement. Either press the Shift : key on the keyboard or press the, :=, button on the Evaluation toolbar to create the symbol, :=. Press the 6 and then the * keys on your keyboard. To enter the Greek letter π, press the button labeled "π on the dialog box. Finish entering the arithmetic assignment statement by typing *i/n. Your screen should now look like figure 5. The statement you have just entered will create an array containing N+1 elements numbered from zero to N. The values in this array will be 11 equally spaced real numbers from 0 to 6π.

Figure 5 After Step 7 8. Now defining a value for the variable R. Press "Enter". The box around the last statement will disappear and the Red Cross cursor will appear just below that statement. Type the characters R:2 to create the defining equation for the radius. Your screen should now look like figure 6.

Figure 6 After Step 8 9. You will now enter the statements that create three arrays containing the values of the x, y and z coordinates of the points you are going to plot. Fill each array by creating a formula using the Range Variable to create statements that define each variable in these arrays. Press "Enter". Then begin to enter the defining statement for the x array. Type "x[i:r*.this statement will use preprogrammed Mathcad functions. Choose "Insert/Function" from the menu. The Insert Function dialog box will appear. This dialog box will allow you to select among the preprogrammed functions available in Mathcad. If you already know the function, you can simply type it in. In the first box, labeled "Function Category", select "Trigonometric". A list of trigonometric functions will appear in the right hand box, labeled "Function Name", choose "sin". Your screen will now look like figure 7.

Figure 7 After Step 9 10. Press the "OK button on the dialog box. The dialog box will disappear and the sine function, "sin", will appear in the statement. The black rectangle will appear inside the parenthesis. Type the characters t[i to finish the equation. Your screen should now look like figure 8.

Figure 8 After Step 10 11. Press "Enter" and create a statement for the y array: y R cos( ) i = t i. Finally enter the statement for the z array: z = t. Your screen should now look like figure 9. i i

Figure 9 After Step 11 12. You are now ready to create the graph. Press "Enter". The red cross cursor will appear just below the last equation. Choose "Insert/Graph/3D Plot Wizard" from the menu. The graphical wizard will appear. A list of choices will appear at the left of the dialog box. A sample graph will appear at the right. Choose "Scatter Plot" from the list of plot types. This type of plot will display points in three dimensions. Your screen will look like figure 10.

Figure 10 After Step 12 13. Press the "Next" button on the wizard. The next portion of the dialog box, named "Appearance" will appear. Choose "Connect with lines". The picture to the right will show lines drawn between the points. Your screen will now look like figure 11.

Figure 11 After Step 13 14. Press "Next". The last portion of this wizard allows you to set the coloring for your image. For this drawing choose "Solid color". Your screen will now look like figure 12.

Figure 12 After Step 14 15. Press "Finish". The dialog box will close and a 3-D plot area will appear and replace the red cross. The upper left-hand corner of the graph will be at the spot of the red cross. The small black rectangle in the lower left-hand corner indicates the area where the arrays containing the XYZ values will be entered. Your screen will now look like figure 13. A 3-D graph will appear inside the shape of a square. Small solid black rectangles will appear on the edges of the box. You can grab these solid black rectangles with your mouse cursor to change the size of the graph. The solid black rectangle in the left hell for he-hand corner indicates the position where the XYZ values will be entered.

Figure 13 Portion of the Screen After Step 15 You will enter the values to be plotted in the lower left rectangle. You can change the size of the graph by grabbing the black rectangles on the edge with the mouse cursor and dragging them to a new location. 16. The inverted blue "L" in the lower left solid black rectangle in the graph indicates that the program is waiting for the names of the arrays containing the coordinates. Type "(x,y,z) and press "Enter". Your screen should now look like figure 14. Notice that the coil does not look very much like a coil. Instead it looks like a series of jagged lines. That is because the program draws a straight line between each set of points. In order to get a more believable image, you must increase the number of points in the arrays. In the final step in this set of notes, you will learn how to increase the number of elements and create a more realistic graph.

Figure 14 A Portion of the Screen at After Step 16 17. Recall that for this sheet the number of points in each array is specified by the upper limit of the counter i. This term is the variable N. Therefore to increase the size of the array in Mathcad all you need to do is change the variable called "N. Mathcad will then recalculate all subsequent statements. You may have to scroll the work area up to relocate the defining statement for the variable N. Click on that statement and move the blue L-shaped cursor to the end of the equation by pressing the right arrow key. Change the "10 in the defining statement for N to "75 by pressing the backspace key twice. This action will remove the 10 and restore the solid black rectangle. Finally, type 75 and press "Enter". Your screen should now look do something like figure 15.

Figure 15 A Portion Of the Screen After Step 17