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

learn more… | top users | synonyms (1)

0
votes
2answers
37 views

NSolve and domain specifications

I am using NSolve to find roots to a system of polynomials that describe some chemical reactions. However, I am seeing some odd behavior when I restrict the domain. First, the basic setup: ...
0
votes
2answers
47 views

Finding and plotting a parametric solution to a complicated equation (transcendental, log-polynomial)

I am trying (desperately) to find a way to solve a transcendental equation whose solution $x$ depends on non-numerical parameters $a$ and $b$. And then to produce a ...
24
votes
2answers
427 views

How to implement custom integration rules for use by NIntegrate?

How can NIntegrate be extended with custom implementation of integration rules? This answer of the question "Monte Carlo integration with random numbers generated ...
2
votes
2answers
92 views

Union sorting after ignoring some digits

I have a list with its bellow elements: {-0.7071067811865476, -0.7071067811865475, 0.7071067811865475, 0.7071067811865476} If I use ...
18
votes
6answers
2k views

Annoying display truncation of numerical results

I have a lot of data to inspect. An example of a number in my program is 123.189094 This gets displayed as 123.189 ...
1
vote
3answers
91 views

FindMinimum step size too small

I'm running a simulation of an electromagnetic system using Radia, an external code that is run from Mathematica. I want to use FindMinimum to determine some ...
8
votes
1answer
510 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 ...
17
votes
1answer
162 views

How to implement custom NIntegrate integration strategies?

How can new integration strategies algorithms be used with NIntegrate? This is a different type of extension than the extensions with new integration rules, as ...
3
votes
1answer
126 views

Machine-Precision and Arbitrary Precision [closed]

What is meant by a machine number in the Mathematica documentation? What is the difference between machine-precision and fixed-point precision? What is arbitrary precision?
1
vote
1answer
53 views

Evaluation of Element?

What is the Mathematica reasoning behind the result of the first two elements on the second row of the following table? ...
5
votes
1answer
197 views

Is there an alternate way to calculate beyond the memory limit of the home edition?

I bought the Home Edition of Mathematica online 0.5 G of memory and costs \$150 per year. When I calculated the median of outputs from $[0,1]$ with an interval of $.000001$ I ended up with the ...
3
votes
2answers
132 views

Multiplication non-deterministic?

I have two vectors of 134 elements each ($mu$, and $gt$). $mu$ contains Integers, and $gt$ contains machine precision Reals. I execute the following simple expression multiple times without changing ...
1
vote
0answers
55 views

Numerically parameterize portion of $F[x,y]==0$

I have a relatively complicated function of two variables F[x,y] whose zero locus contains a number of intersecting paths in the $x,y$-plane. A problem I've been ...
1
vote
0answers
268 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: ...
4
votes
2answers
896 views

Numerical solution of Bessel-like equation using NDSolve

I need to calculate solution of Bessel-like equation having general form: $\frac{d^2F}{dr^2}+\frac{1}{r}\frac{dF}{dr}+Q(r)F(r)=0$. Problems come from the points near $r=0$ leading to numeric errors. ...
0
votes
0answers
30 views

Copy-pasting a floating point number [duplicate]

Here is a behavior of the Mathematica front end which confuses me. Type N[Sqrt[2]] The displayed output is 1.41421 ...
16
votes
0answers
176 views

Is manual adjustment of AccuracyGoal and PrecisionGoal useless?

This is a problem confusing me for years. AccuracyGoal and PrecisionGoal are two options that I never truly understand and, to ...
3
votes
1answer
101 views

Understanding difference between `NIntegrate` result and home-cooked Simpson's rule

In this question I am asking about the different results I get between NIntegrate-ing a function of two variables vs. "doing it myself" with my own implementation ...
0
votes
0answers
57 views

Numerical fitting trajectory to model that has NDSolve

I have a model which describes the motion of an object on a plane. ...
0
votes
2answers
156 views
3
votes
1answer
115 views
14
votes
4answers
295 views

Does Mathematica have an equivalent of C's nextafter?

In C (and many other programming languages), there is a function double nextafter(double x, double y) which takes two (IEEE 754) floating-point numbers and ...
1
vote
2answers
80 views

Determining the value at which a function becomes non-real or undefined

If I have a function $f(x)$ that I only know numerically and that returns a real value for some range of values $-\infty < x \leq a$ and complex values for $a < x < \infty$, how can I ...
2
votes
1answer
78 views

Using loops to draw multiple polygons and discretizing them

I am trying to plot the first eigenvalue of the Laplacian operator with zero Dirichlet condition on following figure against decreasing values of $\varepsilon$. I used ...
3
votes
1answer
58 views

MachinePrecision versus $MachinePrecision in NDSolve

I'd like to understand why one of these inputs gives me an error and the other doesn't: ...
0
votes
1answer
33 views

SetPrecision on a decimal gives imprecise result [duplicate]

I noticed that SetPrecision doesn't actually guarantee that my number is as precise as I want: ...
0
votes
0answers
31 views

Use “FindFit” for Multi-variable Polynomial Fit

I'm interested in defining three input vectors: $L=\{L_{1}, \ldots, L_{N} \}$ $W=\{W_{1}, \ldots, W_{N} \}$ $Q=\{Q_{1}, \ldots, Q_{N} \}$ and I'm hoping to be able to input a number for each of ...
17
votes
2answers
485 views

How to create internally optimized expression for computing with high WorkingPrecision?

I have large dataset and need to fit rather complicated function on it with different values of one of its parameters (this parameter must be fixed in every fit). I use the ...
3
votes
1answer
74 views

Implementing the Cimmino method [closed]

What am I doing wrong? I am trying to implement the Cimmino method, an iterative method for the solution of linear algebraic systems. The final output should be a vector. Here is a description of the ...
15
votes
0answers
160 views

FindMinimum doesn't increase step size when necessary

I've spent much time finding a minimal example demonstrating this problem with FindMinimum. Normally one faces this problem when fitting very large and complicated ...
0
votes
0answers
48 views

Why does NSolve not solve this system of equations on a bounded domain? [duplicate]

I have three functions $E1,E2,E3$ of $t1$ and $t2$. The expressions are slightly complicated and involve trigonometric functions. For clarity purpose, they are given at the end of the question. I wan'...
2
votes
1answer
91 views

Round off in Mathematica Built-in functions [duplicate]

Is there a way to force Mathematica to use its Built-in functions instead basic functions? For instance, the Hypergeometric1F1[a,b,x] function has a exponential form when its firsts parameters are ...
0
votes
1answer
44 views

Evaluating Root forms in a Table [closed]

When I put a Root form in table, the parameters of the Root form don't evaluate. I don't know how I can indexed values substituted into root form in the table to get have numeric output. ...
3
votes
2answers
514 views

A problem about function N

Toady,I have a problem about N,described as below: For example N[1/3, 5] (* ==> 0.33333*) and ...
0
votes
1answer
57 views

Solution of Coupled second-order ODEs and plot the diagram

We have two second-order Coupled differential equations as the followings: $$\left\{\begin{array}{lr} \displaystyle \frac{{{d^2}{y_1}}}{{d{x^2}}} = \{ \frac{{\sqrt {\frac{{1 - {\varepsilon ^2}}}{{{{(...
10
votes
1answer
247 views

Vastly incorrect answers obtained by increasing WorkingPrecision with modified Bessel functions

Bug introduced in 7.0 or earlier and persisting through 10.4.1 This is a follow-up to this question regarding numerical instabilities occurring with modified Bessel functions. In trying to explore J....
0
votes
2answers
72 views

Wrong numerical results from LegendreP

{Cos[Pi/180] // N, LegendreP[46, 0.9998476951563913`], LegendreP[46, Cos[Pi/180]] // N} give ...
9
votes
3answers
1k views

Why does N[1.000 01, 10] return 1.00001, but N[1.000 001, 10] returns only 1.?

Why is it so? When I ask for N[1.00001, 10] I get quite reasonably 1.00001 But when I ask for ...
33
votes
8answers
7k views

About multi-root search in Mathematica for transcendental equations

I have some questions for multiroot search for transcendental equations. Is there any clever solution to find all the roots for a transcendental equation in a specific range? Perhaps ...
2
votes
1answer
78 views

Why does NDSolve and NIntegrate not give the same result? [closed]

I have plotted solution of two equivalent equations one in Integral form (right chart) the other in Differential form (left chart) using NDSolve and NIntegrate but they give me completely different ...
10
votes
2answers
745 views

Why is Mathematica destroying this graph?

Here I have a picture of a function I graphed: reg[x_,y_]:=(x^2+y^2)Cos[4ArcTan[y/x]]; Plot3D[reg[x,y],{x,-2,2},{y,-2,2},AxesLabel->Automatic] And here is ...
1
vote
1answer
56 views

How can use Table for two functions obtained from NDSolve? [closed]

I have obtained a numerical solution using NDSolve for two functions a(x) and b(x). how do I use Table to make a list of a(x) vs b(x) values. is it simply Table[{a(x),b(x)},{x,0,100}] or should I use ...
9
votes
4answers
463 views

Numerical instability in cosh and sinh - integral functions [duplicate]

I'm trying to calculate the function: CoshIntegral[x] Sinh[x] - Cosh[x] SinhIntegral[x] Unfortunately Mathematica seems to hit a point (x~20) and things become ...
5
votes
2answers
262 views

Strange phenomenon occurring in analytic integration result involving Bessel functions

For the following integral, Integrate[x^2 Exp[-a x^2 - b x^4], {x, -∞, ∞}, Assumptions -> {a > 0, b > 0}] Mathematica gives the following analytic ...
7
votes
2answers
175 views

Multiply integrand with -1, and the precision changes?

"After multiplying the integrand of NIntegrate with -1, the Precision of the output will ...
0
votes
1answer
531 views

Problem with FindRoot applied to functions

I am having difficulty with the error "is not a list of numbers with dimensions..." when using FindRoot (and other numerical routines in Mathematica) to solve equations numerically when the argument ...
0
votes
1answer
47 views

Find numerical solution to this system of DE

I am trying to solve this system $$\left( \begin{array}{ccccc} 2 k & -k & 0 & 0 & 0 \\ -k & 2 k & -k & 0 & 0 \\ 0 & -k & 2 k & -k & 0 \\ 0 & 0 &...
1
vote
0answers
47 views

High Precision Plots of Eisenstein Series [closed]

When plotting the Eisenstein Series (great information here Eisenstein Series in Mathematica?) you observe highly non-trivial branch cut behavior close to the real axis. This makes the numerics break ...
10
votes
3answers
4k views

how to solve ODE with boundary at infinity

y''[x]-x y[x]==0 y[0]==AiryAi[0], y[infinity]==0 the analytic solution to this ODE is the Airy function y[x]=AiryAi[x] if I ...