在 Maple 中绘制具有 3 个变量的 3 个不等式
我需要在枫树中绘制它
3x1+y+z<=180
x<=12
x+y+4z<=190
如何在枫树中绘制?我用的是枫叶13
I need to plot this in maple
3x1+y+z<=180
x<=12
x+y+4z<=190
How can I do a plot in Maple? I'm using Maple 13
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
plots
库中的inequal
命令绘制不等式,并且可以通过将多个方程放在括号中来绘制它们:如果给定的绘图命令不支持多个绘图,您始终可以单独绘制图形并将它们与
display
结合起来:You plot inequalities with the
inequal
command from theplots
library, and you can plot multiple equations by putting them in brackets:If a given plot command doesn't support multiple plots, you can always do the plots separately and combine them with
display
:由于您提到这三个不等式是优化问题的约束,因此我假设您对它们的交集而不是每个不等式感兴趣。我是这样做的。我使用分段命令定义一个二进制值函数,当点满足所有三个不等式时,该函数等于 1,然后使用绘图中的隐式绘图命令> 包和不等式
f > 1/2
或者您可以选择等式f = 1
,那么此命令会将您的区域边界绘制为曲面。当然,有时您可能无法获得合适的绘图,例如,当您的区域与绘图框相比很小时,就会发生一种情况。这是输出。
Since you mentioned these three inequalities are constraints for an optimization problem, therefore I assume you are interested in the intersection of them and not each separately. Here is how I do it. I use
piecewise
command to define a binary values function that is equal to 1 when the point satisfies all three inequalities and then I useimplicitplot3d
command fromplots
package and an inequalityf > 1/2
or you can go for the equalityf = 1
, then this command will plot the boundary of your region as a surface. Of course sometimes you may not get a suitable plot, for example one case happens when your region is tiny compared with the plotting box.Here is the output.