# Tag Info

5

q[r_] := Piecewise[{{25/(0.1*1), r < 0.1}, {25/r, r >= 0.1}}] phi[r_, t_] := (Pi/2) + q[r]*t v[r_, t_] := q[r]*r*Cos[phi[r, t]] s[x_] := Piecewise[{{-1, x < 0}, {1, x >= 0}}] f[x_, y_] := s[x]*v[Sqrt[x^2 + y^2], ArcTan[y/x]/q[Sqrt[x^2 + y^2]]] Here are two ways to go: 1 NIntegrate[Boole[(23 <= f[x, y] <= 24 && x^2 + y^2 <= ...

4

How about pl = ContourPlot[f[x, y], {x, -1, 1}, {y, -1, 1}, RegionFunction -> Function[{x, y}, x^2 + y^2 < 1], PlotPoints -> 25,ContourShading -> False] Then lines = Cases[pl // Normal, Line[pts_] :> List[pts], Infinity]; lines = Select[lines, Length[#[[1]]] > 20 &]; lines = Map[Flatten[Transpose[#], 1] &, lines]; ...

2

Ok, here is my stab at understanding the issue. To begin, this is how I am interpreting the integral (it is always a good idea to clearly mark the dependence of your symbols): $$\frac{\int_0^{\infty } i(q)\,q^2 \cos (q\,x) \, dq}{\int_0^{\infty } i(q) \, q^2 \, dq}$$ where $i(q)$ is the intensity as a function of $q$. So, lets interpolate over the data ...

2

Perhaps this will help:- eqn = a Integrate[Exp[-s^2]/(s - c x)^2, {s, -Infinity, Infinity}, Assumptions -> Im[c x] != 0] + b Integrate[Exp[-s^2]/(s - d x)^2, {s, -Infinity, Infinity}, Assumptions -> Im[d x] != 0]; a = 1.5; b = 2; c = 0.8; d = 1; Plot[eqn, {x, -1000, 1000}]

2

I don't know your speed or precision requirements but here's an approach that yields a low precision estimate to your 50 sphere problem in a few seconds. It's based on the fact that the surface area of a sphere can be computed via $$\int_0^{2\pi}\int_0^{\pi} \sin(\varphi) \, d\varphi \, d\theta.$$ We'll simply write a test function to determine when a point ...

2

This question appears to be off-topic because it is about a singularity in the mathematical model and not about Mathematica; further the OP has been absent for over a year. For example: l = 3; zsi = 0.81; zse = 1.5; vsi = -1.5; vse = 0.5; z0 = 0.01; Block[{zs = zsi, vs = vsi}, sol = NDSolve[{Eqn1 == 0, Eqn2 == 0, z[0] == zs, v[0] == vs, z'[0] == 0, ...

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