在 Maple 中绘制具有 3 个变量的 3 个不等式

发布于 2024-09-11 13:10:30 字数 109 浏览 5 评论 0原文

我需要在枫树中绘制它

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后eg是否自 2024-09-18 13:10:30

您可以使用 plots 库中的 inequal 命令绘制不等式,并且可以通过将多个方程放在括号中来绘制它们:

plots[inequal]([3x1+y+z<=180, x<=12, x+y+4z<=190])

如果给定的绘图命令不支持多个绘图,您始终可以单独绘制图形并将它们与 display 结合起来:

with(plots):
plot1 := inequal(3x1+y+z<=180):
plot2 := inequal(x<=12):
plot3 := inequal(x+y+4z<=190):
display([plot1, plot2, plot3])

You plot inequalities with the inequal command from the plots library, and you can plot multiple equations by putting them in brackets:

plots[inequal]([3x1+y+z<=180, x<=12, x+y+4z<=190])

If a given plot command doesn't support multiple plots, you can always do the plots separately and combine them with display:

with(plots):
plot1 := inequal(3x1+y+z<=180):
plot2 := inequal(x<=12):
plot3 := inequal(x+y+4z<=190):
display([plot1, plot2, plot3])
余生一个溪 2024-09-18 13:10:30

由于您提到这三个不等式是优化问题的约束,因此我假设您对它们的交集而不是每个不等式感兴趣。我是这样做的。我使用分段命令定义一个二进制值函数,当点满足所有三个不等式时,该函数等于 1,然后使用绘图中的隐式绘图命令> 包和不等式 f > 1/2 或者您可以选择等式 f = 1,那么此命令会将您的区域边界绘制为曲面。当然,有时您可能无法获得合适的绘图,例如,当您的区域与绘图框相比很小时,就会发生一种情况。

f := piecewise( And( 3*x + y + z <= 180, x <= 12, x + y + 4*z <= 190 ), 1, 0 );
plots:-implicitplot3d( f >= 1/2, x = -500..500, y=-300..700, z=-500..500, style = surface, grid = [50, 50, 50], color = blue, view = [-500..500, -300..700, -500..500 ] );

这是输出。
输入图片此处描述

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 use implicitplot3d command from plots package and an inequality f > 1/2 or you can go for the equality f = 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.

f := piecewise( And( 3*x + y + z <= 180, x <= 12, x + y + 4*z <= 190 ), 1, 0 );
plots:-implicitplot3d( f >= 1/2, x = -500..500, y=-300..700, z=-500..500, style = surface, grid = [50, 50, 50], color = blue, view = [-500..500, -300..700, -500..500 ] );

Here is the output.
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文