Tag Info

New answers tagged

3

With $Assumptions = {0 <= pdw <= 1, 0 <= pwd <= 1}; trM = {{1 - pdw, pdw}, {pwd, 1 - pwd}}; dmP = DiscreteMarkovProcess[{1, 0}, trM]; gD = GammaDistribution[a, b]; the mean and variance of the described process for a time slice at time t are mean = Expectation[(m[t] - 1)*g, {m \[Distributed] dmP, g \[Distributed] gD}] variance = ...


1

Following closely the documentation for DiscreteMarkovProcess (I am no expert though…) M = {{1 - w, w}, {d, 1 - d}} P = DiscreteMarkovProcess[{1, 0}, M] Mean[P[n]] // FullSimplify Variance[P[n]] // FullSimplify Graph[P] data = RandomFunction[P /. w -> 1/2 /. d -> 1/4, {0, 10}] ListPlot[data, Filling -> Axis, Ticks -> ...


1

Another replacement version: expr /. (x_ &) :> x /. x_ :> (x &)


2

Merely my own variation of the existing answer by mfvonh: expr = 1/4 Fp (2 Fp - Fp^3/Fm^2 + 4 Fm Derivative[1][Fm] Derivative[1][Fp]); Fm = Sin[#] &; Fp = Sin[#] Cos[#] &; FullSimplify[expr /. (x_ &) :> x] Function @@ {%} 1/32 (3 + 7 Cos[2 #1]) Sin[2 #1]^2 1/32 (3 + 7 Cos[2 #1]) Sin[2 #1]^2 &


0

Why not just a simple replacement rule? mergeF[expr_] := expr /. {((Cos[#1] &) (Sin[#1] &)) :> (Sin[#] Cos[#] &)} mergeF[Fm Derivative[1][Fm]] (* Sin[#1] Cos[#1] & *) mergeF[1/4 Fp (2 Fp - Fp^3/Fm^2 + 4 Fm Derivative[1][Fm] Derivative[1][Fp])]


1

Postfix-Definition Clear@"`*" Sin*Cos // f[r_] := Sin[r]*Cos[r] Sin*Cos // f[Pi/7] (* out *) Cos[Pi/7] Sin[Pi/7] Prefix-Definition Clear@"`*" g[r_][Sin*Cos] := Sin[r]*Cos[r] g[Pi/11][Sin*Cos] (*out*) Cos[Pi/11] Sin[Pi/11] Just 1 letter more to type


4

There may be a better way to do this, but perhaps 4 Fm Derivative[1][Fm] /. Function[b_] :> b // Evaluate // Function 4 Cos[#1] Sin[#1]& 1/4 Fp (2 Fp - Fp^3/Fm^2 + 4 Fm Derivative[1][Fm] Derivative[1][Fp]) /. Function[b_] :> b // Evaluate // Function 1/4 Cos[#1] Sin[#1] (2 Cos[#1] Sin[#1]-Cos[#1]^3 Sin[#1]+4 Cos[#1] Sin[#1] ...


4

Put assumptions in: Clear[a, c] Integrate[ q^2 ((4 (c π))/((a q^2 - c) (c + a q^2))), {q, 0, ∞}, Assumptions -> {a, c} ∈ Reals] (* ConditionalExpression[(Sqrt[c] π^2)/a^(3/2), (a > 0 && c > 0) || (a < 0 && c < 0)] *)


2

One could go very low-level and try to define an operator just in terms of basic properties such as linearity, but I chose to go for a middle ground and assume that we're dealing with a linear differential operator. The coefficients in the operator are called a[i] where i is a symbolic summation index corresponding to the order of the derivative in each term ...


0

Here is a function to show the order of a list of expressions. By using Less as in the question, I'm assuming the expressions are unequal. ClearAll[showOrder]; SetAttributes[showOrder, HoldAll]; showOrder[{e__}] := Defer /@ Hold[e][[Ordering[{e}, All, Less]]] /. Hold -> Less OP's example: Block[{k = 1, m = 1}, showOrder[{Subscript[ω, 1], ...


6

I think this does what you want: Less @@ SortBy[Defer[Subscript[ω, #]] & /@ {1, 2, 11, 22}, N @@ # &]


2

Depending on your specific needs the straightforward way to do this is Series[p[x+e,y-e,t],{e,0,1}] or Series[p[x+ex,y-ey,t],{ex,0,1},{ey,0,1}] If you want to extract the terms proportional to $\epsilon$ you can get the correct coefficients with SeriesCoefficient[p[x + e, y - e, t], {e, 0, 1}] or if that suits you better with ...


3

I may have misunderstood the aims, If so, I apologize. For the first question: f[n_] := GraphDistance[CompleteGraph[5, EdgeWeight -> #], 1, 2] & /@ RandomVariate[ExponentialDistribution[1], {n, 10}]; : This generates a sample of size n of graph distances between vertex 1 and 2. You can visualize: Histogram[f[10000]] Estimating ...


0

Probably you will have to adapt my basic idea to your special needs. mem = 1/Sqrt[2] + 1/54 (34 - 3 π^2 + (-8 + Log[8]) Log[64]) // ExpandAll // Apply[List, #] & {mem[[1]], mem[[2]]/Sqrt[2], mem[[3]]/Pi^2, mem[[4]]/Log[2], mem[[5]]/Log[2]^2} // FullSimplify a possible adaption The key is: after ExpandAll the summands are sorted in the same ...


2

Another way using the built-in coordinate transforms : define a rule to perform the transformation : rule = Rule[x^2 + y^2 + z^2, Simplify[TransformedField["Cartesian" -> "Spherical", x^2 + y^2 + z^2, {x, y, z} -> {\[Rho], \[Theta], \[Phi]}], Assumptions -> {\[Rho] > 0}]] expr = D[D[E^(I (-k r ...


2

Use rules to do both the forwards and the backwards substitutions. Step 1: deriv = D[D[E^(I*((-k)*r + t \[Omega]))/r /. r -> Sqrt[x^2 + y^2 + z^2], x], y] Step 2: PowerExpand[deriv /. {x^2 + y^2 + z^2 -> r^2}]


4

This will produce a simplified form: Simplify[ D[D[E^(I (-k r + t \[Omega]))/r, x], y] /. Power[x^2 + y^2 + z^2, n_] :> Power[HoldForm[r], 2 n]]


6

It is not quite clear, what do you you want to get out of the answer. Would you like to compare Maple and Mma and understand, which one is better ? Or would you like to understand the alternative forms of taking this integral? Or the reason, why the results of Marple and Mma are different? Or transform the Mma result in terms of xand y? Or, ...


0

For Element[{m, x, y}, Reals] the function is real; however, numerical noise can result in an imaginary artifact that can be removed with Chop int[m_, x_, y_] = Assuming[{Element[{m, x, y}, Reals]}, Integrate[m^2/((x - m^2)^2 + y^2), m] // FullSimplify] (I*(Sqrt[-x - I*y]*ArcTan[m/Sqrt[-x - I*y]] - Sqrt[-x + I*y]*ArcTan[m/Sqrt[-x + ...


5

The problem is the ByteCount of H is ~630 KB, so Simplify will run forever. ComplexExpand[ With[{z = x + I y}, E^-Sqrt[z^2]/(Sqrt[z^2]+Sqrt[z^2] Cosh[Sqrt[z^2]]+Sqrt[z^2] Sinh[Sqrt[z^2]]) ] ] // ByteCount (* 629392 *) Here are two partial workarounds. I call these workarounds because it proves H is not analytic, but it doesn't derive it i.e. we ...


4

Let me start addressing the Green function part of the question. Lets define a Heat equation and its generic solution (see above) operator[p_] := D[p, t] - D[Δ D[p, x], x]; sol = Heat[Δ, -Infinity] and build a general solution via superposition as: sol1 = Integrate[(sol /. x -> x - y) g[y], {y, -Infinity, Infinity}] Plot[sol1 /. g -> ...


2

rules = {a b -> p, a c / d -> q} Expand[a (b + 42 c/d)] /. rules (*p + 42 q*)


2

Here is an example of how you can fetch the results, but there is the question of what to do if multiple results are returned. I'm using URLBuild but you could do the same manually if you don't have Mathematica 10. num = 4.17 Cases[ Import[ URLBuild[ "http://isc.carma.newcastle.edu.au/advancedCalc", {"input" -> num}], "XMLObject"], ...


4

Only a suggestion, not a full answer: As far as I can see the ISC returns Maple code. Therefore, after importing the output of the website as string into Mathematica, the biggest challenge is to convert the output from Maple to Mathematica code. A quick google search reveals that there is a package in the MathLibrary. I guess chances are good that the ...


2

I get a better fit with an asymptotic complexity between n^4 and n^5. I think Det is doing a lot of simplification of symbolic expressions, which may account for some of the increased complexity. nMax = 35; entry[] := RandomInteger[{-9, 9}] + RandomInteger[{-9, 9}]*t findTime[n_] := Block[{m, time, det}, m = Table[entry[], {i, 1, n}, {j, 1, n}]; {time, ...


2

In a few seconds Mathematica 7.0.1 under Windows returns: (Mass (r1 Rotation + (r1^2 + Rotation^2) ArcTan[Rotation/r1]))/(2 r1^2 Rotation) On the other hand Mathematica 10.0.0 is still working after several minutes. Assuming the above output is correct this seems like a regression.


4

The Package HypExp does exactly that. Here is the link to paper for what I believe was the last extension. After digging around a bit, the package files should be available here ( Edit freely available link) Several years ago, there has been some work on the simplification of polylogarithms into a Hopt Algebras, which simplifies the reduction of the ...



Top 50 recent answers are included