Tag Info

Hot answers tagged

6

Just consider the first integral. expr = x (A Ac (m2 + m1 (-1 + x)) + V Vc (m1 + m2 - m1 x))/(8 π^2 (-mh^2 (-1 + x) + (m2^2 + m1^2 (-1 + x)) x)); denominator = Collect[Denominator[expr], x] 8 mh^2 π^2 + 8 (-m1^2 + m2^2 - mh^2) π^2 x + 8 m1^2 π^2 x^2 It has two singular points. sol = Solve[denominator == 0, x] // Simplify If the singular ...


4

The whole integration is complicated and I can not get it once like you. I break it down as follows: f = (1 - ((2 x/(1 - 2 x))*Cos[z])^2)^(1/2) and then do normal unbounded integration int1 = Integrate[f,z] and then find the bounded integration by simply substitute the boundary values of z int11 = (int1 /. z -> Pi) - int1 /. z -> 0 and then do ...


3

Here is another way that uses the Graphics object directly: gr = ParametricPlot3D[{Cos[u], Sin[u] + Cos[v], Sin[v]}, {u, 0, 2 Pi}, {v, -Pi, Pi}] We discretize the graphics using DiscretizeGraphics mr = DiscretizeGraphics[Normal[gr /. (Lighting -> _) :> Lighting -> Automatic]] We compute the convex hull hull = ...


3

Mathematica 10 now supports the Finite Element Method for certain classes of PDEs. Documentation: Reference Detailed user guide Advanced documentation on FEM programming The FEM related functions are in NDSolve`FEM` and can be made directly accessible using Needs["NDSolve`FEM`"]


3

The problem seems to be that the values are very small, smaller than can be represented by a machine numbers. Perhaps NIntegrate decides the answer is zero. You can use arbitrary-precision numbers, which you can do with the WorkingPrecision option, to get nonzero values. a2 = 525/10; u = 2*i - 1/2; u1 = u*Pi/2; u2 = u1/a2; u4 = -1/5^2; Table[NIntegrate[ ...


2

In Version 10, once the points have been obtained as per user21's approach, we can tetrahedralize them directly using DelaunayMesh pf = {Cos[u], Sin[u] + Cos[v], Sin[v]}; pp = ParametricPlot3D[pf, {u, 0, 2 Pi}, {v, -Pi, Pi}] data = Reap[ParametricPlot3D[Sow[pf], {u, 0, 2 Pi}, {v, -Pi, Pi}]][[2, 1]]; pts = Cases[data, {_?NumericQ, _?NumericQ, ...


2

In any attempt to debug a code - make it as simple as possible. Neither the For-loops nor the Export make things easier. Try to break things down - if I evaluate f[0.1, 0.1, 0.1, -1] I already get nonsense. One (!) of the problems is the definition of the function f, as you try to calculate the derivative for numerical parameters. Something along the line ...


2

Your integral is very unlikely to exist in terms of elementary functions. In particular, it involves terms of the form $$ \int\exp\left[-\frac12\sqrt{a\, \text{poly}(\xi)+b \xi^{0.998906}}\right]\text d\xi, $$ which is very unfriendly as regards symbolic integration. Note that in general symbolic integration is not possible; do you have some specific reason ...


2

Comment: I think you want D instead of Derivative. Also == instead of =. And you probably want the functions defined with patterns z_ etc. But there are errors that you'll have to address. (Or perhaps someone else.) ClearAll[φ, η, r, u]; φ[z_] = q*(1/z + (-1*q)/(-1*z)); η[z_] := k*(1/z + (-1*q)/(-1*z)); r[ρ_, z_] := Sqrt[ρ^2 + z^2]; pde = D[u[t, ρ, z], ...


2

Using Assumptions and a little simple substitution do can directly do that inner integral: $Assumptions = {0 < x < 1/4}; r1 = Simplify[ Integrate[(1 - (xx*Cos[z])^2)^(1/2), {z, 0, Pi}, Assumptions -> {0 < xx < 1}] /. xx -> (2 x/(1 - 2 x)) ] then it turns out you can do the integral over y analytically as well: r2 = ...


2

Your assumption is wrong. The correct result is Integrate[x^2, {x, 5, 9}] 604/3 (201.333...) With TrapezoidalRule you can only approximate this result: NIntegrate[x^2, {x, 5, 9}, Method -> {"TrapezoidalRule", "Points" -> 3, "RombergQuadrature" -> False}, MaxRecursion -> 10, PrecisionGoal -> 6] 201.333


1

Because s[t] is decreasing whenever p < 1, s[t] - myPreviousStep < 10^-4 will always be True. WhenEvent[cond, action] evaluates action when the condition changes from False to True; however, the condition is always True when p < 1. You need something like Abs[s[t] - myPreviousStep] < 10^-4, instead. Note that if p is closer to 1 than 10^-4, ...


1

If I use exact coefficients, I get an exact answer with Integrate after a couple of minutes: GE[Theta_, A_, B_] := CopulaDistribution[{"Binormal", Theta}, {ExponentialDistribution[A], ExponentialDistribution[B]}]; Delta = 4/100; A = 10/100; B = 10; Theta = 90/100; T = 5; GExpExp[x_, s_] := PDF[GE[Theta, A, B], {x, s}] ...


1

I post this not as a specific answer but I think it may provide some insights. Experts and WRI would have to answer. The following will only work for positive valued functions (polygons breaking on x axis ->problems...remediable but I just post this as a quick insight). NIntegrate aims to provide best approximation within working precision. It seems there ...


1

not an answer but a neat trick to pull out the weights that are used: method = {"TrapezoidalRule", "Points" -> 2, "RombergQuadrature" -> False}; r = 2; integrate once to learn the values: xvals = Reap[i0=Quiet@NIntegrate[x^2, {x, 1, 5}, Method -> method, MaxRecursion -> r, EvaluationMonitor :> Sow[x]]] // Last // ...


1

All of your integrals can be done with Integrate. These initial calculations are slow but by using Set rather than SetDelayed their subsequent use will be much quicker. You will also get better precision. Since you are comparing with experimental results presumably you satisfy the conditions suppressed by GenerateConditions -> False. If you want to see ...


1

I have interpreted this question as per george2079s comment. I think this may a case of "asking too much" but I defer to numerical experts. Note: Manipulate[ Plot[Evaluate[ BesselJ[2, 2 x] BesselJ[2, us[[1]] x] x Exp[u4 x^2]], {x, 0, s}, PlotRange -> {-0.003, 0.003}], {s, {5, 10, 20, 30, 40, 50}}] Then testing for small upper limits (noting ...



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