15.1: Graphing
- Page ID
- 15006
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Graphing is a great way for interpreting technical and scientific data. Two areas will be discussed: 1) graphical presentation of data, 2) graphical analysis.
Mathcad provides several graphing options.
The easiest way to begin a plot is to use the graphing toolbox.
OR
Use the menu options Insert/Graph/X-Y Plot
OR
Shortcut [Shift + 2]
The toolbar looks like
and clicking on the first button creates a blank plot
There are six place holders in the empty graph. The centered place holders are used for x-coordinate and y-coordinate data and the other four are for the x and y bounds.
Example 15.1.1
An engineer is testing a new material to find its modulus of elasticity, defined as the stress over the strain (or N/m). Plot the data given F vs. δ.
Solution
\[F:=\begin{pmatrix}
2\\
4\\
6\\
8\\
10\\
12\\
14\\
16\\
18\\
20
\end{pmatrix}.kN\nonumber\]
\[δ:=\begin{pmatrix}
0.82\\
1.47\\
2.05\\
3.37\\
3.75\\
4.17\\
5.25\\
5.44\\
6.62\\
7.97
\end{pmatrix}.mm\nonumber\]
If you wish to make any plot bigger, click on the plot. Grab the bottom right hand handle with the mouse and drag it to make it larger. If you want to reposition a plot, click on the plot, point to the outside edge of the area until you see the hand, hold the mouse button down and drag the plot to a new location.
Note
Mathcad always plots in base units. So the plot in example 47 is in bNewtons for the F and in meters for the δ. Here we show the enlarged plot with the units removed. As you see the plot now shows the values in the above tables with a unit on the axis. The center place holders have the data value divided by the unit F/kN and δ/mm.
However, in example 47 suppose we really want to see just the data points, not the connecting lines. To do this, double click the graph to bring up the formatting dialog box.
Go to the TRACES tab to add a symbol and remove the line. As you can see from the other tabs in this dialog box, you make many changes to the way the graph is formatted. A possible, reformatted graph appears below.
How about plotting multiple curves on the same plot? We demonstrate this in the following example.
Example 15.1.2
Begin by entering the data for the variables Time, Distance1 and Distance2.
\[Time:=\begin{pmatrix}
0\\
1\\
2\\
3\\
4\\
5\\
6
\end{pmatrix}\nonumber\]
\[Distance1:=\begin{pmatrix}
0\\
4.9\\
19.6\\
44.1\\
78.4\\
122.5\\
176.4
\end{pmatrix}\nonumber\]
\[Distance2:=\begin{pmatrix}
5\\
19.8\\
76.8\\
153.3\\
256.2\\
394.5\\
559.2
\end{pmatrix}\nonumber\]
Open a new plot and put Time in the x-axis. For the y-axis, enter Distance1 and then type a comma (important!!). This will move you to a new line where you can type Distance2. When you are done, click outside the graph to see the plot. To customize the plot, double click the plot and use the Formatting dialog box. See if you can match the plot below:
If you want to see a plot of a predefined function, you can use a Quickplot.
Example 15.1.3
Simply open a new plot, enter the variable x on the x-axis and a function, say sin(x) on the y-axis. The default plot has x from -10 to 10.
In example 15.1.3 if you want to change the x values, first single click on the plot. The numbers -10 and 10 appear at the bottom. One at a time simply click on them and type in the new values 0 and 2π (using the Greek toolbar).
Now for a more advanced example...
Example 15.1.4
Here is the vibration response of a damped signal of freedom system to a step input.
with resulting plot:
The last example may be difficult to reproduce. Mastering how to input all of these parts into Mathcad takes time. Be patient.