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

learn more… | top users | synonyms (1)

6
votes
1answer
208 views

Trouble with shooting method for a 4th-order differential equation

I'm trying to solve the following forth-order ODE with the shooting method: $$\frac{1}{5}(y-2xy^\prime)=\frac{1}{x}\left\{\frac{xy^\prime}{y}+xy^3 \left[\frac{(xy^\prime)^\prime}{x} \right]^\prime \...
9
votes
3answers
293 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
3
votes
2answers
105 views

Unexpected behavior from Accuracy

This is my code Table[With[{x = 10^n + 1/17}, N[x, {Infinity, 5}]], {n, 0, 5}] // Column Or like this ...
1
vote
1answer
47 views

System of ODEs - NDSolve issues

I am a self-taught beginner trying to use Mathematica for the first time. If you wouldn't mind, I would like to ask for help with the code I am working on as I keep running into multiple issues when ...
5
votes
1answer
104 views

Compilation, square roots, and integers

After looking at this question, particularly this answer, I wrote my own performance test, using the two functions ...
4
votes
1answer
130 views

Saved InterpolatingFunction behaving badly

Bug introduced in 10 and persists through 10.3.1 or later I created this InterpolatingFunction, and NIntegrate gives an ...
10
votes
3answers
395 views

Bug: Wrong results from NSolve on coupled polynomials. WorkingPrecision->Automatic fails

OP UPDATE: I received an email from WR on 1-18-2016: "...It does appear that the NSolve function is not behaving properly in this case and I have forwarded an incident report to our developers with ...
0
votes
0answers
58 views

Error message when using a compiled function in NSum [duplicate]

Below is a simple example to illustrate the problem test = Compile[{{n, _Integer}}, n] Now, Table works fine ...
3
votes
3answers
71 views

EvenQ not working properly on IntegerPart[real number]

Something fascinating is happening at the moment. ...
1
vote
1answer
89 views

singularity in boundary value problem

I am trying to solve a non linear differential equation with variable parameter. ...
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 ...
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 $...
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,\...
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}}$. ...
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. ...
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. ...
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 ...
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
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
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 ...
1
vote
1answer
74 views

Estimating error in NDSolve

I would like to give a theoretical estimation of local truncation error (and then for the global one) for a solution to a numerical initial value problem by NDSolve....
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 ...
0
votes
1answer
110 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
-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
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
2answers
170 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
40 views

Mathematica Stops Working

When I run the following code (taken from a Mathematica Blog) which is solving the NS equations; ...
1
vote
1answer
105 views

Wrong root when using numerical values

I have the following inequality: $$ \sqrt{\frac{a}{2x}}+ \frac{b}{1-\frac{a}{a+\sqrt{a(2bx + a)}}} + \frac{a}{2x\frac{a}{a+\sqrt{a(2bx + a)}}\left(1-\frac{a}{a+\sqrt{a(2bx + a)}}\right)} < f $$ on ...
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\...
0
votes
2answers
60 views

How to plot the solution of a function while varying a parameter [closed]

I have a function of a single variable that I want to solve numerically for different values of a parameter and then plot the results. I have a general equilibrium model that I can get to a reduced ...
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 - ...
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. ...
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: ...
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, ...
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 ...
0
votes
1answer
259 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) }{\...
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 ...
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 ...
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 ...
4
votes
3answers
195 views

How to read the intersect corodinate of two lines from the ListLinePlot?

Suppose I have two curves intersect at some point, how can I read the coordinates from the graph, not read by eye, but find it with more precision by computer. For example, here are two lists created ...
2
votes
3answers
166 views

Use NMinimize instead of FindFit for constrained search (of coefficients)

(My problem is more complex, but let us formulate it through this example) I am trying to find the best polynomial approximation to the following function ...
3
votes
1answer
122 views

Solving an equation containing an integral in the unknowns

I have an equation of $x$ and $y$, which reads $$ -\alpha^2+\frac{2}{3} \alpha^3+y^2-\frac{2}{3}y^3+x^3f(\frac{y}{x})=0, $$ where $\alpha$ is positive parameter and $f(x)=\int (1-\tanh x) x^2\mathrm{...
1
vote
2answers
65 views

Calculating the numerical value of the regularized generalized hypergeometric function

I'm trying to calculate the numerical value of the regularized generalized hypergeometric functions: $\qquad \sf{HypergeometricPFQRegularized}^{(\{1\},\{0,0\},0)}(\{-1.5\},\{-1.,-0.5\},3600.)$ I ...