Message Boards Message Boards

0
|
1942 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Using existing conditions to simplify the certain part of polynomial

Posted 11 months ago

Here, I want to simplify the polynomial P1

P1 == \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 
  2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) + 
  k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 
  6 l1 l2 + (k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 + 
    3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) + \[Gamma] (\
\[Omega]1^2 + \[Omega]2^2))

under the conditions mentioned below

Conditions : 
 k1 \[Omega]1 + k1^4 + 
    3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 && 
  k2 \[Omega]2 + k2^4 + 
    3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0

My code is

Assuming[
 k1 \[Omega]1 + k1^4 + 
    3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 && 
  k2 \[Omega]2 + k2^4 + 
    3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0, 
 Simplify[(\[Omega]1 + \[Omega]2) (k1 + k2) + (k1 + k2)^4 + 
   3 (l1 + l2)^2 + \[Gamma] (\[Omega]1 + \[Omega]2)^2 + \[Beta] (\
\[Omega]1 + \[Omega]2) (l1 + l2)]]

It is obvious that the conditions make

(k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 + 
  3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) + \[Gamma] (\[Omega]1^2 + \
\[Omega]2^2))" equal to zero. 
Therefore, P1 should become "\[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 2 \[Gamma] \[Omega]1 \[Omega]2 + 
 k1 (\[Omega]2 + 4 k2^3) + k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2

However, the output looks different. How can I do such thing?

It is also posted at https://mathematica.stackexchange.com/questions/289866/using-exisiting-conditions-to-simplify-the-certain-part-of-polynomial

Attachments:
POSTED BY: Lingfei Li
3 Replies

Here is a way:

P1 = \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 
   2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) + 
   k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2 +
   (k1^4 + k2^4 + k1 \[Omega]1 + k2 \[Omega]2 + 3 l1^2 + 
     3 l2^2 + \[Beta] (\[Omega]1 l1 + \[Omega]2 l2) +
     \[Gamma] (\[Omega]1^2 + \[Omega]2^2));
conditions = 
  k1 \[Omega]1 + k1^4 + 
     3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 && 
   k2 \[Omega]2 + k2^4 + 
     3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0;
goal = \[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 
   2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) + 
   k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 6 l1 l2;
subst = {k1^4 -> k14, k2^4 -> k24};
sol = Solve[conditions /. subst, {k14, k24}]
P1 /. subst /. sol[[1]] /. Map[Reverse, subst]
% == goal // Simplify
POSTED BY: Gianluca Gorni
Posted 11 months ago

Thanks for your reply. It is an enlightening answer. Syed also replied this question at StackExchange(see the link attached above) that might be a solution.

POSTED BY: Lingfei Li

I don't have a solution for you, but I can explain why you cannot expect the desired output from Simplify[]. Simplify[] uses certain transformations to minimize the Simplify`SimplifyCount[] of the transformed expression. The count for the actual output is 35 and for the desired output is 45. So, if the input is ever transformed to the desired output, the transformation would be rejected in favor of the actual output.

Assuming[
  k1 \[Omega]1 + k1^4 + 
     3 l1^2 + \[Gamma] \[Omega]1^2 + \[Beta] \[Omega]1 l1 == 0 && 
   k2 \[Omega]2 + k2^4 + 
     3 l2^2 + \[Gamma] \[Omega]2^2 + \[Beta] \[Omega]2 l2 == 0, 
  Simplify[(\[Omega]1 + \[Omega]2) (k1 + k2) + (k1 + k2)^4 + 
    3 (l1 + l2)^2 + \[Gamma] (\[Omega]1 + \[Omega]2)^2 + \[Beta] (\
\[Omega]1 + \[Omega]2) (l1 + l2)]] // Simplify`SimplifyCount
\[Beta] (\[Omega]1 l2 + \[Omega]2 l1) + 
  2 \[Gamma] \[Omega]1 \[Omega]2 + k1 (\[Omega]2 + 4 k2^3) + 
  k2 (\[Omega]1 + 4 k1^3) + 6 k1^2 k2^2 + 
  6 l1 l2 // Simplify`SimplifyCount    
(*
35
45
*)

There are options that might possibly be used (ComplexityFunction, TransformationFunctions) to attempt to get the desired output, but I don't have ideas about how to do that successfully.

POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract