Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

learn more… | top users | synonyms (1)

7
votes
1answer
258 views

Fractal dimension of a large networked molecular system

I am trying to determine the fractal dimension of this complex biomolecule (figure attached). Any clues as to how this can be done. In trying to determine this quantity, I wonder how its ...
7
votes
1answer
1k views

How can I get Mathematica to allow me to apply FindRoot to an expression that contains NIntegrate?

I am trying to run the following command in Mathematica: FindRoot[NIntegrate[D[f[x], x] / Sqrt[1 - x^2], {x, 0, 1}] - d, {a, 245}] As you might expect, a is ...
7
votes
2answers
194 views

Derivative of the Dedekind eta function fails to compute with errors I don't understand

When trying to understand better the question Eisenstein Series in Mathematica? I stumbled on the following: issuing Derivative[1][DedekindEta][.11 I] gives ...
7
votes
2answers
284 views

Mod[1.2, 0.2] is not equal to zero

Why doesn't the following expression evaluate to zero? In[1]:=Mod[1.2, 0.2] Out[1]=0.2 Edit: This is what I wanted to do: ...
7
votes
2answers
350 views

listplot very large numbers

Suppose we have the following function: NN = 150; W[n1_] := NN!/(n1 ! (NN - n1!)) (1/2)^n1 (1/2)^(NN - n1) Then we can Plot or Listplot it: ...
7
votes
2answers
235 views

How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
7
votes
1answer
824 views
7
votes
1answer
274 views

Synchrotron Radiation and ListDensityPlot

I'm trying to reproduce the following plots: As described by this blog entry: Synchrotron radiation As you can see in the linked article, the task is essentially to make a ...
7
votes
1answer
117 views

Need a generalization of RootApproximant to recognize linear combinations over algebraic numbers

