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

learn more… | top users | synonyms (1)

1
vote
1answer
89 views

singularity in boundary value problem

I am trying to solve a non linear differential equation with variable parameter. ...
0
votes
1answer
297 views

How to force numeric evaluation?

I need to evaluate the PolyLog function at some points, but I'm interested in numeric values. E.g. PolyLog[3, 2.7] works fine, ...
2
votes
1answer
87 views

FiniteDifferenceDerivative of complex function in 2D--bug?

I want to compute partial derivatives of complex functions via finite difference approximation on two dimensional grid using NDsolve`FiniteDifferenceDerivative ...
13
votes
2answers
581 views

more numerically accurate inverse matrix

I encountered the following matrix mat = {{2, 2.161209223472559` + 1.682941969615793` I}, {2.161209223472559` - 1.682941969615793` I, 2}} and ...
6
votes
2answers
333 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}}$. ...
1
vote
0answers
45 views

Rescale large numerical factors in rational functions

Given a rational function $$ f(x_1,x_2) = \dfrac{r_1 x_1^2 + r_2 x_2}{r_3 x_1 + r_4 x_2}, $$ with $r_i$ arbitrary real or complex numbers, is there a built-in function to get Mathemtica to rewrite as $...
10
votes
2answers
223 views

Demonstrating the behavior of a function as its independent variable approaches zero

I have several questions regarding the function $$f(x)=\frac{\sqrt{x^2+9}-3}{x^2}$$ that I would like to help my students with in the upcoming semester. Now, the limit as $x\to 0$ is 1/6. ...
2
votes
1answer
745 views

How to guess initial complex value for FindRoot

I have to solve a transcendental equation for a parameter, say $\beta$. Now, the $\beta$ has a range from $ik$ to $k$ where $i$ is the usual imaginary root $\sqrt{-1}$ and $k$ is a real number. ...
16
votes
1answer
2k views

What are the algorithm details of FindRoot?

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system". But I ...
3
votes
2answers
71 views

Solving an integral equation for upper boundary

I am reading a paper on High Harmonics Generation (HHG) and a Lewenstein model The paper is here. I would like to reproduce some results but I am stuck at the following problem. I have: $$p(\tau_b,\...
0
votes
1answer
416 views

Solve function doesn't work

I have the following system of equations that I need to solve: ...
0
votes
0answers
473 views

Laplace PDE in a polar coordinate system

I want to solve a Laplace PDE in a polar coordinate system with finite difference method, but I have a problem with boundary conditions at r = 0. Here is what I ...
0
votes
0answers
73 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 ...
3
votes
1answer
38 views

How can I perform arithmetic on a list integers and some other exact numbers and get decimal numbers in the result?

I want to do a simple calculation with a list with Pi and 10^-6 and get a list of decimal numbers as the result. ...
1
vote
0answers
103 views

Problem setting boundary conditions with NDSolve [closed]

I have the following system of PDEs for which I have given parameters $\gamma, \tau$ and $\mu$, $$\begin{align} T_t = &\ \gamma\,(L +\tau F-T)\\ F_t = & -F_x-(F-LT)\\ L_t = &\ \mu L_{xx}+...
3
votes
1answer
102 views

Fast evaluation of a function in many points

I need to feed to an external program a number of points (in Complex128 format) generated from the numerical evaluation of some function, e.g. $e^{i \vec{k}\cdot\...
0
votes
0answers
34 views

Handling a matrix with components greater than machine precision

I have four quantities stemming from a 4th order differential equation. I can represent these as a vector which is a product of a 4X4 matrix $$ M=\left\{v,\frac{\partial v}{\partial x},\frac{\partial ...
2
votes
2answers
171 views

Maximizing over an integral with a single parameter

There is probably a neat approach to solve this problem...but can't get to it at the moment. How do you maximize an integral with respect to a single parameter? My code below produces error messages. ...
0
votes
0answers
37 views

Multi-Precision [duplicate]

I have read in some numerical Laplace inversion papers that we can take advantage of multi-precision environment in Mathematica , Maple and etc.Can someone please explain it for me why it is not ...
2
votes
1answer
73 views

Improving working precision of LegendreP[n,x]? [duplicate]

I was trying to evaluate N[LegendreP[5,0.1]] The cell gives me: N[LegendreP[5,0.1]]=0.178829 However I wanted more ...
1
vote
0answers
78 views
11
votes
1answer
352 views

Does NRoots own an abstract counterpart? If not, can we write one?

We know when solving linear algebra equations, despite its abstract syntax, LinearSolve is much faster compared to Solve: ...
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 ...
4
votes
1answer
116 views

Impact Crater Sim. with added criteria

I have been trying with out success to edit this impact crater simulation script into producing a variable which calculates crater density. In addition I have been trying to figure out how to ...
0
votes
1answer
45 views

Strange eigenvector behaviour for matrix with large numerical values

I'm trying to compute the eigenvectors of a matrix with large numerical values $$ \left( \begin{array}{ccccc} 0 & 1.\times 10^{18} & 100 \text{X} & 0 & 1.\times 10^{11} \text{X} \\ ...
-2
votes
1answer
85 views

Tricky ellipse problem [closed]

I have this equation and I need to show it is en equation of ellipse, could anyone help me? 5x^2 - 4xy + 5y^2 = 21
0
votes
0answers
40 views

Mathematica Stops Working

When I run the following code (taken from a Mathematica Blog) which is solving the NS equations; ...
21
votes
3answers
460 views

How to improve performance of BesselJ to the level of GSL?

Consider the following code: zs = N /@ Range[0, 12, 10^-5]; AbsoluteTiming[bessels = BesselJ[1, #] & /@ zs;] Length @ zs I've tried to measure only ...
1
vote
1answer
93 views

Help with findroot optimization

I'm trying to solve the set of coupled equations $$\frac{-N -2( \lambda + N(\frac{\beta}{\epsilon}-\lambda))\upsilon_l + N \upsilon_l^2-2(N-1)\gamma\upsilon_l^3}{\gamma-2\lambda\upsilon_l^2+\gamma\...
8
votes
3answers
202 views

Complex result for Real vectors in VectorAngle

I was expecting a real angle using VectorAngle when passing real valued vectors, but I obtained a complex angle: ...
0
votes
1answer
72 views

Implementing AiryAiPrimeZero function

There are some functions implemented in the Wolfram Language related to Airy functions. For example, AiryAi, AiryAiZero or ...
0
votes
0answers
38 views

Numerical derivative of a function which solves a nonlinear system of ODEs

My dear friends, I want to study a nonlinear system of ODEs and to plot a function and its derivative which is defined from the functions of the system of ODE. The question is how to find the ...
7
votes
2answers
199 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 ...
1
vote
1answer
66 views

Error with NDSolve when used for a nonlinear system of PDE's

I am trying to solve the following system of Hamilton-Jacobi PDE's: $ V_1,_t - 0.5 V_1,_x^2/(1 - 0.2x)^2 + V_1,_x(0.1x^2+0.03x+.0.01)/(1 - 0.2x)+0.03(x-0.5)^2-V_1,_x V_2,_x/(1 - 0.2x)^2=0$ $ V_2,_t - ...
3
votes
1answer
312 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
2answers
127 views

Torus-geometry algebraic equations using Nsolve and Reduce

Somehow a set of naive-looking equations cannot be solved by using NSolve. Mathematica returns a message like this: ...
4
votes
2answers
83 views

N not behaving in the way I expected it would

I'm trying to use the N function to find the percent error between a function and a rounded value of that function. The code looks something like this. ...
2
votes
1answer
107 views

Is there a good way to check, whether a small value produced numerically is a symbolic zero?

I have a complicated 4x4 matrix and need to know the eigenvalues. I expect a zero eigenvalue for physical reasons. Giving numerical values first gives me an eigenvalue of $\mathcal O(10^{-15})$. Now ...
2
votes
1answer
110 views

NDSolve with two parameters

I was trying to solve a ODE numerically. It has two parameters (w and z0) which I want to vary. The following code gives an ...
0
votes
0answers
85 views

Solving a second order ODE numerically

I am trying to solve the following second order linear ODE numerically (for small w, say) y''[x]+ D[f[x],x]/f[x] y'[x]+ w^2/(x^2 f[x])^2 y[x] == 0 where, ...
0
votes
1answer
262 views

How could I solve this Reaction-Diffusion PDE using mathematica?

I'm modeling a problem with PDEs, So I gotta solve numerically this Reaction-Diffusion Partial Differential Equation $$ \frac{\partial u(t,x,y)}{\partial t}=D\Big( \frac{\partial^{2}u(t,x,y) }{\...
44
votes
3answers
14k views

Why round to even integers?

According to the Mathematica help: Round rounds numbers of the form x.5 toward the nearest even integer. For example: Round[{0.5, 1.5, 2.5, 3.5, 4.5}] ...
3
votes
0answers
121 views

How can I invert a Laplace transform numerically?

I have a very complicated expression, which I want to transform using the inverse Laplace transform. The built-in function InverseLaplaceTransform doesn't work. So,...
1
vote
0answers
67 views

Heron's Method of Square Root Calculation Issue with Previous Suggestion [closed]

Being interested in limit points, which always seem just a little out of reach for me, I recently came across a previous question and answers concerning Heron's (Babylonian) method for calculating ...
4
votes
1answer
140 views

Derivation of numerical scheme for linear transport equation on a variable stencil

The question is about automatica derivation of coefficients of numerical scheme on a variable stencil. So, lets consider 1d transport equation \begin{equation} (1)\qquad u_t+u_x=0. \end{equation} To ...
6
votes
2answers
556 views

Any ideas on how GeneralMiniMaxApproximation is implemented?

GeneralMiniMaxApproximation is used to construct minimax approximations of parametrically defined functions. I am curious about how ...
1
vote
1answer
811 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. Ideally I'd be able to find the smallest value of $x_{n\nu}$ for $\exp(-kr\pi)$ close to 1, and ...
1
vote
1answer
82 views

Nonlinear 2nd order ODE with regular singularities

I am tring to solve the following ODE with NDsolve $2x~(1-x)~f''(x)+(3-4x)~f'(x)+a~f(x)+b~f^n(x)=0;~~a,b\in\mathbb{R},~n\in\mathbb{N}$. The mathematica "code" is: ...
0
votes
2answers
118 views

Strange behavior of Plot over a domain containing very large x-values

When I plot a function of (1 + 1/n)^n,There you can see: Plot[{(1 + 1/n)^n, E}, {n, 1, 10^13}] When I add a option of ...
6
votes
2answers
223 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, ...