Tag Info

New answers tagged

1

Seeing as you're trying to evaluate hydrogen wavefunctions, note that the necessary special functions are already built-in, so you can skip the step of defining the special functions entirely, and just do this: ψ[n_, l_, m_, ρ_, θ_, ϕ_] := Sqrt[(2/(n a0))^3 (n - l - 1)!/(2 n (n + l)!)] Exp[-ρ/2] ρ^ l LaguerreL[n - l - 1, 2 l + 1, ρ] ...


4

The reason is because you define your function p[x,y] differently. When you write p[#,#]&, Mathematica sees it as Function[{x},p[x,x]], whereas the preferred option in your case would be p[#1,#2]&, or, in other words, Function[{x,y},p[x,y]]. This being said, try: pd2[x_, y_, i_, j_] := Derivative[i, j][p[#1, #2] &][x, y]; And your results ...


3

Another possible workaround is to wrap Dispatch with a memoized function, so that both expressions a and b contain references to the same internal dispatch table. i.e. define mem : disp[x_] := mem = Dispatch[x] then use disp in place of Dispatch in your code.


6

This is not a full answer, just a start towards a solution. The culprit is Dispatch, which became atomic in version 10, and comparison wasn't implemented for it. Here's a small test in version 9: In[1]:= a = Dispatch[{"a" -> 1, "b" -> 2, "c" -> 3, "d" -> 4, "e" -> 5, "f" -> 6, "g" -> 7, "h" -> 8, "i" -> 9, "j" -> 10, ...


4

As @Szabolcs points out Dispatch does not interact well with SameQ, etc in Mathematica 10. Dispatch[1 -> 2] === Dispatch[1 -> 2] False Dispatch[1 -> 2] == Dispatch[1 -> 2] False Use Normal to "expand" the dispatch objects and then the comparison should work. Normal[Dispatch[1 -> 2]] == Normal[Dispatch[1 -> 2]] True ...


5

As far as I know, there is no easy, general way to handle this kind of algebra with Sum expressions. What follows is an attempt to use replacement rules to handle a wider range of cases than chris's example. I don't consider it to be the canonical answer that is required, but perhaps someone might be able to use it as a starting point. I use Inactive on ...


1

There is a hint in the error message that the limit cannot be computed. When you have symbolic coefficients, it is possible, even likely, that the existence of the limit depends on them. If we specify the coefficient of t'[e] is positive, we get a result: Assuming[Pr (1 - Exp[-K η])/η > 0, DSolve[t''[e] + Pr (1 - Exp[-K η])/η t'[e] == 0 && ...


1

If you denote x-independent constant factor as a = Pr (1 - Exp[-K \[Eta]])/\[Eta] then FullSimplify[DSolve[{t''[x] + a t'[x] == 0, t[0] == 1}, t[x], x]] {{t[x] -> (a + C[1] - E^(-a x) C[1])/a}} and t[Infinity] == 0 is satisfied if a>0 and C[1] = -a so answer is E^(-a x) You can solve these quickly by setting the limit: ...


3

The approach that kguler suggest in your precedent question is completely suitable for the current one: FindSequenceFunction[Table[With[{ d1 = HypoexponentialDistribution[Flatten[Table[{λ, μ}, {i - 1}]]], d2 = HypoexponentialDistribution[{λ, μ}], d3 = ExponentialDistribution[μ], d = ExponentialDistribution[λ]}, ...


2

We can manual expand the symbolic sum with the function linearExpand given in my answer to How to do algebra on unsolved integrals?. Clear[linearExpand]; linearExpand[e_, x_, head_] := e //. {op : head[arg_Plus, __] :> Distribute[op], head[arg1_Times, rest__] :> With[{dependencies = Internal`DependsOnQ[#, x] & /@ List @@ arg1}, ...


1

Will this do? A = Table[a[i,j],{i,3},{j,3}]; Then you can have p[x_, y_] := Sum[Sum[A[[i, j]]*x^i*x^j, {j, 1, 3}], {i, 1, 3}]; and you will have e.g.: Dimensions[A] {3,3} This is essentially what bill s proposes, but I am wrapping the symbolic a[i,j] in a matrix A.


4

Yes we can ! MapAt[Integrate[#, {x, -Infinity, Infinity}] &, f[x], 1] // PowerExpand (* n *) tt = f[x]^2 /. Power[Sum[a__, b__], 2] :> sum[a (a /. i -> j) // Release, b, b /. {i -> j}] MapAt[Integrate[#, {x, -Infinity, Infinity}] &, tt, 1] /. sum -> Sum // PowerExpand


2

First note that since the $p(z)$ and the $p(x_i|z)$ are all Gaussians, the expression can be rewritten as $$I=\int \prod_{i=1}^n p(x_i | z) p(z) dz=A\int\prod_{i=1}^{2n}\exp\left(-c_i^2(z-z_i)^2\right)=A\int\exp\left(-\sum_{i=1}^{2n}c_i^2(z-z_i)^2\right)\\=A\exp(-d)\int\exp\left(-c_0^2(z-z_0)^2\right)\\=\frac{A\sqrt{\pi}\exp(-d)}{c_0}$$ where the ...


1

Here is one way to keep everything symbolic: p[x_, y_] := Total@Flatten@Table[a[i, j] x^i y^j, {j, 1, 3}, {i, 1, 3}] p[3, 4] 12 a[1, 1] + 48 a[1, 2] + 192 a[1, 3] + 36 a[2, 1] + 144 a[2, 2] + 576 a[2, 3] + 108 a[3, 1] + 432 a[3, 2] + 1728 a[3, 3] Of course, you can assign values to the a[i,j] in order to get numerical values for the polynomial.


10

$$\mathbb{P} \big(\sum_{i=1}^{m} (A_i + S_i) \le L < \sum_{i=1}^{m+1} (A_i + S_i) \big) = \frac{\mu ^m (2 \lambda +\mu )}{2^{m+1} (\lambda +\mu )^{m+1}}$$ Observing: d1 = TransformedDistribution[ a + s, {a \[Distributed] ExponentialDistribution[λ], s \[Distributed] ExponentialDistribution[μ]}] (* ...


5

Why do you think the result is obviously wrong? expr1 = (a + b t) Cos[n t]; int1 = Integrate[expr1, {t, t1, t2}] (1/(n^2))(-b Cos[n t1] + b Cos[n t2] + n (-(a + b t1) Sin[n t1] + (a + b t2) Sin[n t2])) The indefinite integral is int2 = Integrate[expr1, t] // Simplify (b Cos[n t] + n (a + b t) Sin[n t])/n^2 Calculating the definite ...


0

One more try: relations = SolveAlways[(b1 x + b2 x)/(b3 + (b4/b5) x) == (c1 x)/(c2 + c3 x), {x}][[4]] {b3 -> ((b1 + b2) c2)/c1, b4 -> ((b1 + b2) b5 c3)/c1} This gives nontrivial relations between parameters you should always keep for any x. Convert them to equations and remove some freedom restrictions = Equal @@@ relations; myChoice = ...


1

Here is my interpretation: Clear[split, exp]; split[expr_, v_] := Times @@@ GatherBy[Power @@@ FactorList[expr], ! FreeQ[#, v] &]; exp[expr_, var_] := First[#] AngleBracket[Last[#], var] &@ split[#, var] & /@ List @@ Expand[expr] // Total exp[f*f, x] (* 〈a[x]^2, x〉 + 2 c1 〈a[x] b[x], x〉 + c1^2 〈b[x]^2, x〉 + 2 c2 〈a[x] c[x], x〉 + 2 c1 c2 ...


0

Try this: f = a[x] + c1*b[x] + c2*c[x]; g = Expand[f*f] /. {a_[x]*b_[x] -> 〈a b〉, a_[x]^2 -> 〈a^2〉} Have fun!


1

Setting integrand= E^(-2 L 100) (1 - L/(2 0.08))^(-1 + 4 100 3*^-7) (L/0.08)^(-1 + 4 100 3*^-7) with the example given in your question, you can use ni[x_]:=NIntegrate[integrand,{L,0.1,x}] and Plot[Re@ni[x],{x,0.1,0.5}] to plot the numerical integrand. Your example does not seem to lend itself well to approximation, though. Or perhabs I chose the L ...



Top 50 recent answers are included