2
$\begingroup$

I have two real polynomials that depend in variables (xi1, xi2) and parameters (eps, e2). I apply the following complexification:

w(xi1, xi2, eps, e2) = gamma1(xi1, xi2, eps, e2) + I gamma2(xi1, xi2, eps, e2)

Now I wish to define the variable z = xi1 + I xi2, and find a neat expression for w in terms of z and it's conjugate, zc, as follows:

w(z, zc) = c30 z^3 + c21 z^2 zc+ c12 z zc^2 + c03 zc^3 + o(3)

In order to find the coefficients.

How may I ask this to Mathematica?

---------------------------- actual code -----------------------

gamma1[xi1,xi2,eps,e2]=(0. - 1.72945 I) e2 (-0.3567 xi1 + 0.229 xi2 + 0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 - (0. + 0.5 I) (eps (0.5929 xi1 - 0.3806 xi2 - 1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);
gamma2[xi1,xi2,eps,e2]=(-1.72945 + 0. I) e2 (-0.3567 xi1 + 0.229 xi2 + 0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 + (0.5 + 0. I) (eps (0.5929 xi1 - 0.3806 xi2 - 1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);

w[xi1, xi2, eps, e2] = gamma1[xi1, xi2, eps, e2] + I gamma2 [xi1, xi2, eps, e2];
$\endgroup$
3
  • $\begingroup$ Clarifying the question, providing the polynomials, and writing the mathematics in Mathematica format will elicit more help from readers, I believe. $\endgroup$
    – bbgodfrey
    Commented Dec 29, 2015 at 14:24
  • $\begingroup$ Hi! The polynomials I'm working on are very complicated, since they are obtained with several functions. I haven't posted them to not make the question look too complicated. Anyhow, I'll post the equations at the end of my question. Thank you for your advice. $\endgroup$ Commented Dec 29, 2015 at 14:46
  • $\begingroup$ I've written the polynomials explicitly, throwing away all the useless parts of the code. $\endgroup$ Commented Dec 29, 2015 at 15:01

2 Answers 2

3
$\begingroup$

Start with the given definitions.

gamma1[xi1, xi2, eps, 
   e2] = (0. - 
      1.72945 I) e2 (-0.3567 xi1 + 0.229 xi2 + 
       0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 - (0. + 
      0.5 I) (eps (0.5929 xi1 - 0.3806 xi2 - 
         1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 
      38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 
          0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);
gamma2[xi1, xi2, eps, 
   e2] = (-1.72945 + 
      0. I) e2 (-0.3567 xi1 + 0.229 xi2 + 
       0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 + (0.5 + 
      0. I) (eps (0.5929 xi1 - 0.3806 xi2 - 
         1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 
      38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 
          0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);
w[xi1, xi2, eps, e2] = 
  gamma1[xi1, xi2, eps, e2] + I gamma2[xi1, xi2, eps, e2];

Now form a Groebner basis from the reducing relations, ordered in such a way that the x variables are "larger" than the z variables. Use that to reduce the expression of interest.

gb = GroebnerBasis[{xi1+I*xi2-z, xi1-I*xi2-zc}, {xi1,xi2,zc,z}];
Expand[PolynomialReduce[w[xi1,xi2,eps,e2], gb, {xi1,xi2,zc,z}][[2]]]

(* Out[546]= (-0.0326007293462 - 
    0.00464029976304 I) e2 z^3 - (0.0369688588939 + 
    0.0632291173231 I) e2 eps z^3 + (0.0197005770425 - 
    0.0506048635599 I) e2 eps^2 z^3 + (0.012824498915 - 
    0.00395607930627 I) e2 eps^3 z^3 - (0.0533696753722 - 
    0.0831308436911 I) e2 z^2 zc - (0.122052644558 - 
    0.0838872079541 I) e2 eps z^2 zc - (0.0964865190488 - 
    0.0524172122716 I) e2 eps^2 z^2 zc - (0.0400623552714 - 
    0.00400907884547 I) e2 eps^3 z^2 zc + (0.0533696753722 + 
    0.0831308436911 I) e2 z zc^2 + (0.122052644558 + 
    0.0838872079541 I) e2 eps z zc^2 + (0.0964865190488 + 
    0.0524172122716 I) e2 eps^2 z zc^2 + (0.0400623552714 + 
    0.00400907884547 I) e2 eps^3 z zc^2 + (0.0326007293462 - 
    0.00464029976304 I) e2 zc^3 + (0.0369688588939 - 
    0.0632291173231 I) e2 eps zc^3 - (0.0197005770425 + 
    0.0506048635599 I) e2 eps^2 zc^3 - (0.012824498915 + 
    0.00395607930627 I) e2 eps^3 zc^3 *)
$\endgroup$
1
  • $\begingroup$ Smart! I think I need to take a better look at this GroebnerBasis function! $\endgroup$ Commented Dec 29, 2015 at 19:23
3
$\begingroup$

You have,

gamma1[xi1_, xi2_] = (0. - 1.72945 I) e2 (-0.3567 xi1 + 0.229 xi2 + 
       0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 - (0. + 
      0.5 I) (eps (0.5929 xi1 - 0.3806 xi2 - 
         1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 
      38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 
          0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);
gamma2[xi1_, xi2_] = (-1.72945 + 0. I) e2 (-0.3567 xi1 + 0.229 xi2 + 
       0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3 + (0.5 + 
      0. I) (eps (0.5929 xi1 - 0.3806 xi2 - 
         1.2296 (-0.0423 eps xi1 + 0.4227 eps xi2)) + 
      38.4563 e2 (-0.3567 xi1 + 0.229 xi2 + 
          0.7398 (-0.0423 eps xi1 + 0.4227 eps xi2))^3);

Just rewrite your variables in terms of z and zc,

Solve[{z == xi1 + I xi2, zc == xi1 - I xi2}, {xi1, xi2}]
(* {{xi1 -> (z + zc)/2, xi2 -> -(1/2) I (z - zc)}} *)

Then substitute them into the original expression:

gamma1[(z + zc)/2, -(1/2) I (z - zc)] // FullSimplify
gamma2[(z + zc)/2, -(1/2) I (z - zc)] // FullSimplify
(* (0.00641225 - 0.00197804 I) e2 ((0.838054 - 1.0568 I) z + 
    1. eps z - (0.612024 + 1.20191 I) zc - (0.98017 + 
       0.198158 I) eps zc)^3 - (0. + 
    0.5 I) (eps (((0.29645 + 
            0.1903 I) + (0.026006 + 0.259876 I) eps) z + ((0.29645 - 
            0.1903 I) + (0.026006 - 
             0.259876 I) eps) zc) + (0.043984 + 
       0.142584 I) e2 ((0.838054 - 1.0568 I) z + 
       1. eps z - (0.612024 + 1.20191 I) zc - (0.98017 + 
          0.198158 I) eps zc)^3) *)
(* (-0.00197804 - 0.00641225 I) e2 ((0.838054 - 1.0568 I) z + 
    1. eps z - (0.612024 + 1.20191 I) zc - (0.98017 + 
       0.198158 I) eps zc)^3 + (0.5 + 
    0. I) (eps (((0.29645 + 
            0.1903 I) + (0.026006 + 0.259876 I) eps) z + ((0.29645 - 
            0.1903 I) + (0.026006 - 
             0.259876 I) eps) zc) + (0.043984 + 
       0.142584 I) e2 ((0.838054 - 1.0568 I) z + 
       1. eps z - (0.612024 + 1.20191 I) zc - (0.98017 + 
          0.198158 I) eps zc)^3) *)

That's the basic strategy, but you want a Taylor series in z and zc for w, so let's try this:

Normal[
 Series[gamma1[(z + zc)/2, -(1/2) I (z - zc)] + 
   I gamma2[(z + zc)/2, -(1/2) I (z - zc)], {z, 0, 3}, {zc, 0, 3}]]
(* ((-0.0326007 - 0.0046403 I) e2 - (0.0369689 + 
       0.0632291 I) e2 eps + (0.0197006 - 
       0.0506049 I) e2 eps^2 + (0.0128245 - 
       0.00395608 I) e2 eps^3) z^3 + ((-0.0533697 + 
       0.0831308 I) e2 - (0.122053 - 
       0.0838872 I) e2 eps - (0.0964865 - 
       0.0524172 I) e2 eps^2 - (0.0400624 - 
       0.00400908 I) e2 eps^3) z^2 zc + ((0.0533697 + 
       0.0831308 I) e2 + (0.122053 + 
       0.0838872 I) e2 eps + (0.0964865 + 
       0.0524172 I) e2 eps^2 + (0.0400624 + 
       0.00400908 I) e2 eps^3) z zc^2 + ((0.0326007 - 
       0.0046403 I) e2 + (0.0369689 - 
       0.0632291 I) e2 eps - (0.0197006 + 
       0.0506049 I) e2 eps^2 - (0.0128245 + 
       0.00395608 I) e2 eps^3) zc^3 *)

But this isn't exactly what you want, it has terms like z^2 zc^2, so if you want it to match your expression exactly, you should use the SeriesCoefficient function.

wz = gamma1[(z + zc)/2, -(1/2) I (z - zc)] + 
   I gamma2[(z + zc)/2, -(1/2) I (z - zc)];
Total[SeriesCoefficient[
     wz, {z, 0, #1}, {zc, 0, #2}] z^#1 zc^#2 & @@@ {{3, 0}, {2, 
    1}, {1, 2}, {0, 3}}]
(* (0.0128245 - 
    0.00395608 I) ((-2.21927 - 1.04643 I) e2 - (1.24345 + 
       5.31391 I) e2 eps + (2.51416 - 3.17039 I) e2 eps^2 + (1. + 
       0. I) e2 eps^3) z^3 + ((-0.0533697 + 
       0.0831308 I) e2 - (0.122053 - 
       0.0838872 I) e2 eps - (0.0964865 - 
       0.0524172 I) e2 eps^2 - (0.0400624 - 
       0.00400908 I) e2 eps^3) z^2 zc + ((0.0533697 + 
       0.0831308 I) e2 + (0.122053 + 
       0.0838872 I) e2 eps + (0.0964865 + 
       0.0524172 I) e2 eps^2 + (0.0400624 + 
       0.00400908 I) e2 eps^3) z zc^2 + ((0.0326007 - 
       0.0046403 I) e2 + (0.0369689 - 
       0.0632291 I) e2 eps - (0.0197006 + 
       0.0506049 I) e2 eps^2 - (0.0128245 + 
       0.00395608 I) e2 eps^3) zc^3 *)
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.