FullSimply 不等式,然后在 Mathematica 7 中重新排列它们

发布于 2024-09-30 03:48:08 字数 690 浏览 0 评论 0原文

我在笔记本界面中使用 Mathematica 7,我想重新排列不等式,以便在一侧得到某个变量。例如。

FullSimplify[x^3+L+r>3x^3+2r]

但是

L > r + 2 x^3

,我想要:

r < L-2x^3

我们是否可以指示 FullSimplify 以特定方式对变量进行排序?我也使用 Mathematica 进行演示,因此安排变量的方式对我来说很重要。

谢谢

SR

编辑:我尝试了Reduce,虽然这适用于这个例子,但它不适用于我的实际表达式,我收到一条错误消息,

 This system cannot be solved with the methods available to Reduce.

编辑:这是实际的表达式:

{L - (m^2 ((-2 + e)^2 \[Delta] + (5 + 
     2 e (-7 + 4 e)) \[Tau]) \[Omega])/(36 (2 - 3 e + e^2)^2)} > {0}

我希望它以以下形式显示<代码>\[delta]< *某事* 谢谢!

I am using Mathematica 7 in the notebook interface and I want to rearrange an inequality so that I get a certain variable on one side. For eg.

FullSimplify[x^3+L+r>3x^3+2r]

Gives

L > r + 2 x^3

However, I want :

r < L-2x^3

Is there anyway we can instruct FullSimplify to order variables in a particular way? I am using Mathematica for presentation as well so, the way I arrange the variables is important to me.

Thanks

SR

Edit: I tried Reduce, while that works for this example, it does not work for the actual expression I have, I get an error saying,

 This system cannot be solved with the methods available to Reduce.

Edit: here is the actual expression:

{L - (m^2 ((-2 + e)^2 \[Delta] + (5 + 
     2 e (-7 + 4 e)) \[Tau]) \[Omega])/(36 (2 - 3 e + e^2)^2)} > {0}

I want this to be displayed in the form of \[delta]< *something*
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

策马西风 2024-10-07 03:48:08

首先,让 Mathematica 准确地输出你想要的东西就像是一门黑魔法,需要很大的耐心。也就是说,如果您将 Reduce 应用于原始表达式,按照 Belisarius,你会得到

In[1]:=Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]
Out[1]:= r < L - 2 x^3

然而,正如你所指出的,这不是完整的表达式,并且 Reduce 产生的只能是被描述为应用时不太有帮助的答案。此时需要耐心和大量额外的处理。我首先会说

In[2]:=Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify

虽然这并没有给你一个干净的答案,但它比以前更好,并且揭示了解决方案的更多结构。 (我不会使用 FullSimplify 因为它会将 Delta 与其他项混合在一起。)此时,我们需要更多地了解这些项本身以及 Delta 的输出code>In[2] 并不像我们想要的那么有用。

我将使用 LogicalExpand 重新扩展它,它为您提供了 12 个术语,这些术语比单独使用 Reduce 所提供的要简单得多。 (您会注意到,只有最后六个术语实际上涉及 Delta,因此我会检查变量条件是否实际上与这些条件匹配。)仅选择最后六个术语,

In[3]:=%2[[-6;;]] // Simplify
Out[3]:= m != 0 
       && ((Omega > 0 && Delta < something) || (Omega > 0 && Delta < something else)
       && (1 < e < 2 || e < 1 || e > 2)

第三个术语是同义反复,但是SimplifyFullSimplify 似乎都无法删除它。无论如何,我们实际上只对中期感兴趣。如果欧米茄> 0 然后可以通过 %[[2,1,2]] 提取您的表达式。

将所有这些放在一个表达式中:

In[4]:=Simplify[LogicalExpand[Reduce[<expression>, Delta, Reals]]][[-6;;]] //
       Simplify // #[[2,1,2]]&
Out[4]:= Delta < something

写出来之后,我意识到有一种更简单的方法来解决这个问题。我将重做上面的第 2 行,如下所示:

In[5]:= Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify //
       Cases[#, ___ && Delta < _ && ___, Infinity]&
Out[5]:= {Omega > 0 && Delta < something}

或者,前提是您确实知道 m != 0Omega > 。 0 你可以做

In[6]:= Reduce[ <expr> && m!=0 && Omega > 0, Delta, Reals ] // LogicalExpand // 
        Simplify // #[[2]]&

First of all, getting Mathematica to output something exactly as you would like it is something of a black art, and requires a lot of patience. That said, if you apply Reduce to your original expression, as per Belisarius, you'd get

In[1]:=Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]
Out[1]:= r < L - 2 x^3

However, as you pointed out, this isn't the full expression, and Reduce produces what can only be described as a less than helpful answer when applied to it. It is at this point where patience and a lot of extra processing is required. I'd start with

In[2]:=Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify

While this doesn't give you a clean answer, it is better than before and reveals more of the structure of your solution. (I would not use FullSimplify as that mixes Delta in with the other terms.) At this point, we need to know more about the terms themselves, and the output from In[2] is not quite as useful as we want.

I'd re-expand this with LogicalExpand which gives you twelve terms that are significantly simpler than the what Reduce alone gives. (You'll note that only the last six terms actually involve Delta, so I'd check that the variable conditions actually match those.) Selecting those last six terms only,

In[3]:=%2[[-6;;]] // Simplify
Out[3]:= m != 0 
       && ((Omega > 0 && Delta < something) || (Omega > 0 && Delta < something else)
       && (1 < e < 2 || e < 1 || e > 2)

The third term is tautological, but Simplify nor FullSimplify can't seem to remove it. And we're really only interested in the middle term anyway. If Omega > 0 your expression can then be extracted via %[[2,1,2]].

Putting this all together in one expression:

In[4]:=Simplify[LogicalExpand[Reduce[<expression>, Delta, Reals]]][[-6;;]] //
       Simplify // #[[2,1,2]]&
Out[4]:= Delta < something

After writing that out, I realized that there is a much simpler way to approach this. I'd redo line 2, above, as follows:

In[5]:= Reduce[ <full expression>, Delta, Reals] // LogicalExpand // Simplify //
       Cases[#, ___ && Delta < _ && ___, Infinity]&
Out[5]:= {Omega > 0 && Delta < something}

Or, provided you really do know that m != 0 and Omega > 0 you can do

In[6]:= Reduce[ <expr> && m!=0 && Omega > 0, Delta, Reals ] // LogicalExpand // 
        Simplify // #[[2]]&
你怎么敢 2024-10-07 03:48:08
Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]

会做。

由于我不使用 Mathematica 进行编辑或演示,也许其他人可能会提供一些额外的建议。

编辑

根据您的评论

Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 + 
        2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) > 0}, Delta, Reals]  

