# Tag Info

9

This is the best I can come up with, I'm very interested to see if anyone else has a better solution. The idea here is to just run through values of $t$, and do a DFT on $$E(t+\frac{\tau}{2}) E ^*(t-\frac{\tau}{2})$$ So I set up the time/frequency resolution for my DFT, using a dt value I know gives a broad enough spectrum, dt = 0.025; num = 2^14; df = ...

8

I'm not confident of this answer, but it seems worth presenting: NIntegrate[2^3/((x - s)^2 + (y - t)^2 + (z - u)^2), {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, {s, 0, x}, {t, 0, y}, {u, 0, z}, AccuracyGoal -> 16] // Quiet (* 5.63378 *) The basic insight is that each "paired" integrations (e.g., $x$ and $s$; $y$ and $t$; $z$ and $u$) is over the unit square. ...

7

I'm 95% confident that David G. Stork's answer is in the ballpark: n = 100000000; x = RandomReal[1, n]; y = RandomReal[1, n]; z = RandomReal[1, n]; s = RandomReal[1, n]; t = RandomReal[1, n]; u = RandomReal[1, n]; r = 1/((x - s)^2 + (y - t)^2 + (z - u)^2); xbar = Mean[r]; xsd = StandardDeviation[r]; lowerCL = xbar - 1.96 xsd/n^0.5; upperCL = xbar + 1.96 ...

6

To avoid the error encounterd in the Question, combine the two NIntegrate into one. Note also that the integrand is singular for p^2 + q^2 >= 2. F[p_, q_] := NIntegrate[1/(q^2 y (1 - y) + p^2 z (1 - z) - 1), {z, 0, 1}, {y, 0, 1 - z}] Plot3D[F[p, q], {p, -Sqrt[2], Sqrt[2]}, {q, -Sqrt[2], Sqrt[2]}, AxesLabel -> {p, q, F}] Note that the order of the ...

6

