Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
63 views

Plotting with NMaximize

I have the following: ...
2
votes
2answers
61 views

surprised Rationalize will sometimes leave a Real unchanged [closed]

I was surprised that Rationalize will sometimes leave a Real unchanged even if the fractional part of the Real is well above zero. ...
1
vote
1answer
85 views

Solving non-linear BVP with NDSolve and shooting method

I'm trying to solve a set of non linear DAE with global constraint $$k(x) \left(\frac{1}{40} \omega ^4 n(x)^2+\frac{2}{3}\right)-L \lambda (x)-\frac{2}{3}=0,\ \ n(x) \left(\frac{1}{40} \omega ^4 k(x)^...
2
votes
0answers
38 views

JordanDecomposition not evaluating

When there are very small differences between entries in a diagonal matrix, sometimes JordanDecomposition does not evaluate and gives an error message: ...
0
votes
3answers
275 views

Python recursive bisection algorithm to Mathematica

I've been sitting on this problem for a while and i am kind of stuck. I am pretty new to Mathematica and have been trying to implement a recusive Algorithm, which splits/bisects a list of items in ...
0
votes
1answer
34 views

Indeterminant numerical value of summation

I have the following two-fold summation. ...
7
votes
1answer
178 views

Around workaround

I'm testing Around for error propagation (v12.2), but it seems to be inconsistent. Error results depend on the form. Am I missing something here? Edit Same results ...
2
votes
1answer
56 views

Custom Normalization for NDEigensystem