,您可以尝试:我纠正了一些语法错误。但你会发现结果的表达是相当不愉快的。为了进一步简化它,您需要知道变量的有效范围。如果您有该信息,请发布该信息。
哈!

Reduce[x^3 + L + r > 3 x^3 + 2 r, r, Reals]

Will do.

As I don't use Mathematica for editing or presentation, perhaps someone else may come with some extra advice.

Edit

based on your comment, you may try:

Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 + 
        2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) > 0}, Delta, Reals]  

Where I corrected some syntax errors. But you'll find that the resulting expression is rather unpleasant. To simplify it further you need to know the valid ranges for your vars. Please post that info if you have it.
HTH!

两个我 2024-10-07 03:48:08

检查 的输出

r=Simplify[Reduce[L-(m^2((-2+e)^2\\[Delta]+(5+2e(-7+4e))\\[Tau])\\[Omega])/(36(2-3e+e^2)^2)>0,\\[Delta],Reals]]  

可以看到,

r[[2,1,1,1]] gives \\[Delta]>expr, 

但是

r[[2, 1, 2, 2]] gives \\[Delta]< expr, 

因为 expr 的分母中有 \[Omega] 的符号。所有这些都忽略了 L、e、m 和 \[Omega] 值的其他条件,这些条件将改变结果,并且不同版本的 Mathematica 可能会改变 Simplify[Reduce[]] 结果的形式,这将使所有这些无效。

Inspect the output of

r=Simplify[Reduce[L-(m^2((-2+e)^2\\[Delta]+(5+2e(-7+4e))\\[Tau])\\[Omega])/(36(2-3e+e^2)^2)>0,\\[Delta],Reals]]  

to see that

r[[2,1,1,1]] gives \\[Delta]>expr, 

but

r[[2, 1, 2, 2]] gives \\[Delta]< expr, 

because the sign of \[Omega] in the denominator of expr. All this ignores the other conditions on the values of L, e, m and \[Omega] that will change the result and different versions of Mathematica may change the form of the result from Simplify[Reduce[]] which will invalidate all of this.

烛影斜 2024-10-07 03:48:08

减少由Reduce[] 和LogicalExpand[] 返回的表达式的部分困难在于,当e=1 或=2 时,所提供的表达式涉及除以零。

我得到了一些可以忍受的紧凑的东西

Assuming[{
  (L | m | e | Tau | Omega | Delta) \[Element] Reals
  },
 FullSimplify[
  LogicalExpand[
   Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 + 
               2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) > 
      0}, Delta, Reals]
   ]
  ]
 ]
Out[]:= (L > 0 && (1 < e < 2 || e < 1 || e > 2) && (m == 0 || Omega == 0)) || 
    (m != 0 && (
      (Omega > 0 && 
       Delta < (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2) || 
      (Delta > (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2 && 
       Omega < 0)) && 
    (e > 2 || e < 1 || 1 < e < 2))

,我没有花费任何精力用符号替换符号名称。

(为什么假设[...]?因为我懒得记住将相同的假设塞进每个简化步骤中。)

Part of the difficulty in reducing the expressions returned by Reduce[] and LogicalExpand[] is that the supplied expression involves division by zero when e=1 or =2.

I get something bearably compact with

Assuming[{
  (L | m | e | Tau | Omega | Delta) \[Element] Reals
  },
 FullSimplify[
  LogicalExpand[
   Reduce[{L - (m^2 ((-2 + e)^2 Delta + (5 + 
               2 e (-7 + 4 e)) Tau) Omega)/(36 (2 - 3 e + e^2)^2) > 
      0}, Delta, Reals]
   ]
  ]
 ]
Out[]:= (L > 0 && (1 < e < 2 || e < 1 || e > 2) && (m == 0 || Omega == 0)) || 
    (m != 0 && (
      (Omega > 0 && 
       Delta < (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2) || 
      (Delta > (36 (-1 + e)^2 L)/(m^2 Omega) + ((-5 + 2 (7 - 4 e) e) Tau)/(-2 + e)^2 && 
       Omega < 0)) && 
    (e > 2 || e < 1 || 1 < e < 2))

where I've expended no effort to replace symbol names with symbols.

(Why Assuming[...]? Because I'm too lazy to remember to get the same assumptions jammed into each simplification step.)

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