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

Online Help

All Products    Maple    MapleSim


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.  

 

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.

plotsint,cost,x=0..Pi

Warning, expecting only range variable x in expressions [sin(t), cos(t)] to be plotted but found name t

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

plotsinx,cosx,x=0..Pi

 

 

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.

plotex,x=0..1;

Warning, expecting only range variable x in expression e^x to be plotted but found name e

 

Solution 1: To plot this expression, replace ex with exp(x).

plotexpx,x=0..1;

Solution 2: Alternatively, add ⅇx from the Expression palette:

plotⅇx,x=0..1;

Example 3: Using pi instead of Pi

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

Warning, expecting only range variable x in expression sin(pi*x) to be plotted but found name pi

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.

plot3dabsx+iy, x=1..10,y=1..10;

Warning, expecting only range variables [x, y] in expression abs(x+i*y) to be plotted but found name i

 

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

plot3dabsx+Iy, x=1..10,y=1..10;

Example 5: unassigned value

The constant a has not been assigned a value.

plota+x,x=1..2

Warning, expecting only range variable x in expression a+x to be plotted but found name a

Solution: Assign a value to a

a5

a:=5

(2.1)

plota+x,x=1..2

 

Example 6:

Similar to Example 5, in the list of expressions to be plotted, the first expression, x+b contains an undefined constant.

plotx+b,x2,x=1..1

Warning, expecting only range variable x in expression x+b to be plotted but found name b

Solution: Assign a value to b

b7

b:=7

(2.2)

plotx+b,x2,x=1..1

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

plot3dsinz,cosz,z+y2,x=1..1,y=1..1;

Warning, expecting only range variables [x, y] in expressions [sin(z), cos(z), z+y^2] to be plotted but found name z

Solution:

plot3dsinx,cosx,x+y2,x=1..1,y=1..1;

See Also

plot, plot3d, plots[complexplot]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam