# Question:order of solutions to degree 4 polynomial

## Question:order of solutions to degree 4 polynomial

Maple
I have the following code snippet which uses solve to get the 4 solutions to a quartic equation. In my application I must know which solution is which, for they each have a specific placement in later calculations. I know that most of Maple's datasets use memory address as their method of sorting, and therefore each run can give a different order to the results. Is this also true for solve? I need to know a way which the order of the solutions will always be constant. (sorting by returned value will not suffice) WaveEQDet := proc(layer,eV) local E1, E2; > E1:=Epp1(layerelementtable[layer], eV); > E2:=Epp2(layerelementtable[layer], eV); > E1*NZ^4 - NZ^2*(2*E1^2) + E1^3 - E1*E2^2=0; > end proc; WaveSols := (layer,eV) -> solve(WaveEQDet(layer,eV),NZ); NZJ[1] := (layer,eV) -> WaveSols(layer,eV)[2]: NZJ[2] := (layer,eV) -> WaveSols(layer,eV)[1]: NZJ[3] := (layer,eV) -> WaveSols(layer,eV)[4]: NZJ[4] := (layer,eV) -> WaveSols(layer,eV)[3]: thanks for your help James
﻿