Warning, expecting only range variable ... in expressions ... to be plotted but found name ... - Maple Programming Help

Home : Support : Online Help : System : Error Message Guide : expectingonlyrangevariable

Warning,  expecting only range variable ... in expressions ... to be plotted but found name ...

 Description The plot(f,x) calling sequence plots the real function, f, a function of the independent variable, x, over a horizontal real range.   This warning occurs when the expression that you are trying to plot, using the plot(f,x) calling sequence, contains unexpected names.  Review the variables used to see if there is a mismatch in variable names.  If you intended to explore a plot with a parameter, try using the Exploration assistant (see example 5 below).

Examples

Example 1: Parametric plot

In this example, the variable names used as arguments for the real functions to be plotted do not match the variable name given to the range variable.

 > $\mathrm{plot}\left(\left[\mathrm{sin}\left(t\right),\mathrm{cos}\left(t\right),x=0..\mathrm{\pi }\right]\right)$

Solution: Changing one of the variable names to match the other solves this problem. Here, has been changed to $x.$

 > $\mathrm{plot}\left(\left[\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right),x=0..\mathrm{\pi }\right]\right)$

Example 2: Using e instead of exp

In this example, the letter e has been raised to a variable exponent, instead of using the calling sequence exp(x) to represent the exponential function.

 > $\mathrm{plot}\left({e}^{x},x=0..1\right)$

Solution 1: To plot this expression, replace ${e}^{x}$ with exp(x).

 > $\mathrm{plot}\left(\mathrm{exp}\left(x\right),x=0..1\right)$

Solution 2: Alternatively, add from the Expression palette:

 > $\mathrm{plot}\left({ⅇ}^{x},x=0..1\right)$

Example 3: Using pi instead of Pi

 > plot(sin(pi*x), x = 1 .. 2);

Solution:  For calculations, use "Pi" instead of "pi".

 > plot(sin(Pi*x), x = 1 .. 2);

Example 4: Using i instead of $I$

Maple uses $I$ to represent one of the square roots of -1. If you want to create a complex expression, you need to use $I$.

 > $\mathrm{plot3d}\left(\mathrm{abs}\left(i\cdot y+x\right),x=1..10,y=1..10\right)$

Solution: Use Uppercase $I$ instead of lowercase $i$.

 > $\mathrm{plot3d}\left(\mathrm{abs}\left(I\cdot y+x\right),x=1..10,y=1..10\right)$

Example 5: Unassigned value

The constant $a$ has not been assigned a value.

 > $\mathrm{plot}\left(a+{x}^{2},x=0..2,\mathrm{view}=\left[0..2,0..8\right]\right)$

Solution 1: Assign a value to $a$

 > $a≔5$
 ${a}{≔}{5}$ (2.1)
 > $\mathrm{plot}\left(a+{x}^{2},x=0..2,\mathrm{view}=\left[0..2,0..8\right]\right)$

Solution 2: Use Explore to see how the plot depends on the parameter $a$.

From the Context Panel for the plot expression, select Explore.  Use the default settings in the dialog box and click Explore to see the resulting interactive application. Use the slider to see how the graph depends on the parameter $a$.

 > $\mathrm{restart}$
 > $\mathrm{plot}\left(a+{x}^{2},x=0..2,\mathrm{view}=\left[0..2,0..8\right]\right)$

$\mathbf{a}$

Example 6: 3-D plot example with wrong name used in function

 > $\mathrm{plot3d}\left(\left[\mathrm{sin}\left(z\right),\mathrm{cos}\left(z\right),{y}^{2}+z\right],x=-1..1,y=-1..1\right)$

Solution:

 > $\mathrm{plot3d}\left(\left[\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right),{y}^{2}+x\right],x=-1..1,y=-1..1\right)$