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

learn more… | top users | synonyms (1)

8
votes
4answers
225 views

Numerical integration of a numeric data available as a nested list

I have some numerical data in the form of a list with the following structure: {...{x,y,z},...} defining a surface z=z(x,y) in a 3D space (x,y,z). The data came from a simulation, and I am ...
0
votes
1answer
80 views

How could we define a function recursively?

Let us first consider the constructon of the following simple iteration ...
2
votes
1answer
159 views

How to solve equations self-consistently

I want to solve the following equation self-consistently. So, H.u = e.u {{1, d}, {d, 1}}.{u1, u2} = e.{u1, u2} I guess an initial value for ...
1
vote
1answer
170 views
4
votes
2answers
141 views

Finding all/most roots of a discontinuous function more consistently?

I have the equation: f[x_]:=α Tan[α*a] - Sqrt[c - α^2] and ideally I want to find all of its positive zeros, given a and c, with variable alpha. The problem is ...
-2
votes
1answer
149 views

Problem with solving a differential equation [closed]

I need to solve the following differential equation: NDSolve[{R[r, t], R[r, 0] == r/1000}, R, {t, 0, 30}, {r, 1, 30}] Where ...
2
votes
1answer
340 views

intersection between two curves in Mathematica

I have two curves (drawn from points) in a plane, one is drawn with ListLinePlot and the other drawn with ParametricPlot. How ...
2
votes
1answer
121 views

How can I handle curve singularity in this NIntegrate integration?

