CATEGORII DOCUMENTE |

Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |

Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |

+ Font mai mare | - Font mai mic

**Creating Graphs**

_{}

Mathcad makes it easy for you to create an x-y plot. Just click in
a new file, type an expression that depends on one variable, for example, **sin(x)**, and then click on the X-Y Plot button

_{}

in the **Graph Palette**,
or choose **X-Y Plot** from the **Insert/Graph** menu. Then press **[Enter]**. Voila, a plot! You should see a nicely
formatted plot that looks like this:

__Try It Out! ____ __

The expression you plot doesn't even have to be a function of _{}. Try typing **y^2[spacebar]-3*y**, followed by the ** ** key (a shortcut for creating an x-y
plot). Mathcad will plot over a reasonable default range for the dependent
variable in your expression. Here are a
couple of other expressions you can try plotting in this way:

_{}

_{}

__Graphing a Function
Using Range Variables__

When you graphed the above expressions, Mathcad was choosing a default range for the dependent variable. You can have control over the range of values that are plotted. To graph a simple function using a range variable, do the following:

Define a function
of one variable that you wish to plot. For example, graph the following
function: **Type ****f(x):-x^2[Spacebar]+8*x-27**** ****See on screen**

_{}

Define an
independent variable for the horizontal axis. For example: **Type x:0;10 See on screen**

_{}

Create
your plot by clicking in the worksheet window, then type ** ** to
create the x-y plot and type **x** in the *middle* placeholder on the horizontal
axis and type **f(x)** in the *middle*
placeholder on the vertical axis. Then press **[Enter]**

Your plot should look like this:

_{}

Those of you familiar with the plot of _{} will notice that the trace looks a little
rough. To smooth the trace out, try changing the definition of _{} highlighted above to _{}. The smaller increment (or step) means
more points calculated, which means more plotted, which makes the trace
smoother because Mathcad is simply connecting the dots.

To format an x-y plot, just double-click
on it (or choose **Graph** from the **Format** menu) to bring up a formatting
dialog box. The tabbed dialog box lets you change options for logarithmic axes,
grid lines, legends, trace types, markers, colors, axis limits, and more.
Experiment with the x-y plot below. Double-clicking on any Mathcad plot --
contour, surface, polar, vector, etc. -- brings up an appropriate formatting
dialog box.

_{}

_{}

__Graphing Vector Elements____ __

Here is a vector of data points called **money_spent**. We created the vector
using the **Matrix** command on the **Insert** menu; our vector below has 8
rows and 1 column.

_{}

To plot these data points, the horizontal
axis must be either (a) an index variable into the variable _{} or
(b) another vector with the same number of elements. For case (a), first define an index into the
vector:

**Type
****i:0;7**** ****See
on screen**

_{}

Create your plot by typing ** ** and typing

**Type
****money_spent[i**** ****See
on screen**

_{}

in the placeholder on the y axis, and **i** in the placeholder on the x axis. You should see a plot similar to this:

_{}

Notice here that box symbols have been used on a dashed blue line.

To demonstrate case (b), plotting two
vectors of equal size against each other, we will define a second vector,
called **day:**

_{}

_{}

Now it's easy: Create the plot by typing ** **, as above, and type

**Type
****money_spent**** ****See
on screen**

_{}

in the placeholder on the y axis, and

**Type
****day
****See on screen**

_{}

in the placeholder on the x axis.

The resulting plot should look similar to this:

_{}

Here the 'points' trace type has been used with magenta O's. Notice that grid lines have been turned off on both axes.

__Graphing a Function of Vector Elements____ __

You can plot a function over a domain that doesn't contain evenly spaced points. For example, your domain could consist of a vector of values. Plotting a function of vector elements entails defining a function, defining a vector which will be the domain for the function, and plotting. An example of this is:

Define a function of one variable.

**Type
****f(x):x^2**** ****See
on screen**

_{}

Define a vector of numbers to be the
domain for the function. Type **x:** followed by **[Ctrl]M** , and fill in the Matrices dialog box with the appropriate
number of rows and columns (here, 5 rows and 1 column), followed by OK**.** Then fill in the placeholders in the
vector.

_{}

Define an index variable. **Type i:0;4**
**See on screen**

_{}

Type ** ** and fill in the middle placeholders on
the y and x axes with _{} and
_{} The
result should look similar to this:

_{}

Here, the difference with plotting a function of a range variable is that the horizontal axis does not have to be in even increments (such as 1, 2, 3, , 10). Rather, it can be any set of numbers you may wish to plot.

__Graphing Two or More Functions____ __

Plotting multiple functions over a single
domain on a single graph is straightforward. For example, suppose you want to
plot both _{} and
_{} on
one plot. It's easy! Just type the two expressions separated by a comma and
then type ** **

**Type ****1/z [Spacebar] , z^2 @
[Enter] **You'll see a graph similar to this:

_{}

In this example both expressions are plotted over the same default range of values, but you could use two separate range variables if you wish. Try it out in your worksheet window now.

**Type
****f(x):sin(x)** **See on screen**

_{}

**Type****
g(t):t^3 ****See on screen**

_{}

**Type****
x:-10,-9.9;10 ****See on screen**

_{}

**Type****
t:-2,-1.9;2 ****See on screen**

_{}

Then,

Type ** ** in some blank space.

In
the middle placeholder on the horizontal axis, type **x,t**

In
the middle placeholder on the vertical axis, type **f(x),g(t)**

Type **[Enter]**

Your result should look like this:

_{}

As you can see, plotting more than one
function is simple --- just separate your arguments with a comma (** ** The same syntax holds for plotting multiple traces using vectors and
functions of vectors.

_{}

_{}

Politica de confidentialitate | Termeni si conditii de utilizare |

Vizualizari: 1288

Importanta:

Termeni si conditii de utilizare | Contact

© SCRIGROUP 2024 . All rights reserved