Tag Info

Hot answers tagged

12

The idea The idea is that if we have $\log(a+b),\qquad a\gg b$ , then we can equivalently write this as $\log a + \log(1 + b/a)$ and the second part will be small, so that one can first compare the first part(s). The power towers with base numbers larger than 1 naturally lead to such logarithms when we repeatedly take the $\log$ of them. So, there ...


7

Calculating eigenvalues involves solving for the roots of the characteristic polynomial, which is of degree equal to the order of the size of the matrix. When you input real numbers, it can search for the roots of the polynomial using numerical techniques. When you input exact integers (or rationals, probably) it tries to find exact answers for the roots of ...


6

As has been noted by ruebenko in the comments, there does seem to be a bug in the handling of infinite-range Bessel function integrals when MinRecursion and MaxRecursion are both set to non-default values. For instance, even the simple NIntegrate[BesselJ[0, x], {x, 0, ∞}, MinRecursion -> 10, MaxRecursion -> 15] chokes with a NIntegrate::minmax ...


6

The numbers you have, like 0.0161028 - 0.0119647 I are floating point (machine precision) numbers. Whenever you do calculations with floating point numbers, you will get roundoff errors. Note that you appear to have 7 or 8 digits of accuracy in the numbers. The "error" in the imaginary part is in the 18th decimal place. This is roundoff error. See this for a ...


6

First of all, as you seem to indicate, you don't have the problem with accuracy if you use := (SetDelayed) in your function definitions instead of = (Set), although, as you say, with this change it takes longer to evaluate f. The accuracy improves because Mathematica will calculate the Hermite polynomials accurately when x is Real. Using Set for the ...


4

The problem has to do with precision in numerical approximations. During the evaluation of your function Mathematica has to deal with really huge numbers, so you have to make sure that during this computation everything is evaluated up to a very high precision. One way to achieve that is by specifying the initial argument with high precision. For example, if ...


4

As Matariki pointed out in comments, this is a simple syntax error. The infix version of Or in Mathematica is ||, not |. Change this, like so: Xhcmaleorfemale[maleorfemale_, h_] := Which[(h < 3 || h > 7), 0, (h > 2 && h < 8), Which[maleorfemale == 0, Xhcmale, maleorfemale == 1, Xhcfemale][[h - 2]]]; And you will get ...


3

The references mentioned in the other answer do not really pertain too much to the problem of minimax approximation; they are more concerned with the other functions in FunctionApproximations` that deal with numerical differential equation solving; that is, the content that was once in the old NumericalMath`packages Butcher` and OrderStar`. Indeed, a look ...


2

Your functions for y and x are single values and not lists, and thus doing a ParametricPlot for the sum of these is not going to work. However, to solve the equations and get a plot you can run the following: alpha = 0.5 beta = 1 solf[b_, c_, tp_] := Module[{sol}, sol = NDSolve[{x'[t] == -x[t]*a[t] - 3*x[t] + alpha*y[t]^2 + 1/2*beta*(r1[t]^2 - ...


2

Is this routine guaranteed to return a value between x0 and x1 if there is in fact a unique local maximum there (i.e., guaranteed to not jump outside the interval)? Nope. Consider for instance a simple example: FindArgMax[Sin[x], {x, π/2 - π/6, π/2 - π/12}] {1.570796326793869} where we see that the known maximum at $x=\pi/2$ was found, which is of ...


2

As an illustration of my initial comment, let's look at various starting points, following @Andrew's method: sols = Table[ NDSolveValue[(2 + Sqrt[2] + s^2 - (-2 + Sqrt[2]) s^4 + s^6)/(1 + s^2)^2 yy[s] - (1 - s^2)^2 yy''[s] == 0 && yy[start] == yy'[start] (start + 1) && yy'[start] == 1, yy[s], {s, start, 1}], {start, -1 + ...


1

As a workaround it is possible to step up a bit from the left end: leftend = -1 + 10^-8; NDSolve[(2 + Sqrt[2] + s^2 - (-2 + Sqrt[2]) s^4 + s^6)/(1 + s^2)^2 yy[s] - (1 - s^2)^2 yy''[s] == 0 && yy[leftend] == 0 && yy'[leftend] == 1, yy[s], {s, leftend, 1}][[1]]



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