From 2b0a16f56c78b9c57fc913c38d89206e13035b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 19 Aug 2018 09:41:24 +0300 Subject: [PATCH] Mathematica integration test Former-commit-id: 810941fd93cdf9d26668f74f9e2e5941e5102201 --- tests/gsl-int/quad.mathematica | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/gsl-int/quad.mathematica diff --git a/tests/gsl-int/quad.mathematica b/tests/gsl-int/quad.mathematica new file mode 100644 index 0000000..9aed206 --- /dev/null +++ b/tests/gsl-int/quad.mathematica @@ -0,0 +1,12 @@ +SigmaIntegrand[n_, k_, R_, x_] := Exp[-(R x)^2 + (k/(2 x))^2] x^(2 n) ; +l:= ReadList["values.in", Table[Number, {4}]]; +For[i = 1, i <= Length[l], i++, + p := l[[i]]; + n := p[[1]]; + k := p[[2]]; + r := p[[3]]; + eta := p[[4]]; + res := NIntegrate[SigmaIntegrand[n, k, r, x], {x,eta,Infinity}]; + Print[InputForm[n], " ", CForm[k], " ", CForm[r], " ", CForm[res]] +]; +