Hot answers tagged

13

This usually means you've exported a local symbol from the context in which it was localized. Consider: Module[{x}, x] (* x$24939 *) Your results may vary. The Module localizes x to avoid conflicting with any previous definition. x$24939 is just another symbol similar to x, but with $24939 added to its name to insure that there's no confusion with any ...


5

Without error messages MMA evaluates the integrals in one step int[eta_?NumericQ] :=NIntegrate[mu*Tanh[mu*Pi] ((Sqrt[2]/Pi)*Cosh[Pi*mu] Cos[mu*tau]/Sqrt[(Cosh[tau] + eta)]) Exp[-(mu^2 + .25)*(L/LLoc)], {tau, 0,Infinity}, {mu, 0, Infinity}] int[232] (*0.000370623*)


5

Your code is working as intended, I would think: Q[q_, x1_, y1_, l1_, l2_, l3_, l4_] := Module[{x2, y2, x3, y3, x4, y4, theta1, theta2}, x2 = x1 + l1 Cos[q]; y2 = y1 + l1 Sin[q]; (*others*) {x2, y2, y3, x3, theta1, theta2} ] Q[q, 0, 0, 3, 5, 2, 4] This returns: {3 Cos[q], 3 Sin[q], y3$62555, x3$62555, theta1$62555, theta2$62555} The ...


4

Fixed the typos. P[θ_, φ_] := 2 Sin[θ (π/180)/2]^2 + {Sin[θ*π/180]^2}/4 Abs[1 + Exp[-I*φ*π/180]]; You made the following mistakes: For complex $i$, use I not i θπ is incorrect. It should be θ*π Same iφπ is incorrect, replace with I*φ*π In the plot function, {x, θ, 180} is incorrect. You need to specify a range for values of x, for instance {x, 0, 180} ...


3

Multiple errors in the posted code. Here is better code: (*Set constants*) L = 1; LLoc = 0.4; (*First integral*) Clear[int1]; int1[eta_?NumericQ, mu_?NumericQ, opts : OptionsPattern[]] := NIntegrate[Cos[mu*tau]/Sqrt[(Cosh[tau] + eta)], {tau, 0, Infinity}, opts]; (*Second integral*) Clear[int2]; int2[eta_?NumericQ, opts : OptionsPattern[]] := ...


2

You might find use in this definition of $Post: $Post = Function[, Unevaluated[#] /. $Failed :> RuleCondition@FrontEndTokenExecute["EvaluatorAbort"], HoldAllComplete]; With this defined any printed output that contains $Failed should trigger an abort of all subsequent cells. Reference: Pure function with attributes of arbitrary number of ...


2

If you include a PlotRange -> All in your ListPlot, you will see what's happening more clearly: ListPlot[DataA, PlotRange -> All] Notice that point without error bars at {1, 3}? ListPlot is actually interpreting your DataA list not as a single point with abscissa 3 and ordinate 1, but as a list of two points without an explicit abscissa, thereby ...


2

If we first use DiscretizeRegion, then it's no problem on version 10.1. RegionMeasure@DiscretizeRegion@polygon 0.54


2

Not completelly understood your computations, but this is my try. First, let me simplify a bit. NN = 4; energy = 16; α = 0; β = 100; z = 1; λ1 = z λ2 = (2 energy + λ1^2)/6 λ3 = (2 λ1*λ2 - α)/6 λ4 = -(4 λ2^2 + 6 λ1*λ3 - 2 β)/20 (* changed sign here, otherwise the integral does not converge *) Clear[ψ, μ, f, Δ]; ψ[λ2_?NumericQ, λ3_?NumericQ, λ4_?NumericQ, ...


2

I would try something like this: point1 = {Around[72.85, 60.6242], Around[210.26, 136.593]}; point2 = {Around[-25.17, 10.23], Around[104.70, 32.47]}; point3 = {Around[25.17, 10.22], Around[284.70, 48.32]}; point4 = {Around[18, 10], Around[309, 23]}; point5 = {Around[-18, 9], Around[129, 23]}; point6 = {Around[-15.1, 11.5], Around[309.4, 18]}; The Mollweide ...


1

Do as much of integration you can analytically. a[q_, EE_, K_, y_] = 1 + q/(2*K)*Log[(q^2 - K*q - EE)/(q^2 + K*q - EE)] // FullSimplify[#, 0 < K < y < 1 && q > y && Element[{EE}, Reals]] & int = Integrate[a[q, EE, K, y], {q, y, \[Infinity]}, Assumptions -> 0 < K < y < 1 && q > y && ...


1

Multiple problems with your code. Here is better code: Clear[a, f, rhs] a[q_, E_, K_, y_] := 1 + q/(2*K)*Log[(q^2 - K*q - E)/(q^2 + K*q - E)]; f[Epol_?NumericQ, K_?NumericQ, y_?NumericQ] := NIntegrate[a[q, Epol, K, y], {q, y, Infinity}, Method -> "GlobalAdaptive", WorkingPrecision -> 20, PrecisionGoal -> 2]; rhs[x_?NumericQ, y_?...


1

This is not an answer. It is a comment, but it is too long and complicated to be written as normal comment. Your definition of BB is incomprehensible to me. You are taking the derivative w.r.t. r, but the variable r does not appear anywhere in the expression. Further, since BB is a function of three variables, you need to use the three-variable form of ...


1

OK, let me turn the fruit of the discussion in chat to an answer. The following solution works in v7: approx = With[{k = 1000}, 1/Pi ArcTan[k #] + 1/2 &]; s1 = NDSolve[{Simplify`PWToUnitStep@equa00 /. UnitStep -> approx, x[0] == 0, x'[0] == 0}, x, {t, 0, ts}, SolveDelayed -> True, MaxSteps -> Infinity][[1]] The idea is not complicated: ...


1

You need to patch the model for use in FeynCalc: $LoadFeynArts=True; <<FeynCalc`; FAPatch[PatchModelsOnly -> True]


Only top voted, non community-wiki answers of a minimum length are eligible