Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
41 views

Numerical Integration over experimental numbers

I have a large array {x,y,z} sigma = {{x1,y1,z1},{x2,y2,z2}, ......} where z is a function of x,y: z = f(x,y); the function is known only through its numerical ...
4
votes
0answers
27 views

Problem with Binomial numerical computation

Using Mathematica 10.4.1.0 I have a problem with Binomial on numerical computations. For example Binomial[2, 1/5] // N correctly returns ...
0
votes
0answers
35 views

Inconsistent and oscillatory behavior with formula

I have the following code ...
1
vote
1answer
40 views

NumericQ slows down the computation in ContourPlot

I am trying to plot the roots of a function f(x,y) using ContourPlot as follows ...
2
votes
1answer
99 views

Translating pseudocode for the Jacobi algorithm into Mathematica

Here is an image for the Jacobi algorithm. I have almost no knowledge of Mathematica, the textbook does not help. Does not provide examples. The class average is 64%. I just want to be able to ...
3
votes
1answer
84 views

LeastSquares vs ArgMin

From the documentation, we learn that: LeastSquares[m,b], when b is a vector, is equivalent to ...
2
votes
1answer
85 views

How to run NDSolve over a large range without freezing?

I am trying to solve a set of coupled differential eqns. I need the solution over a large range of the variable t. But the notebook freezes and stops working. ...
3
votes
0answers
58 views

Why this change gives different results in Integrate?

I'm new in Mathematica and can't understand why changing a number from Real to Integer is giving different results in my equations: ...
-1
votes
0answers
29 views

Understanding the absolute error in numerical calculations [closed]

I was reading the documentation of AccuracyGoal it says that AccuracyGoal effectively specifies the absolute error allowed in a numerical procedure. If I search for the meaning of "Absolute ...
1
vote
1answer
69 views

Machine-precision numbers cause loss of precision

