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

learn more… | top users | synonyms (1)

2
votes
1answer
72 views

Finding a root of a parameterized integral

I have a function given as a parameterized definite integral: f[a_] := Integrate[BesselJ[0, x - a] BesselJ[0, x + a], {x, -∞, ∞}] I suspect it has a root near ...
1
vote
1answer
51 views

Numerical evaluation of ChebyshevT

When I evaluate the following Chebyshev series of the first kind in two different ways, I get two very different results: ...
0
votes
1answer
83 views

how to solve second order nonlinear coupled differential equations using NDSolve with hyperbolic function

i have to solve some solitons scattering through this coupled equations. i need to get two different graph, but still the graph did not come out. and also the equations quite complicated containing ...
15
votes
0answers
576 views

Fast Spherical Harmonics radiative transfer

This is a rather specific question and I apologize for spamming you with some lengthy code. But it could be interesting for some reader and maybe you can help out, so please bear with me. I am using ...
8
votes
0answers
489 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$$ ...
6
votes
0answers
384 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
136 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
194 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
707 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
340 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
83 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 ...
3
votes
0answers
84 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
103 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
332 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
319 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
355 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
171 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
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
54 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 ...
2
votes
0answers
152 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
137 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
329 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
52 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
47 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
34 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
201 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 ...
1
vote
0answers
82 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
273 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
248 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
170 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
45 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}, ...
0
votes
0answers
57 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
64 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
28 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
43 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
91 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
48 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
87 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
28 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
33 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
0answers
47 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 ...
0
votes
0answers
89 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
0answers
79 views

Ternary and binary searches in Mathematica?

Does Mathematica implement binary search to find a 0, and ternary search to find a local min/max?: http://en.wikipedia.org/wiki/Binary_search http://en.wikipedia.org/wiki/Ternary_search As ...
0
votes
0answers
133 views

NMaximize, restart

I have to optimize some contrained functions and I am trying to use NMaximize. I have the following problem (see code below). I use ...
0
votes
0answers
95 views

Getting increased accuracy for roots of determinant

I have a matrix $a(\kappa)$ from which I am trying to determine $\kappa$ by using the equation $det(a(\kappa)) = 0$. The matrices I deal with are on the order of 100 X 100 to 500 X 500. Originally I ...
0
votes
0answers
129 views
0
votes
0answers
175 views

How to implement an implicit iterative method for solving SDEs?

I wish to numerically solve the Black-Scholes SDE as follows $$ \begin{array}{lll} dX(t)&=&\mu X(t)dt+\sigma X(t)dW_t, \ \ \ 0\leq t\leq1,\\ X(t_0)&=&X(0), \end{array} $$ with the ...
0
votes
0answers
147 views
0
votes
0answers
525 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 ...
0
votes
0answers
147 views

Assigning numerical values to constants results in complex coefficients in Equations of Motion

I am using Mathematica to get the Equations of Motion (EOM) for a mechanical system (using Lagrangian Mechanics). While I get the EOM in symbolic form, on introducing the following code for assigning ...