注册 登录
北京交通大学论坛-知行信息交流平台 返回首页

study的个人空间 https://zhixing.bjtu.edu.cn/?361 [收藏] [复制] [分享] [RSS]

日志

Maple error---plot

已有 675 次阅读2010-12-31 18:39 |个人分类:Maple|

Warning: unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error: empty plot

Description

This warning occurs when you create a Maple plot without points, curves, or surfaces.  In the warning message, "function" refers to the function being plotted (expressed as an algebraic expression or procedure) and "region" refers to the plotting domain.

 

Verify that you are using the correct syntax for the plotting command and that the function values are real numbers in the specified region.

Examples

Example 1: 3-D plot of a function

h := proc (x, y) options operator, arrow; x^2*cos(y) end proc

proc (x, y) options operator, arrow; x^2*cos(y) end proc

(2.1)

plot3d(h, x = -2 .. 2, y = -2*Pi .. 2*Pi)

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Solution 1: Specify h(x, y)rather than h in the plot3d calling sequence.  This solution uses an expression (x^2*cos(y)) as the argument to the plot3d command.

plot3d(h(x, y), x = -2 .. 2, y = -2*Pi .. 2*Pi)

Solution 2: To plot the function h, leave h in operator form and use the second calling sequence listed on the plot3d help page.

plot3d(h, -2 .. 2, -2*Pi .. 2*Pi)

Example 2: Expression with non-real values

plot(sqrt(x), x = -10 .. -1)

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

In the range given, the solutions for the function sqrt(x) are all complex values that cannot be plotted with the plot command.

Solution:  Change the range to one for which the expression is real-valued.

plot(sqrt(x), x = 0 .. 10)

Alternatively, to plot in the complex plane, use plots[complexplot].

 

Example 3: Additional parameter not given numerical value

plot(x+y, x = -1 .. 1)

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

The expression to be plotted includes two unknowns, but plot expects only one unknown..

Solution 1: To plot this expression, replace y with a numeric value.

plot(x+1, x = -1 .. 1)

Solution 2: To create a 3-D plot of this expression, use plot3d and specify a range for y.

plot3d(x+y, x = -1 .. 1, y = -1 .. 1)

Example 4: Independent variable not specified

plot(x+1, -1 .. 1)

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Solution: To plot this function, explicitly assign the range to x.

plot(x+1, x = -1 .. 1)

 

Important: Previously in Maple 10, you had to specify a range when entering a plot.
Example 5 (Maple 10): Function has not been assigned to anything

plot(f)

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

Here,  plot(f) is interpreted as operator-form and a default range of -10..10 is assumed. The error occurs because f has not been assigned to anything.

Example 5 (Maple 11 and later): You can enter a plot without having to specify a range.

Here, f is interpreted as the independent variable.  A default range of -10..10 is assumed.

plot(f)


路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

手机版|北京交通大学论坛-知行信息交流平台 ( BJTUICP备13011901号 )

GMT+8, 2022-12-3 13:39

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部