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

learn more… | top users | synonyms (1)

9
votes
0answers
547 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$$ ...
8
votes
0answers
462 views

Numerically solve 2nd order differential equation with singularity

Consider a second order differential equation with a potential that diverges at some generic value in the variable. For example: $$-y^{\prime\prime}(s)+\frac1{\mathrm{cn}{(s\mid k^2)}}y(s)=0$$ where ...
6
votes
0answers
151 views

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

I encounter a problem (Mathematica 7) similar to Strategies to avoid LessEqual::nord in NMinimize? but the advised strategies don't work for me. Also, I get different results with different ...
5
votes
0answers
109 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 ...
5
votes
0answers
270 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 ...
4
votes
0answers
824 views

Numerically solving system of partial differential equation

I am trying to solve a system of partial differential equation with boundary conditions. But I got an error message saying NDSolve::icfail: Unable to find initial ...
4
votes
0answers
410 views

Semidefinite Programming

I want to solve a numerical optimization problem using semi-definite programming. Is there a package or add-on that equips mathematica with this functionality?
3
votes
0answers
245 views

How to determine BLAS/LAPACK implementation used internally for numerical matrix operations?

Is there a command which reveals which implementation of BLAS and LAPACK are used in Mathematica's matrix operations such as Eigensystem? I asked a related question ...
3
votes
0answers
90 views

Tools for Stability/Automatic Error Analysis in Mathematica

I have a longer analytic expression in several variables containing special functions and others. Does Mathematica bring tools - or are there any packages - to examine the stability when I evaluate ...
3
votes
0answers
66 views

Understanding NDSolve::ndsz

I'm working on a largeish system of differential equations where I encounter the NDSolve::ndsz step size is effectively zero; singularity or stiff system suspected ...
3
votes
0answers
104 views

Strange NSum behavior

If I do: NSum[(i + 1)/(i + 2) LegendreP[i, 0] LegendreP[i, 0], {i, 0, Infinity}] I get: 1.25216 If I do: ...
3
votes
0answers
433 views

FindRoot gives a wrong solution which obviously should not be there

I got stuck on FindRoot and I didn't see any similar problem posted, so let me explain what I am trying to do and what problem I meet here. I try to find roots of a particular function, which in the ...
3
votes
0answers
372 views

A is fast, B is fast, but together they're Mathematica-crashing slow?

I'm trying to do something with finding solutions to a quantum mechanics problem with n wells. If there are 40 wells, I need to find the solution to an equation in the form: ...
3
votes
0answers
388 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 ...
3
votes
0answers
186 views

LeastSquare Solution for the Continuous Time Lyapunov Equation

I have been working with a problem which involves solving the continuous time Lyapunov equation $$A R + R A^\top = G$$ for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
2
votes
0answers
109 views

Volterra integral equation

I have to find an approximate numerical solution for the equation $$ F(x) - \lambda \int\limits_1^{x} \text{d}s \;s^2 F(s) Z(x-s) = G(x) $$ $$Z(s) = (\psi''(1-2\ h\ i\ s)- 0.5 \psi''(1-2\ h\ i\ s))$$ ...
2
votes
0answers
61 views

How can I use 'NIntegrate' to show the error?

I have to compute a very complicated integral, which is a 16-dimension one, so NIntegrate use Monte-Carlo. I have set Method -> "AdaptiveMonteCarlo, when I run ...
2
votes
0answers
82 views

How to handle infeasible points in FindRoot?

I am calling FindRoot[f[x,y],{{x,xInit,xMin,xMax},{y,yInit,yMin,yMax}}] where for some points {x,y}, ...
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. ...
2
votes
0answers
177 views

Speeding up a numerical constrained quadratic optimization

I'm trying to solve a quadratic optimization problem in 35 variables, $\vec{α} = \left< α_1, \ldots, α_{35}\right>$: $$ \begin{aligned} &\operatorname*{maximize}_\vec{α}&&1.0\cdot ...
2
votes
0answers
151 views

Why is FindRoot initial value far from the specified one?

I am trying to numerically find the root of a function that looks a bit like: 1/x - (SchurDecomposition[A[x]][[2]])[[1]], where ...
2
votes
0answers
400 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, ...
1
vote
0answers
27 views

Apparent issue with derivative of FractionalPart

This issue came to my attention from Math.SE: http://math.stackexchange.com/questions/1015325/is-the-derivative-of-x-on-0-1-always-equal-to-1/1015342#1015342 To summarize, it appears that ...
1
vote
0answers
49 views

Symbolic and numeric calculations (and plots) simultanuosly