RootApproximant does a very good job when I need to recognize an algebraic number and when enough of its digits are known (or even when an unlimited number of ...
7
votes
1answer
994 views

Using Mathematica to help to determine the consistency of and numerically solve systems of non-linear equations

The formal problem The question I am about to ask is applicable to many scientific and engineering problems. In short, I am bout to ask for pointers and practical advice for Mathematica beginners who ...
7
votes
1answer
146 views

Why don't 1. (0. + a) or (0. + 1. a) simplify?

I'm handling some mixed-numeric-analytic expressions, and I feel I'm missing some subtleties of how Mathematica handles simplification of such expressions. In particular, I was initially puzzled by ...
7
votes
0answers
269 views

Mathematica 7: “LessEqual::nord:” error when using NMinimize on a real function

Bug introduced in 7.0 or earlier and fixed in 9.0 I encounter a problem (Mathematica 7) similar to Strategies to avoid LessEqual::nord in NMinimize? but the advised strategies don't work for me. ...
6
votes
3answers
1k views

Why does N[1.000 01, 10] return 1.00001, but N[1.000 001, 10] returns only 1.?

Why is it so? When I ask for N[1.00001, 10] I get quite reasonably 1.00001 But when I ask for ...
6
votes
3answers
622 views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m ...
6
votes
2answers
413 views

Position function not always returning an answer even with no apparent problems

I'm having some problems with Position. Sometimes it will give an empty list instead of the actual position of the element I am looking for when that element is ...
6
votes
2answers
283 views

How to implement a numerically efficient Airy Zeta Function

Define the Airy zeta function for $n=2,3,\dots$, by $$ Z(n) := \sum_r \frac{1}{r^n}. $$ where the sum is over the zeros $r$ of the Airy function $\operatorname{Ai}$. In Mathematica the ...
6
votes
2answers
320 views

Inverse Laplace transform

Let $r=\mu = 0.15; \sigma = 0.05; T = 1; S_0 = 100; K = 95;$ Let $\nu:=\frac{2\mu}{\sigma^2}-1$ and $\eta \equiv\eta(\alpha):=-\frac{\nu}{2}+\frac{1}{2}\sqrt{\nu^2+\frac{8\alpha}{\sigma^2}}$. ...
6
votes
2answers
495 views

A problem about fixed point iteration theory

Description Recently, I have been learning a couse called "Numerical Analysis". The fixed point iteration theory was introducted to solve the ...
6
votes
3answers
367 views

Finding the square root of a squared number?

Taking the square root of the square of a number Variable set to a real value I'm wondering why these examples a = -4.3; Sqrt@a² Sqrt@(a^2) Sqrt[a^2] Sqrt[a²] ...
6
votes
2answers
348 views

Round vs. Floor vs. Ceiling for non-integers non-orders-of-magnitude

I understand that Round give the nearest even integer for cases where the number is between two integers, i.e. Round[2.5] = 2 ...
6
votes
3answers
563 views

Numerically integrating a list-valued function [duplicate]

I want to NIntegrate a List valued function foo[x] which is only defined for numerical ...
6
votes
2answers
548 views

Any ideas on how GeneralMiniMaxApproximation is implemented?

GeneralMiniMaxApproximation is used to construct minimax approximations of parametrically defined functions. I am curious about how ...
6
votes
2answers
148 views

How to speed up Min of DateObjects?

I'm in version 10.0.1 using a Dataset to do some plots and things. For one of the plots I need to get the minimum date of a some filtered set of the ...
6
votes
2answers
342 views

Infinite base two number to base ten

Suppose I have a base two number that repeats itself every five places (a number $x$ such that $0\le x<1$. For example: $$x=0.101011010110101101011010110101101011010110101...$$ What would be a ...
6
votes
2answers
221 views

Gamma function computation efficiency?

I wonder what kind of algorithm is used to compute the values for the gamma function. Specifically, I am interested in how the computational load increases when the complexity of the input grows. So, ...
6
votes
1answer
1k views

Mathematica NDSolve and 'Compile'?

Since the consensus is usually that NDSolve speeds fares badly against compiled code such as c++ ODE solvers using GSL say, is it possible to make up for this lag ...
6
votes
1answer
555 views

Is there no documentation for Method in Eigensystem?

There does not appear to be any documentation on how to use Method in Eigensystem, or at least not in Version 9.0.1 of ...
6
votes
1answer
213 views

Numerical error in Mathieu functions

Consider the MathieuCharacteristicA function, which is a piecewise function according to the documentation. The discontinuity happens at integer number. ...
6
votes
1answer
260 views

Iteration process involving several functions

I would like to carry out a following iteration process: Apply function f1[a_,b_,c_,d_] to a starting list l1={a1,b1,c1,d1}, ...
6
votes
1answer
315 views

Numerical problems with calculation of function

I have a problem with a calculation which I try to do with Mathematica (8.0.1). I have the following function which describes a cone (with half opening angle ...
6
votes
1answer
199 views

Trouble with shooting method for a 4th-order differential equation

I'm trying to solve the following forth-order ODE with the shooting method: $$\frac{1}{5}(y-2xy^\prime)=\frac{1}{x}\left\{\frac{xy^\prime}{y}+xy^3 \left[\frac{(xy^\prime)^\prime}{x} \right]^\prime ...
6
votes
1answer
2k views

Mutual Information involving two matrix states

I basically retrieved the following technique of evaluating the mutual information involving two matrices from this site at http://bmia.bmt.tue.nl/People/BRomeny/Courses/8C080/default.htm The ...
6
votes
0answers
75 views

Negative accuracy numerics ( 0``-128 notation )

What does it mean to have a negative accuracy number? I understand 0``128 to mean "the number zero to 128 decimal points". Mathematica corroborates this: ...
6
votes
0answers
473 views

NDSolve and memory usage

After some googling, i've found similar problems around, but didn't find a 100% satisfactory answer, so let me ask here: I'd like to solve a 1+1 problem using the method of lines. In spherical ...
5
votes
4answers
415 views

Display a number in Mathematica 9 in periodic form

I want to display a rational number in Mathematica in periodic style. PeriodicForm isn't working anymore. It worked in Mathematica 5 and now I'm using Mathematica ...
5
votes
4answers
2k views

Numerical differentiation methods

Is it possible to write code in Mathematica that implements various differentiation methods (like forward, central, extrapolated, etc.)?
5
votes
4answers
3k views

Numerical Differentiation using 1500 data points

I have a set of 1500 data points (which are some energy eigenvalues) corresponding to a parameter H0 (which represents magnetic field. H0 values are equispaced going from $-3.0$ to $3.0$ in steps of ...
5
votes
2answers
239 views

Strange phenomenon occurring in analytic integration result involving Bessel functions

For the following integral, Integrate[x^2 Exp[-a x^2 - b x^4], {x, -∞, ∞}, Assumptions -> {a > 0, b > 0}] Mathematica gives the following analytic ...
5
votes
3answers
126 views

Differentiate a numerically defined function

My function is f[a_, b_] := NIntegrate[Sqrt[(Cos[t] - a)^2 + b^2], {t, 0, Pi}] I want to calculate g[1,1] where ...
5
votes
3answers
381 views

How to cancel floating point factors?

I am currently having problems with some floating points. I have a function, which gives as an intermediate result (for example) ...
5
votes
3answers
302 views

Increasing the precision of a calculation

Clearly I have misunderstood how to do this: I seem unable to understand how to get more digits out of a calculation and I can't see why - the following piece of code illustrates the issue. ...
5
votes
2answers
128 views

A problem with Compile and Map

There is a weird behavior of Compile that I do not understand. Consider the following example: ...
5
votes
2answers
148 views

Evaluate numerically an extremely small number

How to evaluate numerically $e^{-4 \cdotp 10^{35}}$ in the form $0,a_1a_2...\times 10^{-n}$ ...
5
votes
3answers
235 views

Finding the conditions for degenerate solutions to a cubic equation

I have a cubic equation (corresponding to the band structure of a physical system) given by w in the code below. ...
5
votes
4answers
174 views

RegionMember with some tolerance?

Can I specify some tolerance for the new geometric-computation function? RegionMember[Line[{{0, 0}, {1, 0}}], {.5, 0}] (* True *) While: ...
5
votes
1answer
112 views

Changing the definition of N: unexpected $RecursionLimit::reclim error

I have some objects represented as follows: Object[data, param] data is a list of numbers, ...
5
votes
3answers
1k views

Solution for equation system with piece-wise defined functions

As I could swear this worked just yesterday, I am probably just doing something stupid here and I am sorry to bother you :) I am trying to find the point where a curve crosses a line. In this case, ...
5
votes
1answer
73 views

Finding the correct boundary conditions to a specific problem

I want to reproduce the following problem in the figure: $$\phi''+c\phi'\sqrt{m^2\phi^2+\phi'^2}+m^2\phi=0$$ where $\phi=\phi(x)$ with $x \in (-\infty,\infty)$, $c=\sqrt{3/2} \ $ and $m=0.2$. ...
5
votes
1answer
80 views

Can Someone Please Explain Internal`$SameQTolerance?

If I input Internal`$SameQTolerance (* output = 0.30103 *) which is the approximation of Log[10,2], or ...
5
votes
2answers
544 views

How can I numerically solve for fractional functions and fractional derivatives?

I would like to plot fractional functions. Say, $f(x)=\sin^{(1/2)}(x)$. By that, I mean that $f(f(x)) = \sin(x)$. Similarly, I can define a half-derivative to be an operator $H$ such that ...