Tag Info

New answers tagged

1

Set Accuracy before processing blorp, this makes you trouble free for matching numbers. SetAccuracy [#, Accuracy @ # // Min // IntegerPart] & /@ blorp or simply SetAccuracy [#, 12] & /@ blorp (*on my computer *) You may also consider SetAccuracy[#,5]& /@ tblorp or even only 2 instead of 5, because of .1 increments. I think you got ...


1

Try checking the parallel kernel settings by clicking on the menu bar: Evaluation > Parallel Kernel Configuration Click the tab Parallel in the window that pops up. Uncheck Automatic as it may have fewer kernels than you want, subject to the limit imposed by your license. Then click Manual setting, and set the number of kernels desired.


1

A mild refactoring of ubpdqn's code: f[n_, d_] := #*Map[{-Cos[#], -Sin[#]} &, #/d] & @ Sqrt @ Range @ n di[n_, d_, rad_] := Module[{fu, pt, grad, pg}, fu = f[n, d]; pt = MapIndexed[{Disk[#, rad], Sqrt[HoldForm @@ #2] ~Style~ Black ~Text~ #} &, fu]; grad = Reverse[{{0, 0}, ##} & @@@ Partition[fu, 2, 1]]; pg = ...


2

Try this: Clear["Global`*"]; m = 1; \[HBar] = 1; k = 1; V = -k/Sqrt[1 + x^2 + y^2]; A = 8; \[CapitalDelta] = 10^-3; SE[Etr_] := -\[HBar]^2/(2 m) \!\( \*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(\[Psi][x, y]\)\) + V \[Psi][x, y] - Etr \[Psi][x, y] == 0 \[CapitalOmega] = Disk[{0, 0}, A]; BC = DirichletCondition[\[Psi][x, y] == ...


11

I appreciate that attempts should be the minimum standard. As this does not resemble the desired result, perhaps it can be a starting point. I look forward to OP attempt and other answers. f[n_, d_] := Module[{r = Range@n, a}, a = Sqrt[#]/d & /@ r; MapThread[#1 {-Cos[#2], -Sin[#2]} &, {Sqrt[r], a}]] di[n_, d_, rad_] := Module[{fu, pt, grad, pg}, ...


3

You can do this by using Mod[numerator,denominator] If the return value is 0 it is evenly divisible, else it is not divisible.


1

If you'd checked the document of shooting method carefully, you would notice that a Method can be added inside Method: eqn1 = t x'[t] - (-x[t] + y[t]); eqn2 = t y'[t] - (-5 t^2/x[t]^2 + x[t] - y[t]); sol = Quiet@ NDSolve[{eqn1 == 0, eqn2 == 0, x[0] == y[0], x[1] == 1}, {x, y}, {t, 0, 1}, Method -> {"Shooting", Method -> ...


1

According to your definition we have g[x_] := (x + 1) Log[x + 1] - x Log[x] The two functions performing the numerical integration are fC[a_] := NIntegrate[g[1/(Exp[1/x] - 1)], {x, 0, a}] fP[a_] := NIntegrate[1/(x/(Exp[1/x] - 1)), {x, 0, a}] Remarks 1) variable names must begin with a lower case letter, hence I have written fC and fP instead of C and ...


5

Just for fun: d = {{1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 1}, {1, 1, 1, 0, 0, 1}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}; en = N[Entropy/@ d] ...


2

I believe this is what you seek: ListPlot[Entropy /@ Data1]


1

There was a really silly mistake. I'm embarrassed for even asking now... z = r cos[theta] was missing from the integral. It's all good now. Thanks for the help anyways! Love you guys :]


1

You don't even need to numerically integrate. Each of your intended integrals is simply: $$\int_0^\infty e^{-k x^2}dx={1\over 2}\sqrt{\pi\over k}$$ Also you don't need to evaluate a bunch of Bessel functions, since BesselJZero[1/2,n] is $n\pi$. As noted by @belisarius, your first term would diverge if you integrate to $\infty$, since the integrand is 1. ...


0

second try, restrict to number input: firstDecimalPlaceDifference[a_?NumberQ, b_?NumberQ] := Module[{aa, bb, base}, {aa, bb} = RealDigits /@ {a, b} ; base = Max[aa[[2]], bb[[2]] ]; If[aa[[2]] != bb[[2]] , 10^(base-1), {aa, bb} = Reverse@SortBy[{aa[[1]], bb[[1]]}, Length]; If[Union[#] == {0}, 0, ...


1

This worked for the simple cases i checked: FirstDecimalPlaceDifference[x_, y_] :=Floor[Log[10, Abs[x - y]]] ?


5

This function returns the location of the first place at which the decimal representations of the given numbers differ. firstDecimalPlaceDifference[x__] := If[Equal @@ SetPrecision[{x}, Infinity], 0, 10^NestWhile[# - 1 &, Floor[Log10@Max[Abs[{x}]]], Equal @@ RealDigits[{x}, 10, 1, #] &]] Not the fastest method, but guaranteed to get ...


1

Something along the lines of... f[a_, b_] := Round[a - b, Power[10, N[IntegerPart[Round[Log[10, Abs[a - b]]]]]]] Using Log10 to get the scale of the difference and rounding the difference to this Precision. Following discussion with 2012rcampion a tidied up version only giving the scale and handling the zero case... Clear[f]; f[a_?NumberQ, b_?NumberQ] ...


1

Your answers are correct. The first two solutions occur "at infinity" but your last two (after Chop) are {x->-4, y->0} and {x->0, y->0}, as is correct.


2

Using ListPlot3D with Mesh: data = Table[{i, j, Sin[j^2 + i]}, {j, 0, 2 Pi, 2 Pi/11}, {i, 0, 2 Pi, 2 Pi/24}]; Dimensions[data] (* {12, 25, 3} *) colors = Directive[Thick, #] & /@ ColorData["Rainbow"] /@ Range[0, 1, 1/11]; lp3d = ListPlot3D[Join @@ data, PlotStyle -> Opacity[0.3], BoundaryStyle -> None, Mesh -> {0, Thread[{Range[0, 2 Pi, 2 ...


1

The reason is that you have an inefficient inner loop when you use myBBBlik. Every time you call myBBBlik, it takes a certain amount of time to calculate the result (on my computer, about 1/2 second of mucking around because your likelhood function is a bit complex). But myBBBlik2 creates an algebraic expression once (?or twice?) and can substitute the ...



Top 50 recent answers are included