Tag Info

New answers tagged

2

This seems to be somewhat faster. I use N[] or equivalent thereof in some places. Also removed a Floor since the argument had to be integral anyway. Clear[f, fr] f[n_, 0, s_, a_] := 1 fr[n_, s_] := fr[n, s] = Sum[m^-s, {m, 1., n}] f[n_, 1, s_, a_] := f[n, 1, s, a] = fr[n, s] - fr[a, s] f[n_, k_, s_, a_] := f[n, k, s, a] = N[Sum[Binomial[k, j] ...


1

I would solve that problem adding a function with a pattern in the argument. Try: realRegion1a[x_Real] := realRegion1[x] And the try your Manipulate using that new function. It will behave as expected.


0

You can use Solve for this but you have to do a little work to transform your "equation" in to a usable form. This is what my cobbled together makeExpression function does. (It also generates the conditions to ensure that the first letter of each word cannot be zero): makeExpression[expr_] := Module[{ie, r = Reap[ expr /. x_String :> ...


6

I will guess that the time needed to create a stock a packed array is significantly faster than that for filling a regular expression, even if every element is Null. For one, it is possible that Table, being a function that holds it arguments, preprocesses to the point of knowing (well, suspecting) that everything is a machine double in the fast case, and ...


5

It looks like the real problem is not with solving the recurrence relation as such but that the CityData and CountryData functions do return some of their results differently in version 10. Many of these return values are now not simple numbers or strings anymore but rather Entity or Quantity "objects". While it is in many cases possible to use these as ...


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



Top 50 recent answers are included