I use Mathematica to do a bunch of symbolic calculations (integrals, ...). This is good because I found that sometimes, if I plug in numeric values, Mathematica takes much longer. However, sometimes ...
1
vote
0answers
57 views

Error when extending 1-dimensional PDE to 2 dimensions

I want to calculate how magnetic flux is trapped in a superconductor near the interface superconductor/vacuum. This problem already was solved analytically by J. Pearl for cylindrical symmetry (if ...
1
vote
0answers
170 views

Problem with NDSolve in Mathematica 9 / 10

I'm having trouble by solving the following differential equation in Mathematica 9 and 10, where the code works fine in version 7: ...
1
vote
0answers
92 views

Solve set of non-linear equations with least-squares-fitting - constrain results?

I'm trying to solve a set of functions to determine the material properties from a set of measurement values. (To set up this method I just want to fit my model with some already calculated data). My ...
1
vote
0answers
58 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 ...
1
vote
0answers
37 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 ...
1
vote
0answers
91 views

NMaximize and Accuracy

I have a problem with NMaximize which is best depicted by the following figure. The result indicates, that the solution mathematica finds seems to be smooth except a few outliers. How can I get rid of ...
1
vote
0answers
417 views

DSolve 2nd Order Coupled Partial Differential Equations

I am trying to use Mathematica to solve 2 coupled differential equations. My equations are of the form \begin{equation}\ddot{x}_i + A_{il} \partial^l A^{jk} ( \dot{x}_b \dot{x}_c - y_b y_c ) =0 ...
1
vote
0answers
727 views

How to Output Chi-Squared Statistics when using NonLinearModelFit

I am using NonLinearModelFit for some curve fitting and I was wondering if NLM is able to output chi-squared/leastsquared statistics from the best-fit parameters and confidence intervals. From my ...
1
vote
0answers
277 views

Adapting NDSolve to circumvent NDSolve::bdord: error for 1-D Euler Equations

I attempted to use NDSolve for the 1-D isentropic unsteady flow equations with low subsonic inflow velocity and prescribed inflow total enthalpy; along with a ...
1
vote
0answers
183 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)?
0
votes
0answers
21 views

Why numerical functions can't digest InterpolatingFunction with units?

Answering this question gave me the idea that I must be missing something.. In brief, numerical functions generally 'understand' units: ...
0
votes
0answers
39 views

plotting the stable and unstable manifolds of a difference equation

I have a 2D non-linear system of difference equations for variables x and y defined as follows: ...
0
votes
0answers
47 views

Handling Accuracy and Simplifying

I have the following problem. I have a system of non-linear equations that I log-linearize around a certain point, let's call it point A, using a function that I ...
0
votes
0answers
108 views

NMinimize ignores constraints

I have a problem with NMinimize - I try to minimize quite a complicated function and use a couple of constraints (the way it is shown in the documentation). Now, ...
0
votes
0answers
46 views

Why NDSolve With Orthogonal-Projection Method On Orr-Sommerfeld Equation Does Not Work(?)

I am attempting to solve the Orr-Sommerfeld equation for plane Poiseuille flow with the Orthogonal Projection method within NDSolve. The Orr-Sommerfeld equation is (a "stiff" problem); $\psi''''(x) ...
0
votes
0answers
36 views

Numerical Error with Matrix operations

A is a 3x3 matrix, b is a 3x1 vector. I try to convert [A|b], a 3x4 matrix, to [I|0]. So the formula is right multiple ...
0
votes
0answers
63 views

How to deal with matrices involved in system of SDEs?

This question is in continuation of the the previous posts Solving Stochastic differential equation and Fast Simulations with Compile. What I want to do is numerically solving the epidemic model which ...
0
votes
0answers
92 views

Plotting Geodesics in Kerr

I'm interested in plotting the trajectories of null geodesics near a rotating black hole (given by the Kerr solution) which involves a system of first order differential equations. Some Context (not ...
0
votes
0answers
82 views

NMinimize gives an obvious wrong value

I'm trying to minimize a function of 2 lists of the same lenght, but for now the first list has one element, the second is constant. Essentialy, this baffles me: ...
0
votes
0answers
39 views

NIntegrate Issue: Changing integration limits makes calculation time extremely long

After a long time developing some code in mathematica and finally getting it to work, I have unfortunately encountered an odd problem: When I change the limits of integration (and shift the function ...
0
votes
0answers
52 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
0answers
105 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 ...
0
votes
0answers
51 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 ...
0
votes
0answers
95 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: ...
0
votes
0answers
40 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
68 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 ...