New answers tagged precision-and-accuracy
2
Maybe with some or all of these changes:
ReImPlot[ (* the solution is complex-valued *)
id /. FindRoot[(id - (Cap*W*mu*(n*vth)^2)/(7*10^-6)*(PolyLog[
2, -Exp[(vd - id - vg + vt)/(n*vth)]] -
PolyLog[2, Exp[(id - vg + vt)/(n*vth)]])),
{id, Sign[vd] 10^6} (* better starting point *)
],
{vd, -10^8, 10^8}, (* ...
6
Don't have the time to fully answer this yet, but here's a debug tool I developed previously. First off we can figure out how OBJ is exported
getFormatExportData["OBJ"]
{"FormatName" -> "OBJ", "DefaultElement" -> "Graphics3D",
"DocumentedElements" -> None, "Function" -> ...
0
Why CSV? Why not mx?
Export["tab.mx", tab]
tabImport = Import["tab.mx"];
InputForm@tab == InputForm@tabImport
(* True *)
3
Export uses CForm under the hood for formatting of real numbers:
TracePrint[ExportString[.2`40, "CSV"], _ToString, TraceAction->Print@*FullForm]
HoldForm[ToString[CForm[0.2`40.],InputForm]]
"0.2"
So, one idea is to temporarily modify the CForm formatting of reals:
Internal`InheritedBlock[{CForm},
Unprotect[CForm];
CForm /: ...
1
I think a Chebyshev method could be adapted to your workflow. I don't know what your workflow is, so I don't have any advice about that. Here's a comparison with NIntegrate and @Carl Woll's example.
(ClearAll[f];
f0[x_] := ExpIntegralE[-5, x] - 5! x^-6;
f[0] = SeriesCoefficient[f0[x], {x, 0, 0}];
f[0.] = N@f[0];
f[x_] = f0[x];
pp = 16 (* order*);
...
numerical-integration performance-tuning special-functions precision-and-accuracy arbitrary-precision
2
One idea is to deform the integration contour around the singularity. For your example:
f[x_] := ExpIntegralE[-5, x] - 5! x^-6
NIntegrate[f[x], {x, -1, I, 1}]
-0.3767 - 2.02699*10^-13 I
We can check by integrating the series approximation:
g[x_] = Normal @ Series[f[x], {x, 0, 12}]
NIntegrate[g[x], {x, -1, 1}]
-(1/6) + x/7 - x^2/16 + x^3/54 - x^4/240 + x^5/...
numerical-integration performance-tuning special-functions precision-and-accuracy arbitrary-precision
Top 50 recent answers are included
Related Tags
precision-and-accuracy × 621numerics × 137
numerical-integration × 88
plotting × 66
machine-precision × 63
arbitrary-precision × 46
differential-equations × 37
equation-solving × 32
special-functions × 32
warning-messages × 23
matrix × 21
numerical-value × 19
mathematical-optimization × 16
linear-algebra × 16
number-representation × 14
calculus-and-analysis × 13
functions × 10
output-formatting × 10
bugs × 9
summation × 9
list-manipulation × 8
performance-tuning × 8
export × 8
eigenvalues × 8
complex × 7