Group Abstract Group Abstract

Message Boards Message Boards

Ordering of solutions for quartics when using Root

Posted 12 years ago

Hello all,

There was a discussion recently regarding quartics and here I want to extend it a little bit with regards to Root objects:

Root[#1^4 A1 + #1^3 A2 + #1^2 A3 + #1 A4 + A5 &, n_root]

The problem I have to solve is a quartic equation in which coefficients vary based on problem input - range for one of the model's parameters. The equation has 4 different roots (related to four different physical quantities) and again based on the input they vary throughout a range of model's parameter as follows:

  1. Four real roots two real
  2. Two complex roots
  3. Four complex roots.

Each root is assigned to a separate variable and in order to solve the problem, roots have to be consistent with variables (certain physical quantities), so to say root #1 should be always in position #1 of Root no matter if it is complex or real. Root numbers solutions from smallest to biggest and that works fine until roots start to become complex, then Root changes its' positions and solution is not physical anymore. Can anyone advise on that?

POSTED BY: Yuriy Ivanov
2 Replies

You may need to reorder on the fly, when roots cross from one of your configurations to another. This happens only where pairs of roots coincide. This in turn happens only when the discriminant vanishes, and this is a polynomial in the parameters.

In[156]:= poly = Array[a, 5, 0].x^Range[0, 4]

(* Out[156]= a[0] + x a[1] + x^2 a[2] + x^3 a[3] + x^4 a[4] *)

In[157]:= disc = Discriminant[poly, x]

(* Out[157]= 
a[1]^2 a[2]^2 a[3]^2 - 4 a[0] a[2]^3 a[3]^2 - 4 a[1]^3 a[3]^3 + 
 18 a[0] a[1] a[2] a[3]^3 - 27 a[0]^2 a[3]^4 - 4 a[1]^2 a[2]^3 a[4] + 
 16 a[0] a[2]^4 a[4] + 18 a[1]^3 a[2] a[3] a[4] - 
 80 a[0] a[1] a[2]^2 a[3] a[4] - 6 a[0] a[1]^2 a[3]^2 a[4] + 
 144 a[0]^2 a[2] a[3]^2 a[4] - 27 a[1]^4 a[4]^2 + 
 144 a[0] a[1]^2 a[2] a[4]^2 - 128 a[0]^2 a[2]^2 a[4]^2 - 
 192 a[0]^2 a[1] a[3] a[4]^2 + 256 a[0]^3 a[4]^3 *)

So the condition to check is disc==0. At such points (in parameter space) pairs of roots can coalesce and you may need to reorder the Root objects to suit your needs.

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