I am trying to use the Mod function as follows. Table[ Nest[Mod[2 #, 1] &, FractionalPart[Pi], n], {n, 100}] // N ...
7
votes
1answer
108 views

Multi-variable Fixed Point Iteration Command?

We want to find the zeros of a multi-dimensional function f[x_, y_] = {x + 1/4 (-Cos[x] + Sin[y]), x - y - Sin[y]/4} To find the zeros, we can initialize and ...
1
vote
1answer
54 views

ParametricNDSolve “delayed time” error message

Issue reported to Wolfram, Inc as a possible bug in Version 12.1; CASE:4554034. When trying to solve a system of delay-differential equations with ParametricNDSolve...
1
vote
2answers
106 views

Does SetPrecision[x, Infinity] expose the internal exact number in the approximated number?

What I already know (maybe) : My theory about Mathematica's way of implementing approximated number An number approX with arbitrary precision ...
6
votes
0answers
61 views

What makes ListPlot better than N?

I wanted to numerically verify the validity of the formula for the first Stieltjes constant $$\gamma_1=-\frac12\sum_{n=0}^\infty\frac1{n+1}\sum_{k=0}^n\binom{n}{k}(-1)^k\log^2(k+1)$$ ...
1
vote
1answer
31 views

Can I configure a guaranteed precision for NIntegrate on a monotone function?

I know there are some great posts already about why PrecisionGoal->n doesn't guarantee the result of NIntegrate will actually ...
2
votes
1answer
52 views

Calculating the bounce solution numerically

I would like to obtain a numerical solution to the following example bounce equations, $$\begin{align*} \frac{\partial^2 a}{\partial t^2} &= \frac{1}{t^2} a(1-a)(1-3a)-\frac{b^2}{2}(1-a)\\ \frac{\...
1
vote
1answer
38 views

Division by a series with no coefficients

I know it is strange, but it seems MA is unable to compute a simple series expansion ...
3
votes
3answers
315 views

How can I compute Erf of large numbers to more precision?

I would like to compute Erf[80/3] to enough precision to know the order of magnitude of 1 - Erf[80/3] How can I do that? I ...
2
votes
0answers
29 views

Find at least one distribution with given parameters [closed]

There is a continuous probability distribution that I have only limited information about. I know that its PDF is a smooth unimodal function with exactly $2$ inflection points; I also know numeric ...
4
votes
1answer
88 views

Solve free boundary problem for heat equation

How can I use Mathematica to compute/approximate and plot the solution of the following problem? $\min\{u_t - u_{xx} -1, u \} = 0 \text{ in } (0,T)\times (-1,1)$ $u(0,\cdot) = 0 \text{ in } (-1,1)$...
0
votes
2answers
85 views

How to prevent this overflow error?

I compiled the following Mathematica code ...
2
votes
2answers
98 views

Can I impose some a priori constraints on a distribution found by SmoothKernelDistribution?

I use SmoothKernelDistribution (with no options and a single argument — a list of values) to get an approximate reconstruction of a continuous distribution based on ...
1
vote
1answer
50 views

NArgMax plotting partially wrong solution

In the following MWE, NArgMax finds the correct argmax (br1) as a function of the parameter ...
10
votes
5answers
579 views

Why does NMaximize miss this global maximum?

I am having trouble maximizing a function which appears as a curvature of a planar curve. ...
0
votes
0answers
59 views

Numerical evaluation expression not returning result in requested precision

I have a long list of descriptive statistical quantities for a univariate list of data. The problem is that the set number of significant figures is ignored by the ...
0
votes
1answer
77 views

Global optimisation - Error bound on NMaximize?

Is it possible to obtain an error bound on NMaximize? e.g. convert the number returned by NMaximize into a rigorous upper bound ...
2
votes
2answers
62 views

RegionBounds wrong with small change

For the following: RegionBounds[ImplicitRegion[0 <= y <= Sqrt[1 - x^2], {x, y}]] I get the correct value of ...
1
vote
1answer
31 views

How to get the output for the following code involving differentiation and integration?

I need to evaluate the following Mathematica code to get a numerical value as my output. But during compilation I get the error message NumericalMath`FixedPrecisionEvaluate::precbd: Requested ...
1
vote
1answer
47 views

How to stop the result?

My program allows me to solve the equation Ht. The aim is to show the probability for each value of d value in my dlist table (dmin and dmax). But, for certain values ​​of d, I have a first negative ...
0
votes
2answers
83 views

Why code is running and not giving any output for NSolve?

I am trying to solve the given equation in the code and want to plot 'N1' with 'P1'. But the code is not giving me any output and still showing running. What is the problem with it? If anyone can ...
2
votes
1answer
85 views

A probable misdescription of official Doc about $MachinePrecision?

According to the official documentation: When you enter an approximate real number, the Wolfram Language has to decide whether to treat it as a machine number or an arbitrary‐precision number. Unless ...
-1
votes
1answer
81 views

About the Rationalize of an approximated number

In[3]:= Clear["*"]; approPi = N[Pi]; {Rationalize[approPi], Round[approPi, 10^-15]} Out[2]= {3.14159, 3141592653589793/1000000000000000} Above ...
0
votes
0answers
72 views

Runge-Kutta method freezes or takes too much time

I want to solve differential equations iteratively to know better how algorithms work. From this discussion Problems with Runge-Kutta methods for different functions I know that the working Runge-...
3
votes
0answers
68 views

Right or wrong answer obtained when using two ways to represent the same number [closed]

Using Mathematica 10.1 Depending on whether I write a numerical constant as 0.6 * 10^-15, or 6 * 10^-16, I get very different ...
1
vote
1answer
51 views

Removing fluctuations in plot, possibly due to numerical precision

Through the following code, we generate Tp1: ...
4
votes
1answer
65 views

Problems with Runge-Kutta methods for different functions

Here is a great code of Runge-Kutta method proposed by @Alex Trounev in question Solving ODE with Runge-Kutta method : ...
1
vote
1answer
81 views

Solving ODE with Runge-Kutta method [duplicate]

I am trying to solve y''+4y'+3y=0; y[0]=1, y'[0]=-1 with Runge-Kutta method and I have a problem that its DSolve gives the ...
0
votes
1answer
89 views

Too long computation

I am trying to solve this iterative task: Here the upper index refers to time, lower refers to coordinate. It is an approximation of this PDE problem: So I have for example ...
3
votes
3answers
128 views

Why does the Mathematica give different numerical results?

Why do the two inputs give different values? in:=(-y)^a /. a -> 2.99 /. y -> -2 out:=7.94474 and ...
0
votes
0answers
65 views

Precision[] and Accuracy[] give non-integer result

a = N[Pi, {20, 19}]; Precision[a] (*19.497149872694134`*) Accuracy[a](*19.`*) Accuracy[a]*Log2[10] (*63.116633802859894`*) My question The ...
0
votes
1answer
113 views

Laplace equation with mixed partial

I would like to solve numerically a modified Laplace PDE (with source terms) and which have a second-order mixed partial derivative, and is limited to the following region and periodic boundary ...
0
votes
0answers
61 views

Understanding Working Precision - two example equations

I am trying to understand how WorkingPrecision works, and in general how very small/large numbers are to be handled. Let me preface I probably do not have ...
1
vote
3answers
62 views

Loosen tolerances to get a solution from NSolve for trig system

This is more an exercise in learning Mathematica than a real issue because the solution for me is just to solve half of the system. I have a simple system of trig equations and can't solve the angle, ...
0
votes
0answers
20 views

Conflicting output provided by `N[…]`

I am trying to evaluate an expression : (-((I (k2 - k1) (-1 + E^(2 I (k2 - k1) \[Pi])))/(-1 + (k2 - k1)^2))) /. {k1 -> 2, k2 -> 7} This gives ...
2
votes
1answer
70 views

Numerically Solving a system of PDE (2 unknown functions)

I need to solve for function H[x,y] and V[x,y] on square {x,0,1},{y,0,1}, obeying the ...
0
votes
1answer
84 views

Best laptop specs for a better and faster numerical simulations [closed]

Hope all is well! I am planning to buy a laptop (Windows) and looking for your help to decide the specs that we need to speed up the numerical simulations using Mathematica. The Mathemtica code I used ...
0
votes
1answer
133 views

FindRoot::lstol error

I'm getting the message: FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the ...
0
votes
2answers
68 views

Positiveness of two variable inequality

How to show that the function g[a_, n_] = -4 a^2 + 8 a^3 - 4 a^4 + 16 a n - 24 a^2 n + 8 a^3 n - 12 n^2 - 4 a n^2 + 12 a^2 n^2 + 12 n^3 - 8 a n^3 of ...
2
votes
0answers
38 views

Why gives Modulo of complex numbers different answers for rationals and reals

When running Table[1.*Mod[(1 + I)^(1 + k*I), 1 + k*I], {k, 49, 50, 0.5}] Table[1.*Mod[(1 + I)^(1 + k*I), 1 + k*I], {k, 49, 50, 1/2}] I get for the first table <...

1
2 3 4 5
32