Tag Info

New answers tagged

1

The difference in behaviour seem to be because Plus expects more than one argument. f_[whoCalled] ^:= f Sin[whoCalled] Plus[whoCalled] Minus[whoCalled] MadeUp[whoCalled] (* Sin whoCalled Minus MadeUp *) f_[whoCalled, youCalled] ^:= f Plus[whoCalled, youCalled] (* Plus *)


3

Fixed in 10.0.2 Probability[a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g^2 < 1, {a, b, c, d, e, f, g} \[Distributed] UniformDistribution[{{0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}}]]


3

Edit 2 - Fixed omitted integrand Lukas pointed out that the first integration produces terms of the form x Sin[x], which were mishandled by the original rules. (See edit history, if curious.) I changed some things around a little. We have to Expand the result of the first integration before doing the second integration. Overall the speed is actually ...


4

You might get a speed improvement by doing as follows. (1) Change the expansion to give an explicit sum of products of trigs. comm00[t1_, t2_, tg_] = ComplexExpand[ Im[Expand[ ExpToTrig[(O1[t2, tg] + Exp[I*\[Gamma]*t2]*O2[t2, tg])*(O1c[t1, tg] + Exp[-I*\[Gamma]*t1]*O2c[t1, tg])]]]] (2) Do the double integral without iteration, ...


1

the result of Eigenvalues[m]: ( using g instead of \[gamma] ) {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g^2,0,0,0,0,0,-g,0,0,-g,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g,0,0,0,0,0,-1,-g,0,0,0,0,0,1,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,g,0,0,0,0,-1,-g,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-1,0,0,-1,0,0,1,0,0,0}, ...


2

Update 2: In Mathematica 9.0.1 this takes only 19 seconds on first evaluation and 10 seconds on subsequent evaluations. The results returned by M9 and M10 are equivalent but not given in identical form. Update: While I was writing this I tried Eigenvectors[m], which finished in 100 seconds on my machine. I'm leaving the NullSpace-based method below ...


1

This seems to come close. The idea is to find factors, at all levels, that are not numeric and are independent of the variable. Set up replacement rules for these in terms of some new symbol. Do the replacement. I also return the rules used in case that might be useful. replaceFactors[expr_, x_, c_Symbol] := Module[ {e2 = MapAll[Collect[#, x] &, ee], ...


2

First, Integrate normally takes the assumptions as given and only adds conditions that are needed beyond the assumptions specified. Thus I would expected the integral Assuming[x > 0, Integrate[1/t^2, {t, 1, x}]] to result in 1 - 1/x instead of a ConditionalExpression, since the assumption x > 0 is sufficient to guarantee the result is valid. ...


2

community wiki, not an answer, just some hints, too small for comment: Integrate[1/t^2, {t, 1, x}] May be some smart math person can decode the above. Now: Assuming[Element[x, Reals], Integrate[1/t^2, {t, 1, x}]] So the x>1 condition comes out just from say x is real. fyi, This is how Maple does it: int(1/t^2, t=1..x) ; It does not even ...


1

Please consider this just as a comment. It seems you should explicitly say to integrate that you want work with 'say' inversed boundaries, because only then it understands it: Integrate[1/t^2, {t, 1, x}, Assumptions -> x < 1] ConditionalExpression[(-1 + x)/x, x > 0] I suppose it rather some kind of reticence. As a workaround I could suggest one ...


1

If I understand you correctly, the main idea of the procedure can be outlined as follows. Call the vector gg and let it have k components g[i]: gg[k_] := Array[g, k] Then your expression can be written as V[n_, k_] := Sum[(y[i, gg[k]] - z[i])^2, {i, 1, n}] Example n = 3, k = 2 V[3, 2] (* Out[32]= (y[1, {g[1], g[2]}] - z[1])^2 + (y[2, {g[1], g[2]}] - ...


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 ...



Top 50 recent answers are included