New answers tagged

2

Here is some code to quickly compare the data points you have to the interpolation results using different interpolation orders: pts = {{800.00000000000000, 4.2872055064128674*10^-14}, {800.33333333333326, 2.4243226146602945*10^-14}, {800.66666666666663, 4.2221723933087801*10^-15}, {801.00000000000000, -6.0951356556178097*10^-15}, ...


2

Why not eliminate M from equations and solve for T. eli = Eliminate[ee == e[T, M] && nn == n[T, M], M]; TT[ee_, nn_] = T /. Solve[eli && nn > 0 && ee > 0 && 0 < T, T, Reals] // FullSimplify {* {ConditionalExpression[ Root[-108000 ee^3 + 1476225 nn^4 \[Pi]^2 + 1093500 ee nn^2 \[Pi]^2 #1^2 + ...


3

Clear["Global`*"] Nf = 5/2; p0 = ((16 + 21/2 Nf)*π^2)/90; ζ = M/T; p[T_, M_] = T^4 (p0 + Nf (1/18 (ζ)^2 + 1/(324*π^2) (ζ)^4)) // Simplify; e[T_, M_] = 3 p[T, M] // Simplify; n[T_, M_] = D[p[T, M], M] // Simplify; Data for multidimensional interpolation needs to be in the form: {{{x1, y1,…}, f1}, {{x2, y2,…}, f2},…}. Consequently, use EDIT: Increased ...


1

I solved the problem by using NIntegrate and defining the AccuracyGoal and the MinRecursion option for this function. data2 = Prepend[0]@ Table[NIntegrate[pBF[z] z, {z, (j - 1) dz, j dz}, MinRecursion -> 9, AccuracyGoal -> 5], {j, n}]; The interpolation is also working as seen in the picture:


4

If all you want to do is integrate the function, one piece at a time, you can try: n = 25; (* number of chunks *) pBF = FunctionInterpolation[ Piecewise[{{9890/3, 500 <= z <= 800}}], {z, 0, 1300}, InterpolationOrder -> 1 ]; data = Table[Integrate[pBF[z], {z, (i - 1) 1300/n, i 1300/n}], {i, n}]; Total[data] ListPlot[ Accumulate[data] ] (* ...


2

In Mathematica, there is a difference between Set (=) and SetDelayed (:=). SetDelayed is often used when you're defining a function because you want to define it now but not actually evaluate it until you have a number to plug into it, and you will probably evaluate it repeatedly. Set means that the code will be executed immediately and the result stored in ...


3

Slightly different approach: int = Interpolation[list1, InterpolationOrder -> 3] Using this to compute values for new points: int[Range[0, 5, 0.25]] {0.00111948, 0.00112373, 0.00112692, 0.00112875, 0.00112894, \ 0.00112721, 0.00112326, 0.00111384, 0.00110141, 0.00109074, \ 0.00108935, 0.00109937, 0.00110931, 0.00111407, 0.0011078, \ 0.00109048,...


2

y = Fit[list1, {1, x, x^2, x^3}, x]; y /. x -> Range[0, 5, .25] { 0.00113979, 0.00111488, 0.00109939, 0.00109181, 0.00109067, 0.00109447, 0.00110173, 0.00111096, 0.00112068, 0.0011294, 0.00113563, 0.00113788, 0.00113467, 0.00112451, 0.00110591, 0.0010774, 0.00103747, 0.000984644, 0.000917436, 0.000834359, 0.000733924} Your original points in red, ...


4

I use the code from my answer on Solving partial differential equation involving Hilbert transform We put $\mu =0,\sigma^2 =1/2$,L=Infinity,n[0,x]==Cos[x] n = Sum[f[m][t] Exp[I m x], {m, -Infinity, Infinity}] Then the integral is calculated as Integrate[ Exp[-s^2] Exp[I m s]/Sqrt[Pi], {s, -Infinity, Infinity}] (*Out[]= E^(-(m^2/4))*) Now we can make ...


Top 50 recent answers are included