如何在mathematica中生成不等式集列表
我想在 Mma 中执行以下操作。假设我有三个表达式,x1, 3 x1-x2, x2-x1
,其中 0<=x1,x2<=1
)。我想要另一个指定三个中最大的至少是最小的两倍。因此,这三者的顺序有一些排列:
x1<=3 x1-x2<=x2-x1 && 2 x1<=x2-x1
3 x1-x2<=x1<=x2-x1 && 2 (3 x1-x2)<=x2-x1
...... 其余4个条件类似。
如何自动形成这些条件(与0<=x1,x2<=1
一起),然后将它们一一输入Reduce,并根据x1求解x2?
非常感谢!
I want to do the following in Mma. Suppose I have three expressions, x1, 3 x1-x2, x2-x1
where 0<=x1,x2<=1
). I want to have another one which specifies the largest among the three is at least twice of the smallest. So there are some permutation of the three in terms of their order:
x1<=3 x1-x2<=x2-x1 && 2 x1<=x2-x1
3 x1-x2<=x1<=x2-x1 && 2 (3 x1-x2)<=x2-x1
....
with the rest 4 similar conditions.
How do I form these conditions automatically (together with 0<=x1,x2<=1
), and then feed them into Reduce one-by-one, and solve for x2 in terms of x1?
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想与第二大或第三大/最小进行比较,则可以使用
RankedMax
至于求解 x2 - 有许多不同的
x2
值对应到每个x1
所以你不能用传统意义上解决它,你可以从RegionPlot
看到它If you want to do comparisons with second-largest or third largest/smallest then can use
RankedMax
As far as solving it for x2 -- there are many different values of
x2
corresponding to eachx1
so you can't solve it in the conventional sense, you can see it fromRegionPlot
使用
Max
和Min
并在变量列表中的x1
之前指定x2
,如下Use
Max
andMin
and specifyx2
beforex1
in the variable list, as follows