Tag Info

Hot answers tagged

23

The plan is first get the "external" contour and then use Green's theorem to find its area. r[t_] := {-9 Sin[2 t] - 5 Sin[3 t], 9 Cos[2 t] - 5 Cos[3 t], 0} (*find the intersections*) tr = Quiet@ToRules@Reduce[{r@t1 == r@t2, 0 < t1 < t2 < 2 Pi}, {t1, t2}]; pt = {t1, t2} /. {tr} // Flatten; pts = SortBy[pt, N@# &]; pps = Partition[pts, 2]; Now ...


8

RegionMeasure chooses a method which is slow when exact non-rational coefficients are present. I will correct this for a future version. Thanks for pointing it out. In Mathematica 10 the example works fast with approximate coefficients. In[1]:= Timing@RegionMeasure@N@ RegionIntersection[ Tetrahedron[{{0, 0, Sqrt[3/2]}, {2/Sqrt[3], 0, ...


7

Here is a way to do this using the new commands FromPolarCoordinates and ToPolarCoordinates in version 10.1. I'll use ψ for the function name, instead of f or z. Also, I like to use ϕ for the polar angle: Clear[x, y, r, ϕ, ψ]; polarCoords = Thread[{x, y} -> FromPolarCoordinates[{r, ϕ}]] {x -> r Cos[ϕ], y -> r Sin[ϕ]} ψChain[x_, y_] = ...


7

Mathematica seems to split the integrand component, E^(-((-m + Log[x])^2/(2 s^2))) into E^(-((m^2 + Log[x]^2)/(2 s^2))) times the sort-of "coefficient" E^((m Log[x])/s^2) (* == x^(m/s^2) *) in order to calculate the integral in terms of Meijer $G$. For reasons that are obscure to me, it seems to want the coefficient of m in the exponent to be ...


6

The problem is that you're mixing exact and machine numbers in the definition of the function f. The machine numbers create a small nonzero constant term in the numerator of the Limit, which is the cause of the infinite result as you divide by h and take h -> 0. The fix is to use {x0,y0}= u/5 instead of 0.2. However, if you do need to work with machine ...


6

They should not be equal. Note that $$ \lim_{x\to0}\frac{d^n}{dx^n} e^{-\sqrt{x}}=\infty $$ for every integer $n$. What Series does is computing the fractional power series, a.k.a Puiseux Series, which cannot be obtained by evaluating the derivative. You can see this problem with a simpler example: try expanding the function $f=\frac{1}{x}$ or $g=\sqrt{x}$ ...


6

The problem here is the Sin[n] which has no limit since it is an oscillating function, but it is always bounded by $\pm 1$: if you change you code with the following: Limit[(n - Sqrt[1 + 10 n + n^2])^2, n -> Infinity] with 1 in place of Sin (or -1 if you want), you get the result: (*25*)


5

Summarizing the comments, this was a bug in version 10.0.0. It has been fixed as of version 10.0.1. In[1]:= Integrate[ DiracDelta[x]*DiracDelta[y], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}] Out[1]= 1


5

If what you want is a nice smooth surface of the outer boundary, then in Mathematica 10.2 you can do the following: data3D = RandomReal[{0, 1}, {100, 3}]; (* generate some random point *) cvx = ConvexHullMesh[data3D] (* get the outer boundary *) Now we can Discretize the surface and smooth it in one go: smooth = DiscretizeRegion[cvx, ...


5

Reduce (on exact input) returns quickly and series of conditions joined by Or. The first one implies any disk of radius less than 1/10, d being the radius squared, is sufficient. res = Reduce[-1/10 < (y (x^4 + 4 x^2 y^2 - y^4))/(x^2 + y^2)^2 < 1/10 && x^2 + y^2 < d, {d, x, y}]; dom = If[Head[res] == Or, First[res]] (* 0 < d <= ...


5

I speculate about the reason for this behavior in the comment, but no matter whether that's the correct explanation, I would say that the documentation isn't wrong because I can verify the removal of the UpValues using Definition. However, this doesn't solve the problem. As a workaround that requires less typing than the UnSet approach in the question, I ...


5

Application of the implicit function theorem in this case shows that $\frac{\partial z}{\partial x}=-\frac{\partial f}{\partial x}/\frac{\partial f}{\partial z} $ and $\frac{\partial z}{\partial y}=-\frac{\partial f}{\partial y}/\frac{\partial f}{\partial z} $, where $f(x,y,z)=0$ is the implicit function. f = x^3 + y^3 + z^3 + 6 x y z - 1; -D[f, {{x, ...


5

Try this: Solve[0 == Dt[x^3 + y^3 + z^3 + 6 x y z - 1, x] /. Dt[y, x] -> 0, Dt[z, x]][[1, 1]] Dt[z, x] -> (-x^2 - 2 y z)/(2 x y + z^2) The procedure is similar for the other independent variable.


5

Since your integrand does not approach zero but a finite positive number, Limit[Exp[-16.136 (1 - Exp[-0.012*t])], t -> Infinity] (* 9.82255*10^-8 *) the integral over {t, 0, Infinity} does not converge. By the way, the error in the NIntegrate[integrand, {t, 0, 1000}] should be about 10^-7, which seems better than R. In fact, the precision seems ...


4

My experiments with this question indicate that something more than simple composition of Arrow and Tube is needed. What I came up with is ParametricPlot3D[{Cos[t], Sin[t], t/4}, {t, 0, 2 π}, PlotRange -> All, PlotStyle -> Directive[{Red, Arrowheads[.08]}]] /. Line[pts_] :> Arrow[Tube[pts, .04], {0, -.1}] which produces Of course, this ...


4

Now fixed in version 10.2. In[1]:= Residue[LogisticSigmoid[z], {z, I Pi}] Out[1]= 1 In[2]:= Residue[1/(1 + Exp[-z]), {z, I Pi}] Out[2]= 1 In[3]:= Coefficient[Series[1/(1 + Exp[-z]), {z, I Pi, 0}], 1/(z - I Pi)] Out[3]= 1


4

Although Belisarius' creative solution is entirely satisfactory, a solution symbolic at every step may be useful. To begin, define x[t_] := -9 Sin[2 t] - 5 Sin[3 t] y[t_] := 9 Cos[2 t] - 5 Cos[3 t] and note that t = π corresponds to the uppermost point in the star in the question, {0, 14}}. From there, the point {0, -5} can be reached by increasing or ...


4

Both Module and DynamicModule are shadowing the global variables x and y in the example in which you use them. The demonstration is best written without using either Module or DynamicModule. Manipulate[ ContourPlot[f, {x, -1, 1}, {y, -1, 1}, Contours -> 20, Epilog -> Dynamic[Arrow[{pt, pt + grad /. {x -> pt[[1]], y -> pt[[2]]}}]]], {f, ...


4

When you try to NIntegrate your expression, the error messages include: "suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small". Your expression does not have a singularity, its integral is manifestly not zero, it is not oscillatory, so it must be a numerical precision problem. ...


4

The brute force method to arrive at your second solution f[z_] = 1/beta/(2*z)/(1 - beta); cl = CoefficientList[f[z], 1/z]; cl.Integrate[(1/z)^Range[0, Length[cl] - 1], z] Log[z]/(2*(1 - beta)*beta)


4

When parameters to a integral are integers, I often fall back to calculating the "general" result, make a table where the parameter is explicitly given integer values, and then feed to FindSequenceFunction. In this case: table = Table[h[x, a, e] - g[x, a, e], {a, 1, 11}]; limits = Limit[#, e -> 0] & /@ table; f = FindSequenceFunction[limits]; ...


3

The nub of the problem is that we all get a little sloppy in writing down this kind of equation. Fortunately, it's possible to convey what we mean to Mathematica in our sloppy notation. Here's what's sloppy: $z(x,y)$ involves $x$ and $y$ as dummy variables and is no different from $z(r,\theta)$. You can't tell me the value of $z(0, 1)$ unless I tell you the ...


3

From Trace[ Limit[(1 - z)/(1 - Conjugate[z]), z -> 1], TraceInternal -> True] one may observe a couple of things: First, Mathematica substitutes z -> z + 1, essentially transforming the limit to Limit[z/Conjugate[z], z -> 0] Second, it is using the default direction Direction -> -1, which may be observed in the assumption found in the ...


3

Solution with NIntegrate NIntegrate[f[X[u, v]] Norm[Cross[D[X[u, v], u], D[X[u, v], v]]], {u, -π/2, π/2}, {v, 0, π}] (* 19.8097 *) An alternative approach to the problem is s = ImplicitRegion[{x^2/2 + y^2/3 + z^2/2 == 1 && y > 0}, {x, y, z}]; Chop[NIntegrate[x^2 + z^2, {x, y, z} ∈ s], 10^-7] which, of course, yields the same answer. Added: ...


3

Fractional Iterates A way to obtain an approximate fractional iterate of a function is to use its Carleman matrix, which is formed from its Taylor coefficients, and then taking the appropriate $p$-th power of the matrix to obtain the series coefficients. Note that I never said that $p$ had to be an integer; in the example given in the OP, then, we can take ...


3

That would be because it's false. Integrate[Cos[2 t]/(a^2 Sin[t]^2 + b^2 Cos[t]^2), {t, 0, \[Pi]}] FullSimplify it under the assumption that 0 < b <= a, and you get ((a - b) \[Pi])/(a b (a + b)).


3

I have found a simple method to mitigate the limit bug: using an intermediate Series[], the Dirichlet coefficients of a function f[x] can be calculated correctly as a Limit[]. The formulas for the coefficients are cD := Module[{}, a[1] = Limit[f[x], x -> ∞]; a[n_] := a[n] = Limit[ Series[n^x (f[x] - Sum[a[k] k^-x, {k, 1, n - 1}]), {x, ∞, ...


3

The expressions inset by Text are not considered in the PlotRange used by ContourPlot. We can make the problem more severe and apparent by using wider FrameMargins: f[x_, y_] := 6 - 3 x - 2 y; gr = ContourPlot[f[x, y], {x, -4, 6}, {y, -2, 2}, ContourShading -> None, Contours -> {-6, 0, 6, 12}, ContourLabels -> Function[{x, y, z}, ...


3

Perhaps what you are looking for is: A = {{2, -1, 0}, {-1, 2, -1}, {0, -1, 1}}; Integrate[Exp[(-x . A . x)/2], x ∈ FullRegion[3]] 2 Sqrt[2] π^(3/2)


3

The simplest method is to wrap xdummy in Quantity, e.g. result = Integrate[Quantity[3, "kN/m"] (1 - x/Quantity[10, "m"]), {x, Quantity[xdummy,"m"], Quantity[10, "m"]}] (* Quantity[(15000 - 3000 xdummy + 150 xdummy^2), ("Kilograms" "Meters")/("Seconds")^2] *) Since xdummy is now effectively unitless, you no longer need to include units in Plot, ...



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