Problem 1065

Summary: Query with G4 AnalyticalPolSolver
Product: Geant4 Reporter: vj <vijay.psaibola>
Component: global/HEPNumericsAssignee: Vladimir.Grichine
Status: RESOLVED FIXED    
Severity: trivial CC: asai
Priority: P5    
Version: 8.2   
Hardware: All   
OS: All   

Description vj 2009-05-15 11:12:37 CEST
Hello

I am trying to reuse the code in G4AnalyticalPolSolver, namely the functions  G4AnalyticalPolSolver::QuarticRoots and G4AnalyticalPolSolver::BiquadRoots. My question is very simple. Why does function BiQuadRoots have 5 input paramters, whereas a BiQuadratic equation should have only 4?
http://www.google.com/codesearch/p?hl=de#rmG-ZVXP6CY/geant4.8.2.p01/source/global/HEPNumerics/src/G4AnalyticalPolSolver.cc&q=QuarticRoots

I have coded both the functions taking your both functions as reference, as I need to solve a quartic equation in my project. I see that BiQuadRoots gives me correct answers for all the problems whereas QuarticRoots is erratic on some instances(both functions were given same input parameters)

Can you please answer?

Thanks in advance!
Comment 1 Vladimir.Grichine 2009-05-18 09:57:09 CEST
Known (at least with open source) quartic analytical solvers have numerical problems for certain configuration of roots. G4AnalyticalSolver was created for internal comparison of different quartic solvers in Geant4 addressed to geometrical calculations with torus. It is not recommended to be used for quartic root calculations.
Comment 2 vj 2009-05-18 10:42:06 CEST
Thanks for the answer. But the function BiQuadRoots seems to work just fine as a "Quartic" equation solver(though it shouldnt!). I ran it around 10,000 times with different co-efficients(a,b,c,d,e) which were generated randomly. There was not a single error!