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

learn more… | top users | synonyms (1)

1
vote
0answers
53 views

How to find a scaling parameter in matrix inversion process by MMA?

I simply would like to find the inverse of a given matrix $A$ by the iterative method $X_{k+1}=X_k(2I-AX_k)$ using $X_0=\frac{1}{\sigma_{max}^2}A^*$. An example is as follows ...
5
votes
3answers
214 views

Numerical evaluation of a sum

I am trying to compute numerically NSum[(-1)^n/n^3, {n, 1, Infinity}]. Of course, using first Sum would work here, but often ...
0
votes
1answer
121 views

Solving for the time-evolution operator in a periodically driven system

I am looking at the Hamiltonian $$H(t)=\begin{pmatrix} 0 & e^{i\Omega t}\\ e^{-i\Omega t}& 0\end{pmatrix}$$ I am trying to solve for the unitary operator $U(t,0)=\mathcal{T}\exp(-i\int_0^t ...
0
votes
2answers
154 views

find the real root

I have the following equation: \begin{equation} (y-1)^{b1} - C~~ y~~ \exp(a x)=0 \end{equation} where $a, b$ are real constants, $C$ may be a complex number. I need to find the real solution of the ...
0
votes
1answer
77 views

Numerical vs Symbolic Integration: Loss of precision

I am trying to integrate the following expression over the time interval $0\leq t \leq \text{period}$. ...
1
vote
1answer
150 views

Runge-Kutta 2nd Order ODE Solver

Suppose I have a 2nd order ODE of the form y''(t) = 1/y with y(0) = 0 and y'(0) = 10, and ...
0
votes
1answer
99 views
4
votes
3answers
492 views

Creating a 3D List Line Plot From Discrete Points

Given the following Runge-Kutta ODE solver and the graphical output below, how do I get a 3D line plot instead of a 3D point plot? I see that there is no ListLinePlot3D function, so I thought it might ...
0
votes
2answers
141 views

Numeric mixed derivatives

In short I need NumericCalculus`ND extended to mixed partial derivatives. This can be done by nesting them, but care has to be taken to evaluate underling ND only when the parameters become numeric. ...
0
votes
0answers
45 views

Ideas for NDSolve?

I'm currently trying to find a numerical solution to a differential equation of the form: D[W[X], {X, 4}] ==(-(1/(delta + G - (G X)/L)^2) + 1/(delta + (G X)/L)^2) ...
0
votes
1answer
92 views

How to implement the second loop

Here I have a problem that probably needs two loops, but I am not sure how to implement them together. The code calculates M for various values of parameter ...
0
votes
0answers
97 views

Mean Squared Deviation for Population Data

I've been using the Lotka-Volterra equation to estimate population sizes and need to find the MAD (mean absolute deviation), MSD (mean squared deviation) and mape (mean absolute percentage error) for ...
2
votes
0answers
63 views

Complicated output from simple Eigenvalues problem

I have code that uses Eigenvalues on matrices of various sizes. But the output of what should be a very simple problem, namely finding the eigenvalue of a 1x1 matrix, is overly complicated. ...
0
votes
1answer
105 views

NMinimize holding problem

I have a function that I want to minimize numerically through an NMinimize command (because it's very complicated analytically). The minimizer call looks as follows: ...
4
votes
1answer
119 views

NDSolve - sampling for result during the computation

I am using NDSolve for a Langevin dynamics problem. I want to the know long term behaviour of my system ($t>1$) but it has to be simulated with very small time steps ($dt\sim 10^{-9}$). An example ...
2
votes
1answer
162 views

Area between Contours in ContourPlot

I feel slightly foolish for asking this because I am so close, but I'm having trouble, so I will anyway. I asked this question two days ago regarding finding the lengths of contours. Now, I'd like to ...
0
votes
0answers
50 views

Numeric function not fully evaluating

I'm running into an issue where it seems Mathematica is not fully evaluating the output of my function h[t_]. I included the definition of phi[t_] just to demonstrate that it is a numerically defined ...
2
votes
1answer
240 views

Different Poincaré maps for same Equation

I've seen the Wolfram Poincaré example. I'd like to modify this sample in order to have a list of Poincaré maps. In the example the event is captured only when ...
4
votes
1answer
167 views

Find lengths of contours in a ContourPlot

I am trying to find the lengths of different contours in the following plot: It is a complicated piecewise function evaluated on the unit disk. I am hoping there is an easy, generalized way to ...
0
votes
0answers
92 views

complicated Numerical Integration, FEM application

I am trying to calculate a 2d Integral which has another 2d integral in the integrands. here is the setup: ...
2
votes
1answer
41 views

Results of ArgMax as a function of a parameter with InterpolatingFunctions

I would like to obtain a function and its derivatives, where the function is defined as the solution to a maximization problem. The obvious approach ...
0
votes
0answers
29 views

NMaximize not satisfying binary constraint

I'm solving an optimization problem in Mathematica with binary integer constraints. It works alright with other constraints. But the only problem is that both NMaximize and NArgMax are not treating ...
0
votes
0answers
44 views

FindRoot with units error: Message text not found

This is sort of embarrassing. I'm working on a document to extol the virtues of Mathematica, and I can't get it to solve a relatively simple system of equations involving units. In this code, when I ...
0
votes
1answer
57 views

NIntegrate and NumericQ [closed]

I need to do numerical integration --> differentiation --> numerical integration. I tried to apply the technique described in the accepted answer to a similar question: ...
0
votes
1answer
75 views

Scaling the time axis of an interpolated function (as in a solution from NDSolve)

I'm wondering how I can change the units of the x (time) axis when plotting a solution from NDSolve. I have obtained three solutions to a system of differential equations, all of which exist over the ...
2
votes
2answers
171 views

How to solve this numerically?

May I ask what is the best way to evaluate ...
4
votes
1answer
427 views

Why IntegerPart[x/(x/2)]=1?

Consider this code x = 0.109354682484; IntegerPart[x/(x/2)] (* 1 *) Precision[x] (* MachinePrecision *) Why does it give 1 ? Version number: 9.0 on Mac 10.9.2 ...
1
vote
1answer
84 views

Discrete sampling of interpolating function returned by NDSolve

When solving an ODE with NDSolve, Mathematica returns an interpolation function. I need a discrete sampling of this function however. Naively, I can write this as (example): ...
0
votes
1answer
249 views

Heat Transfer equation by numerical methods

I want to solve the following heat conduction equation using numerical methods: D[u[x, t], t] -alpha*D[u[x, t], {x, 2}] == 0 u[x, 0] == 1/(1 + x^2)^0.25, u[-10, t] == u[10, t] == 0, ...
1
vote
0answers
35 views

How to find discretezation error of NDSolve

Is there a way to find out how large the truncation, round-off, and other errors that occur from discretizing a differential equation are while using the default settings in NDSolve? Or would I have ...
0
votes
0answers
52 views

FindRoot to find numerical solution of a given index

I want to find solutions of a system of multivariate nonlinear equations of a specific index (i.e., the no. of positive eigenvalues of the Jacobian evaluated at the solution). I know the FindRoot ...
5
votes
1answer
89 views

How to enforce numerical precision throughout a package

I developed a big package that does quite a bit of numerics. Is there a way to enforce that all numerical computations are done with a pre-defined accuracy? For example, can one use something like ...
1
vote
2answers
150 views

Mathematica can't minimize a function

Mathematica seems not to be able to minimize this univariate function over integer arguments, $r>2, r \in \mathbb{Z}$. ...
1
vote
1answer
106 views

Numerically solving an ODE for a parameter

My equation is as follows: sol = ParametricNDSolve[{(f'[r]^2 - 1) f'[r] r == 6.2 (f'[1])^2/1000, f[1] == a}, {f}, {r, 1, 3}, {a}] where the function ...
0
votes
0answers
105 views

Boundary Value Problem- using NDSolve or another method

I am trying to solve a set of coupled partial differential equations, with defined boundary conditions using mathematica. Here are the equations and the boundary conditions. ...
0
votes
1answer
134 views

Trying to solve a transcendental equation involving bessel functions

I've never used Mathematica before and am trying to numerically solve equation (12) from this paper: http://arxiv.org/abs/hep-ph/9907218v2. Ideally I'd be able to find the smallest value of $x_{n\nu}$ ...
1
vote
1answer
153 views

Numerical Instability?

Current Status Please skip ahead to Update 2: the key questions are now: 1/ Why does Mma generally fail to find the minimum for a well behaved function when the function does not have infinite ...
4
votes
3answers
168 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. ...
0
votes
1answer
103 views

How can I obtain more significant digits? [closed]

I type f1[x_] := 12 x^5 - 975 x^4 + 28000 x^3 - 345000 x^2 + 1800000 x N[f1[15.5], 15] and obtain 3.74112*10^6 BUT It´s not true!!! the result is larger than ...
2
votes
1answer
84 views

NIntegrate Warning / Error Messages

I am doing: NIntegrate[Sin[Exp[(x^4)]], {x, 2, Infinity}, PrecisionGoal -> 12] It prints out a host of warnings, but also shows the results as: ...
1
vote
2answers
121 views

NDsolve with variable end-point

I want to plot the solution a coupled ODEs as a function of the end point only. Mathematica code: ...
2
votes
1answer
128 views

Fourier Transform Help

I'm trying to do a Fourier Transform of the following Data, but I'm completely stuck. Here's what I've done so far: ...
17
votes
1answer
295 views

How to work with Experimental`NumericalFunction?

This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?" Oleksandr R. correctly states in the comment: A ...
4
votes
2answers
156 views

Floating point addition not associative

Can anybody explain the following behavior? x = 0.2 + (0.3 + 0.1); y = (0.2 + 0.3) + 0.1; x == y (* -> True *) But actually the variables do not exactly ...
0
votes
1answer
115 views

Fixed Point Math in MMA

I am working with a library that needs input in a Fixed Point notation. I’d like to figure out a way to convert the floating point results into fixed point representation. The fixed point length is ...
2
votes
1answer
63 views

Why is left NumberPadding always applied in NumberForm?

I would like to display numbers like 9.0001 and 10.0001 in the fixed-width form of xx.xxxx. ...
4
votes
1answer
202 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 ...
3
votes
1answer
271 views

N[number, 100] does not give 100 decimal places [duplicate]

Please look at this computations: a = N[Sqrt[2], 20]; N[a^2, 100] The output is 2.0000000000000000000, which is apparently not $a^2$ to 100 decimal places. ...
-1
votes
1answer
141 views

Multiple NIntegrate (again)

Basically I have the same question as here: Multiple NIntegrate but since I don't have enough "reputation" I cannot comment there. I want to solve the following multiple Integral numerically at given ...
4
votes
0answers
94 views

NMinimize seems to call function with the same values multiple times

I have to minimize a function where the evaluation of one parameter set takes very long (around 5sec) and discovered alongside, that NMinimize seems to call this ...