- #1
aheight
- 321
- 109
I am working with a polynomial and wish to integrate over one of it's branch surfaces with high precision. The function is:
## -z^2 + z^3 + w (-4 z + 3 z^2) + w^3 (-2 + 8 z + 4 z^2 - 4 z^3) + w^2 (-z^3 - 9 z^4) + w^4 (6 - 8 z^2 + 7 z^3 + 8 z^4)=0##
So I first solve the associated differential equation to obtain a trace over ##w(z)## . This is theCentralTrace[t]. Next, in order to obtain precise values of the function over this trace, I solve for the roots over the trace. Then I can compare the trace values to the list of roots and get a more precise value of the function over the trace. As written, I can plot myFunction[t]. However, when I attempt to integrate myFunction[t] via:
the conditional in the code returns an unevaluated 't' so the Position fails. The function getDigits in the code simply converts the floating point numbers to integer sequences so I can make an exact comparison to a particular precision (5 in the code). I was wondering if someone could help me with this.
Thanks.
## -z^2 + z^3 + w (-4 z + 3 z^2) + w^3 (-2 + 8 z + 4 z^2 - 4 z^3) + w^2 (-z^3 - 9 z^4) + w^4 (6 - 8 z^2 + 7 z^3 + 8 z^4)=0##
So I first solve the associated differential equation to obtain a trace over ##w(z)## . This is theCentralTrace[t]. Next, in order to obtain precise values of the function over this trace, I solve for the roots over the trace. Then I can compare the trace values to the list of roots and get a more precise value of the function over the trace. As written, I can plot myFunction[t]. However, when I attempt to integrate myFunction[t] via:
Mathematica:
NIntegrate[myFunction[t],{t,tStart,tEnd}]
the conditional in the code returns an unevaluated 't' so the Position fails. The function getDigits in the code simply converts the floating point numbers to integer sequences so I can make an exact comparison to a particular precision (5 in the code). I was wondering if someone could help me with this.
Thanks.
Mathematica:
myFunction[t_] := Module[{cDigits, fVal,fDigits, pos, cVal},
cVal = theCentralTrace[t];
cDigits = getDigits[cVal, 5];
fVal = w /. NSolve[theFunction == 0 /. z -> rnorm Exp[I t], w];
fDigits = getDigits[fVal, 5];
pos = Position[fDigits, cDigits[[1]]];
If[Length[pos] == 0,
Print[t];
Abort[];
];
Re[fVal[[pos[[1, 1]]]]]
];