Yesterday I asked a question about the non converging integral. Woods told me that it is due to the function which has a singularity along a line which passes through the integration region. (Why ...
1
vote
1answer
221 views
1
vote
1answer
104 views

How to calculate an integral of an expression that is determined numerically (in Mathematica)?

First of all, I am fairly new to Mathematica and Stackoverflow, so please feel free to give me any advice whatsoever. I aim to calculate an integral of an expression that has been determined ...
1
vote
1answer
348 views

Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the Equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
0
votes
0answers
153 views

Rounding values [duplicate]

In Mathematica 8 when I enter 1 - 0.99 - 0.01 I get 8.67362*10^-18 instead of zero. How do I fix this problem? I am getting ...
0
votes
0answers
148 views

Boundary Value Problem

I have to solve this boundary value problem: $$\frac{\mathrm{d}e_{3x}}{\mathrm{d}l}=(M_0+F_{0z}x-F_{0x}z)e_{3z}$$ $$\frac{\mathrm{d}e_{3z}}{\mathrm{d}l}=-(M_0+F_{0z}x-F_{0x}z)e_{3x}$$ ...
1
vote
1answer
108 views

Seemingly simple optimization problem is slow

I'm trying to generate a demand curve numerically, given a utility function. The function for the demand is defined like so: ...
2
votes
1answer
104 views

Computing derivatives of a moment generating function

Dear Mathematica users, I'm trying to compute higher order derivatives of a moment generating function and then evalutate them in 0 (in order to get some moment conditions for a GMM estimation). ...
1
vote
0answers
148 views

NDSolve error when solving a BVP

I'm trying to solve the following BVP with unknown parameters (p and phi) using NDSolve over the period {Pi, 2 Pi}: ...
7
votes
2answers
249 views

Precision differences

I run this sum and get the symbolic answer below : Sum[ (1/(k^2 - k) - 1/k^2), {k, 2, Infinity}] $2 - \frac{\pi^2}{6}$ I look up the sequence on OEIS and ...
13
votes
3answers
299 views

Make mathematica treat $e_i^2$ as numeric

With NumericQ[symbol] = True, I can declare that a symbol is numeric. I want the expressions matching: $$e_{\text{i$\_$}?\text{IntegerQ}}^2$$ to be treated as ...
5
votes
1answer
122 views

FindMaxValue specifics

I'm using FindMaxValue to study the distribution of maxima of Abs[RiemannSiegelZ[t]] between consecutive values of ...
0
votes
1answer
82 views

Non solutions returned by NSolve. And why does it return both phi and Cos[phi]?

Similarly to this thread NSolve gives additional solutions that don't satisfy the equations! NSolve returns "spurious" solutions, even increasing the working precision ...
4
votes
2answers
174 views

How to solve this trigonometric system of equations numerically?

How can the following trigonometric system of equations be solved numerically? ...
1
vote
1answer
108 views

Why does NSum fail here?

I want to evaluate a sum of integrals; each integral has a pole on the real axis and I handle this via the Cauchy Principal Value $ ...
2
votes
0answers
174 views

Numerically/Analytically Solving a System of Equations

I have $6$ functions $f_i(x,y,z)$, $(i = 1, \ldots, 6)$ in three variables $x,y,z$, and I would like to find a simultaneous instance of these variables, say $(x_0, y_0, z_0)$, such that $f_i(x_0, y_0, ...
7
votes
2answers
378 views

How do you force a decimal output? [duplicate]

I have some very small values such as 2.601519253*10^-8. I'd like to output these values to CSV for another program to work with. I've tried N[value, 50], but Mathematica still insists on producing ...
3
votes
0answers
256 views

How can I solve this complicated custom function numerically?

I have a complicated function that calculates the total value of payments from an account into which deposits are made annually. I'd like to solve the function for a growth rate numerically, but ...
2
votes
2answers
139 views

Position function not always retuning 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 ...
3
votes
3answers
267 views

How can I solve Tan[t] - t == F[x] for t as a function of x?

How can I solve the equation Tan[t] - t = Ax, where A is a constant for t[x]? I know that ...
4
votes
2answers
293 views

Any ideas on how GeneralMiniMaxApproximation is implemented?

GeneralMiniMaxApproximation is used to construct minimax approximations of parametrically defined functions. I am curious about how ...
0
votes
1answer
144 views
0
votes
1answer
116 views

Industrial Level Applications. Recipe for mixed notation of equations set

I am working with large (linear) equations set within Mathematica in numerical notation. For example, set from 4056 eq. is solved for a second, no more. There is no doubt, result is great. But even ...
4
votes
1answer
144 views

How do I get a list of digits for a number?

I have this 200 digit number where I want to get the IntegerDigits, but the decimal point is in the way. ...
1
vote
0answers
133 views

Parallel linear algebra with arbitrary precision

Is it possible to do parallel linear algebra with arbitrary precision within Mathematica (in a simple manner, as is done for the machine precision)?
3
votes
2answers
163 views

Numerically finding a derivative jump of a function

How would I numerically find where a function has derivative jumps? In particular, I'm working with this function: ...
0
votes
1answer
501 views

Tricks for solving (lots of) coupled nonlinear equations numerically?

I have a system of 6 non-linear (quadratic) coupled equations with 6 complex unknowns \begin{align*} |x_1|^2 + |x_2|^2 + |x_3|^2 &= a\\ x_1 x_4^* + x_3 x_5^* &= b + c i\\ x_1 ...
9
votes
2answers
197 views

Determining the default Method used in optimization and root-finding algorithms

Is it possible to extract the Method which is used in functions like NMinimize, FindRoot, ...
0
votes
0answers
83 views

FindRoot is only passing two variables

When I run the code: q0 = FindRoot[findarea[ch, rh, ah, lineh, intersecth, q][[1 ;; 2]] == ah[[1 ;; 2]]*r3^2, {q, q0}][[1, 2]]; ...
4
votes
1answer
154 views

Is there a way to globally set when to treat a very small number as zero?

I understand that I can use Chop to force a very small number to be treated as 0 and can use ...
2
votes
0answers
115 views

Why to do parentheses change the results of a calculation?

I'm getting results that are sensitive to where I place parentheses with respect to operations that are associative1 (and should thus be insensitive to such placement). For example, if I define2 ...
0
votes
0answers
72 views

Applying individual values (e.g. from a list) to the gain variable of a common PID

I am currently implementing more things into my model of a common kitchen / manufacturing scale and came up with the idea to assign different values to the gain variables of the PID controlling the ...
2
votes
2answers
211 views

Plotting several numerical solutions plus the analytic solution of ODE in one plot

I want to be able to plot several numerical solutions of an ODE plus its analytical solution in one plot in order to see how the numerical solutions converge towards the analytical one w.r.t. the ...
2
votes
3answers
594 views

How can I differentiate Numerically?

Mathematica has two ways to integrate: Integrate and NIntegrate. But what about D? ...
0
votes
1answer
171 views

How do I numerically solve a custom function?

Whenever I use functions like FindRoot or NDSolve, it sends x through the function and deals ...
7
votes
1answer
238 views

Symbolic Integration along contour: branch cut problem?

Context Following this question on path integrals in the complex plane, having defined again a numerical and symbolic integrator along a path as ...
12
votes
1answer
386 views

How to compute the inverse CDF properly?

I want to compute the CDF and inverse CDF of the hyperbolic distribution: α = 2; β = 3/2; x = -3; u = N[CDF[HyperbolicDistribution[α, β, 1, 0], x], 30] The ...
4
votes
2answers
251 views

Can the CholeskyDecomposition function in Mathematica be made to work on non-symmetric matrices?

The CholeskyDecomposition[m] function in Mathematica requires a symmetric and positive definite matrix m. For instance, the ...
7
votes
0answers
280 views

Dual complex integral over implicit path using contour plot

Context I am interested in doing double contour integral over paths which are defined implicitely. For the sake of debugging, let's assume its $$\oint_{\cal C}\oint_{\cal C} \frac{1}{u\, x} d u d x$$ ...
3
votes
1answer
333 views

Symbolic integration in the complex plane

Context While answering this question, I defined (symbolic and numerical) path integrations as follows ...
3
votes
0answers
227 views

Numerically solving PDE with high precision

I want to numerically solve the PDE $\partial_t u(t,x)=c\partial_x u(t,x)+(mx-l)u(t,x)$ with some initial and boundary conditions and given parameters $c$, $m$ and $l$. Consider the code ...
6
votes
1answer
311 views

Is Abs[z]^2 a bad way to calculate the square modulus of z?

For a numerical quantity z, Abs[z] returns the square root of the sum of the squares of the real and imaginary parts of ...
7
votes
1answer
341 views

Implementation of Incomplete Fermi-Dirac Integral in Mathematica

I'm working on a special algorithm to implement a more accurate effective mass calculation for hole carriers in silicon in Mathematica. This rather involved algorithm uses incomplete Fermi-Dirac ...