Eliminate the unnecessary force* variables, which forces NDSolve to use the DAE solver, and just solve it as an ODE. Then you can use higher precision etc., if desired, but in this case you get the same solution using machine precision as higher precision. newsys = ComplexExpand@Eliminate[Rationalize[#, 0] &@{ ...

5

It seems people misinterpreted the settings of "TrapezoidalRule". Allow me to set the record straight. First, to get a "pure" trapezoidal rule evaluation, one should thwart the automatic interval splitting that is usually done by NIntegrate[]. This means a setting of MaxRecursion -> 0. Second, the "Points" setting has also not been read right. In fact, ...

4

A somewhat redundant answer to Michael E2's, but providing the simplification. The problem is not that the numbers are not scaled. (Though it is nice to scale your problems when possible.) The problem is the intermediate forces. You should eliminate them, as well as simplifying the initial conditions. I named your constants for clarity: NDSolve[{ ...

4

I am by no means expert in numerical integration techniques, but using the simplicistic rule of thumb high dimensional integrals -> Monte Carlo techniques work better I tried using a Monte Carlo method for the integration (you can find here an explanation of all numerical techniques employed by Mathematica). Using this and incrementing MaxPoint to around 107 ...

3

f can be computed as follows. s = NDSolveValue[{f'''[y] + f[y] f''[y] + 4 - (f'[y])^2 == 0, f[0] == 0, f'[0] == 0, f'[5] == 2}, f, {y, 0, 5}, Method -> "Shooting", "StartingInitialConditions" -> {f[0] == 0, f'[0] == 0, f''[0] == 3.48}}]; Plot[s[y], {y, 0, 5}, AxesLabel -> {y, f}] Plot[s'[y], {y, 0, 5}, PlotRange -> {-1, 3}, AxesLabel ...

3

Change the definitions so that the step output is a list: CRK4[]["Step"[rhs_, h_, t_, x_, xp_]] := Module[{k0, k1, k2, k3}, k0 = h xp; k1 = h rhs[t + h/2, x + k0/2]; k2 = h rhs[t + h/2, x + k1/2]; k3 = h rhs[t + h, x + k2]; {(k0 + 2 k1 + 2 k2 + k3)/6}] (* <-- List *) CRK4[___]["StepInput"] = {"F"["T", "X"], "H", "T", "X", "XP"}; ...

3

The integrand has singularities occasionally when the coordinates are a multiple of Pi/4. If we subdivide the domain at multiples of Pi/4, we seem to get divergence. integrand = ((2 + Cos[t]) (2 + Cos[u]))/( ((2 + Cos[t]) Cos[s] - (2 + Cos[u]) Cos[v])^2 + ((2 + Cos[t]) Sin[s] - (2 + Cos[u]) Sin[v])^2 + (Sin[t] - Sin[u])^2); ...

2

Local adaptive method gives 1423.97 without errors NIntegrate[(2 + Cos[t1]) (2 + Cos[t2])/f[t1, s1, t2, s2], {t1, 0, 2 Pi}, {s1, 0, 2 Pi}, {t2, 0, 2 Pi}, {s2, 0, 2 Pi}, Method -> "LocalAdaptive"] (* 1423.97 *) Global adaptive method also converges to this value with option Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> bigNumber} but it ...

2

Try list = {}; For[t = 0; x = -10; v = 1; f = -0, 015647; t < 50, t += d; j = f; d = 0.01; x = x + v*d + (f*d^2)/2; f = -U'[x]; AppendTo[list, {v, f}]; v = v + (j + f)*d/2]; Then ListLinePlot[ Transpose @ list, GridLines -> Automatic, ImageSize -> Large, PlotLegends -> {"v", "f"}]

2

Clear[f1, f2] Your first integral can be done symbolicly. This will speed up the final integration. f1[y_, x_] = Integrate[Exp[z], {z, x - y, x + y}] (* 2 E^x Sinh[y] *) f2[x_?NumericQ] := NIntegrate[Exp[f1[y, x]], {y, -Infinity, x}] Plot[f2[x], {x, -10, Pi/4}, PlotRange -> All]

2

Clear[f] f[t_] = Assuming[{t > 0}, t^4*Integrate[x^3/(Exp[x] - 1), {x, 0, 1/t}] // Simplify] (* -(1/4) + I*Pi*t - (Pi^4*t^4)/15 + t*Log[-1 + E^(1/t)] + 3*t^2*PolyLog[2, E^(1/t)] - 6*t^3*PolyLog[3, E^(1/t)] + 6*t^4*PolyLog[4, E^(1/t)] *) tmax = 1.5; Show[ Plot[f[t], {t, 0, tmax}, PlotStyle -> Blue, PlotLegends -> ...

1

Here is a way to plot the sampling points of the integration process. (If this is what it is asked.) First using the functions Sow and Reap and the option EvaluationMonitor we gather the sampling points: Block[{x = 0.2, t = 0.2, m = 0.2}, res = Reap[ NIntegrate[ f[y] (2. Sin[(x^2 + y^2)/(8. (t - r)) + \[Pi]/ 4] Cos[(x y)/(4. (t - ...

1

If $f(T) = T^4\int_0^{1/T} \frac{x^3}{e^x-1}dx$. Then you can differentiate it by parts which gives you Cv[t_] := -1/(t*(Exp[1/t] - 1)) + (4*t^3*NIntegrate[x^3/(Exp[x] - 1), {x, 0, 1/t}]) Plot[Cv[t], {t, 0, 1}, Frame -> True]

1

In the course of trying to solve this problem, I have run a number of physical and numerical parameters. The most striking behavior that I observed is extreme sensitivity of the results to those parameters. This suggests that the system is chaotic, especially for large q1b. To illustrate this extreme sensitivity, compute ϕ for fixed values of x and y: sc ...

1

Following suggestion above, and dropping 0.0027, as well introducing some additional parameters we get Intf[(phi_)?NumericQ, (a_)?NumericQ, (b_)?NumericQ] := NIntegrate[ Sin[phi*Pi]/(a*Exp[(-b)*w] + Exp[239*w] - Cos[phi*Pi]), {w, 0, 0.1}] Manipulate[ListLinePlot[Table[{t, Intf[t, e, b]}, {t, 0.01, 1, 0.05}]], {e, 0.5, 1.5}, {b, 100, 400}] ...

1

As shown by bbgodfrey , NIntegrate can solve your problem, but I just want to add, Integrate can actually handle InterpolatingFunction: int[t_] = Integrate[y1[t] /. S1, t] The output is an InterpolatingFunction representing the definite integral of $y_1(t)$ over $[0,t]$. The advantage of this approach is, you don't need to integrate again and again if you ...

1

In my experience results from NDSolve are generally quite reliable. When there is doubt I would try to understand what the issue is by solving a smaller but similar problem, symbolically if possible. For the example you posed, here is what DSolve gives for specific values of a, b and n. In[35]:= dsol = With[{a = 1, b = 1, n = 1, int = ...

1

You have not specified the region of interest. But suppose it is that region between the two rings (say of radius 3 & 5 ), with appropriate units taken into account, we examine the first eigenfunction using {vals, funs} = NDEigensystem[{-Laplacian[u[x, y], {x, y}], DirichletCondition[u[x, y] == 0., x == 0]}, u[x, y], Element[{x, y}, ...

Only top voted, non community-wiki answers of a minimum length are eligible