I am trying to solve the Laplace equation in polar coordinates $$-\left(\frac{\partial^2\psi_n(r,\theta)}{\partial r^2}+\frac{1}{r}\frac{\partial\psi_n(r,\theta)}{\partial r}+\frac{1}{r^2}\frac{\...
1
vote
1answer
101 views

FindRoot with a big range

I have a variable sig that is related to the variables (b,zQ,zh) given by torootsig, so I ...
2
votes
1answer
125 views

How to think about the answer to Rationalize[-11.5, 1]

In the open source Mathematica implementation called Mathics, an issue was raised where Mathics computes Rationalize[-11.5, 1] as -12 rather than Mathematica which ...
0
votes
0answers
50 views

Numerical Investigation of two Component Reaction-Diffusion System with Perturbative Advection

I am given two coupled differential equations and try to analyze them numerically because as far as I know, there is no analytical solution known(only the steady-state on an infinite domain is known, ...
0
votes
2answers
82 views

Nested NIntegrate over a region: Numerical Integration not converging

I need to computed two double nested numerical integrals, of which one is defined over a specific region (e.g. a pentagon). I've tried to use a single NIntegrate with four variables, but the result is ...
0
votes
1answer
60 views

Composite function derivatives

I would like to calculate the numerical partial derivatives (numerical gradient) of this function: ...
3
votes
1answer
73 views

MeijerG function: numerical evaluation of its derivative

Mathematica does not evaluate the derivative of the following MeijerG function. ...
1
vote
1answer
133 views

NonStandard finite difference for BMBB equation

I am trying to implement the following scheme mentioned in the paper "NUMERICAL SOLUTIONS OF BENJAMIN-BONA-MAHONY-BURGERS EQUATION VIA NONSTANDARD FINITE DIFFERENCE SCHEME " What is ...
2
votes
3answers
288 views

How to ask Mathematica to subtract each adjacent pair in a list, and then, sum them?

If I have a list of numbers as (the number of elements in this list is even) list={1,23,32,54,65,76,87,98,109,110,...} How can I ask Mathematica to subtract each ...
1
vote
0answers
51 views

logit ScalingFunctions

Having learned how to make symlog axes in this question, I was interested in the logit scale, the transforms of which are ...
0
votes
0answers
40 views

Indexing of NDEigensystem Result on a Cluster

I am trying to run on a cluster (where the version 11 of Mathematica is available) a code involving the following calculation: ...
1
vote
0answers
47 views

NDSolveValue BVP that encounters infinity

Problem setup: I'm trying to solve the following, quite hairy, first order BVP problem, with four unknown functions $\phi, \theta, p_\phi, p_\theta$, and boundary conditions at $\phi(0), \phi(1), \...
4
votes
2answers
259 views

How does mathematica numerically evaluate the Meijer G-function?

The Meijer G-function is defined as a contour integral in the complex plane. Mathematica is able to numerically evaluate such a function quickly and accurately. How does she do that?
2
votes
0answers
34 views

Supply gradient to FindMinimum subject to constraints

FindMinimum supports explicitly supplying the gradient (as well as the Hessian) via the Gradient (resp. Hessian) option. However,...
2
votes
0answers
64 views

NSum complaining of being non-numerical

I am trying to evaluate the sum $\sum_{k,l=1}^{30}\frac{1}{(k^2+l^2+1)^{5/4}}$ so I write NSum[1/(1 + k^2 + l^2)^(5/4), {k, 1, 30}, {l, 1, 30}] but I get a message ...
1
vote
0answers
46 views

Mathematica crashes with NIntegrate

I am trying to evaluate the following numerical integration ...
2
votes
1answer
51 views

Passing a Piecewise function of NIntegrate through NIntegrate?

I am trying to pass a piecewise numerical integral (function1) through another numerical integral (function2). When I try this, however, I receive an error that says "t = T is not a valid limit ...
1
vote
1answer
49 views

Passing ParametricNDSolve through NIntegrate?

I am trying to integrate (function2) an integrand (function1) that is a function of a ParametricNDSolve output (solution1). This somehow works if I use ...
0
votes
0answers
76 views

Numerically integrating interpolating function whose initial conditions vary?

I am trying to numerically integrate--with respect to t0--an integrand (entitled function1 below) that involves an NDSolve interpolating function whose initial conditions are a function of t0. When I ...
2
votes
0answers
102 views

Approximate integer factorization

Suppose we would like to compute an approximate prime factorization of a large integer x in the sense that the difference between ...
5
votes
1answer
121 views

Accurately computing $\sum_{j=2}^\infty \frac{(-x)^j}{j!} \zeta(j)$

I'm doing a sanity check of the following equation: $$\sum_{j=2}^\infty \frac{(-x)^j}{j!}\zeta(j) \approx x(\log x + 2 \gamma -1)$$ Naive comparison of the two shows a bad match but I suspect one of ...
1
vote
0answers
54 views

Alternatives to NumericQ that allow symbols to be considered numeric

I am writing a program in which I am using NumericQ. I am trying to allow symbols to also be considered Numeric, so I have been using NumericQ[a]=True for all of ...
2
votes
1answer
44 views

N::meprec warning when setting precision

How come N[ Log[ Cos[1]^2 + Sin[1]^2 ] ] evaluates to 0. without any trouble, while ...
5
votes
1answer
191 views

Airy function zeros, conflict (error?) between Wolfram Functions vs. Mathematica

According to functions.wolfram.com, the zeros of the Airy function $\operatorname{Ai}(z)$ occur at $z_k=f\left(\tfrac{3\pi}{8}(4k-1)\right)$ for $k\in \mathbb{N}$ where $f(d)=-d^{2/3} \left(1 + \frac{...
0
votes
0answers
45 views

Instability in NIntegrate

I am solving the following equation with NIntegrate. However, the solution branches off at a certain time instance. When I increase the time step size, the instability occurs at larger time instant. ...
0
votes
1answer
62 views

Numerically solve 2nd order differential equations:

I'm trying to solve these two coupled 2nd order differential equations, but I'm getting nowhere. Mathematica can't seem to solve these no matter what I do. The equations are: The $r_{*}$ is the value ...
1
vote
0answers
47 views

Solving a non-linear Schrödinger equation

I am trying to use NDSolve to solve numerically the well-known Schrödinger-Newton equation for a certain initial value of the wave function. ...
2
votes
2answers
216 views

'gradient' function in MMA

How to calculate Numerical gradient of 2D arrays using the "gradient function" ("Matlab-like")? "[___] = gradient(F,hx,hy,...,hN) specifies N spacing parameters for the ...
5
votes
4answers
159 views

Are there any alternatives for NIntegrate to calculate the area for which $f(x,y)<0$?

I have this two-variable function $$f(x,y)= (8 \cos (x+y)+7)\cos \left(\frac{x}{2}\right)+\cos \frac{x-2 y}{2}+2 \cos \left(\frac{3 x}{2}\right) $$ where $0<x,y<\pi$. I want to calculate ...
2
votes
1answer
79 views

how to solve matrix differential equation using Mathematica

I have to solve $[m]x''+[c]x'+[k]x=[p]$ where x is function of $t$ after defining $[m],[c],[k]$ and $[p]$ in mathematica and x[t_]={x1[t],x2[t],x3[t]} I am using ...
0
votes
0answers
44 views

Problems with NSolve[] finding zeros of a 32-degree polynomial

I have the following calculation in Mathematica: ...
0
votes
0answers
94 views

FindRoot::dfmin: The minimal damping factor of 1/10000 has been reached

I have to solve a highly nonlinear parametric system of three PDEs. I don't know to which extent the results are trustable. Indeed, the graph shown by ParametricNDSolve also presents the error message ...
0
votes
1answer
36 views

How to make first component of eigenvectors on grid real and normalize using Map and Normalize? [closed]

I am trying to use the following approach: How get eigenvectors without phase jump? to apply the same conditions to an array of complex-valued Mathematica eigenvectors. The matrix solved for is a <...
1
vote
1answer
100 views

Repeating and Sequencing Procedures with two Do-loops

I have a Do loop where I'm looking for the value of certain parameters that respect the conditions inside an If, and with those values, a run another Do to make another calculation of an expression ...
0
votes
1answer
150 views

How do you calculate the area of a surface with edges in mathematica

Like the title indicates, how could I achieve this. Normally what I did for a closed surface is as follows: ...
5
votes
1answer
103 views

What are the best ways to compare numerical and exact solutions in 3D plots?

What are the best ways to comparing numerical and exact solutions in 3D plots? For example, suppose that I have have numerical and exact solutions as follows: ...
1
vote
0answers
56 views

Non linear PDE solution

Could someone advise if it is possible to solve the following PDE with Mathematica? I am quite a beginner in Mathematica so any input would be highly appreciated. $\displaystyle\frac{1}{2} \sigma^2\...
5
votes
1answer
132 views

How to plot solutions of a system of equations by changing colours when one of the variables increases by step?

I have a system of two 3-variable equations $SysEqs=\{f(x,y,z)=0\;,\;g(x,y,z)=0\}$ where the domain of variables are $$6 < x < 2 \pi \\ - \frac{15}{100} < y < 0\\ 0 < z < \frac 32$$ ...
4
votes
1answer
188 views

Gradient of the numerical solution of a PDE

Solving the following PDE, defined in the same domain of a previous question: ...
0
votes
1answer
34 views

Numerical derivative (ND) not working for orthonormalized eigenvectors of a matrix

I have problem making ND work. Define relevant needs and vectors ...
0
votes
1answer
128 views

_?NumericQ inside NDSolve to speed up code

I've seen some people using _?NumericQ to prevent symbolic calculation and speed up NDSolve. Why in this simple code is not ...
4
votes
0answers
158 views

Numerical backward induction -- Solving sequential Cournot

I'd like to numerically solve a sequential Cournot competition in which supplier 1 moves before supplier 2, then the manufacturer sources from them, and finally sells the item at market clearing price....
1
vote
1answer
106 views

WhenEvent how to handle events at the same time and detection order

I need to use WhenEvent inside NDSolve in which events happen simultaneously. I show simple code to better explain my question: ...

1
2 3 4 5
37