Mathematica integration test

Former-commit-id: 810941fd93cdf9d26668f74f9e2e5941e5102201
This commit is contained in:
Marek Nečada 2018-08-19 09:41:24 +03:00
parent 3b89f6fbfc
commit 2b0a16f56c
1 changed files with 12 additions and 0 deletions

View File

@ -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]]
];