Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
30 views

The numerics of FresnelS[]

Bug introduced in 12.1 or earlier and persisting through 12.1.1 or later [CASE:4615361] Note: A worse problem existed in 12.0 for inputs greater than 8 and of ...
0
votes
1answer
128 views

Are there some programs about inverse Fourier and Laplace transfroms?

To be more exact, I have a function F[w_,s_], where $w$ is the Fourier transform of $x$ and $s$ is the Laplace transform of $t$. Now I want to perform the double inverse transforms $s\to t$ and $w\to ...
3
votes
2answers
81 views

Solve system of equations with integration over regions

I want to solve the following problem in Mathematica: Assume that $\lambda_2=-\frac{1}{2}+ r+\frac{1}{1+r}- r^2\log\frac{1+r}{r}$, $v\in[0,1]$ and $\theta\in[0,1]$. For pre-specified values of $k,r>...
3
votes
0answers
113 views
+50

Discrepancy between the results of NIntegrate with different methods and options

I am trying to perform a numerical integration on a function defined through a sum of exponential terms. The summation is given by: ...
4
votes
1answer
160 views

Does not evaluate the Integral and a plane plot

I am trying to compute a ContourPlot and a VectorPlot using the following functions: ...
6
votes
2answers
235 views

Plot of The RiemannSiegelZ Function

I would appreciate your help to visualize the of the following function RiemannSiegelZ[x] with this range. { 18154980120849865 , 18154980120849885 } I tried this: ...
6
votes
4answers
596 views

Differentiate a numerically defined function

My function is f[a_, b_] := NIntegrate[Sqrt[(Cos[t] - a)^2 + b^2], {t, 0, Pi}] I want to calculate g[1,1] where ...
-2
votes
0answers
52 views

Using Runge Kutta to solve ODE and plotting trajectories in MATLAB [closed]

With the aid of fourth order Runge-Kutta method, solve the competing species model defined by dx/dt=x(2 - 0:4x - 0:3y); x(0) = 4 dy/dt=y(1 - 0:1y - 0:3x); y(0) = 3 where the populations x(t) and y(t) ...
6
votes
2answers
382 views

Finding the intersection(s) of a 3D parametric surface and a line

I have some 3D parametric curve par and some line line. I want to find parameters u,v and t for the intersection points of par and line. I tried to do that with NSolve in many different ways and ...
2
votes
1answer
87 views

Numerical integration of MeijerG function with variables

I applied the integration, How to solve the function which is mentioned below. here, 'theta' is the only variable. q13, q1,q2,p,qi1 are all variables will take value from the loop ranges from 0 to 2, ...
0
votes
1answer
61 views

How o use singular value decomposition function to find the natural frequency and mode shapes

I have a matrix R which is having a dependency on ω, I am interested in finding the natural frequency and mode shapes of this matrix using SVD how to do this?. The regular way is to take the ...
1
vote
2answers
47 views

Evaluate function at “good” points used by Plot in numerical problems

Plot function with option Mesh->All shows how mathematica evaluates function to make it most optimal for plotting. I'd like to evaluate some physical function in ...
2
votes
1answer
58 views

Using functions instead of lists in physics numerical problems

I'm using the following code for calculation of reflection and transmission coefficients through square well potential: ...
25
votes
6answers
4k views

Mathematica vs. MATLAB philosophy [closed]

During a typical (possibly with alcohol mixed) discussion among some academic peers in regards to numeric calculation and general modern use of computers in science and engineering settings, it become ...
3
votes
1answer
230 views

Some Strange results from MMA and Matlab

Recently I am repeating a numerical discrete Fourier transform. Since this problem is related to a real experiment. So the authors use some complex functions to fit the results. Below formula is the ...
5
votes
1answer
224 views

How to access and change the state variable values in NDsolve`Iterate?

Essentially I am trying to calculate the Lyapunov exponent the naive way; i.e., using the method described here by Vaggelis_Z. In each pass of the loop over time a new trajectory is spawned by adding ...
1
vote
0answers
37 views

NDSolve and Explicit Runge-Kutta method [duplicate]

Welcome all, I have a comment to explain how my system solver. My response was to add ...
0
votes
0answers
39 views

How to read Z == 0. - 0.00162663 W

I am solving a set of three linear equations with four variables and found out the values of X, Y and ...
0
votes
1answer
54 views

Root finding: Is there no bisection method root finder?

I am trying to find a root to an equation f[k,...]==0 numerically, where k is the variable I am solving for. Using both NSove as ...
4
votes
1answer
107 views

The NIntegrate cannot give a correct answer by Mathematica

Here I want to compute this integral using the Mathematica $$\int_0^\infty \int_{-\pi}^{\pi}s^{\frac{1}{2}+2} \exp (-s) \cos \left(\frac{f}{2}\right) \exp (-i k s) \exp \left(-\frac{\sqrt{8 s u}}{\cos ...
27
votes
3answers
659 views

What determines the value of $MaxNumber?

What determines the value of $MaxNumber? $MaxNumber 1.233433712981650*10^323228458 ...
0
votes
0answers
42 views

Pole in the solution of four coupled non-linear ODE using NDSolve

I have four coupled non-linear equations denoted as A1[ω4], A2[ω4], A3[ω4],...
2
votes
1answer
93 views

1-D prey-predator system with diffusion and time-dependent parameters in Mathematica 12

Please you find attached a Mathematica program for the existence of almost periodic solutions for a class of Lotka-Volterra prey-predators systems with diffusion and time-dependent parameters in ...
1
vote
2answers
52 views

ParametricNDSolve for a system of 4 non-linear ODEs and plotting the solutions

I have four coupled first-order non-linear differential equations, denoted as: A1[x], A2[x], ...
0
votes
0answers
32 views

Using NDSolve for 2 ODE but plotting one dependent function against another

Suppose I have two ODE functions y[x] and z[x] which are obviously dependent on x. It is ...
13
votes
2answers
778 views

Is there a faster way to calculate Abs[z]^2 numerically?

Here I'm not interested in accuracy (see 13614) but rather in raw speed. You'd think that for a complex machine-precision number z, calculating ...
2
votes
1answer
99 views

LeastSquares vs ArgMin

From the documentation, we learn that: LeastSquares[m,b], when b is a vector, is equivalent to ...
3
votes
0answers
74 views

Problems with Erf for large arguments with small imaginary part [closed]

While performing some higher precision calculation, I noticed that Mathematica 12.1 killed the kernel and cleared all prior definitions. The problem was with Erf ...
5
votes
2answers
269 views

High precision calculation of infinite product involving prime numbers

I'm recently studying some topics in analytic number theory and I have encountered results involving the infinite product $$C=\prod_{p}\left(1-\frac{1}{p(p+1)}\right)$$ where $p$ denotes calculating ...
17
votes
5answers
2k views

periodic boundary conditions and NDEigensystem

Mathematica 10 has a splendid new function, NDEigensystem, that makes it possible to solve Sturm-Liouville problems numerically in a single step. I have not however been able to find a way to get it ...
0
votes
0answers
87 views

Plotting a complex integral function [duplicate]

Can anybody help me to plot the T1 and T2, please? The problem is that the integral part becomes so huge or indeterminate at ...
16
votes
4answers
498 views

How to model diffusion through a membrane?

This is a follow-up on How to handle discontinuity in diffusion coefficient? Consider diffusion of $u(t,x)$ on the domain $x \in [0,2]$ with some simple boundary conditions such as $u(0) = 2, u(2) = ...
6
votes
2answers
453 views

Numerical solution to a nonlinear Ordinary Differential Equation

I am trying to solve the following ODE for $f(x)$: $$x f' - f = \frac{(f')^2}{\gamma^2}[1-({f}')^\gamma]^2$$ where $\gamma < 0$ and real, which makes the ODE highly nonlinear. Since I am not ...
3
votes
1answer
93 views

Problem with NDSolveValue : “The function value {$Failed} is not a list of numbers with \ dimensions…”

I was having fun modifying a code given to me as an answer to a previous problem here, courtesy of user Alex Trounev (Thank you again), when I encountered a certain error which I had never seen before....
1
vote
0answers
31 views

Speed up Multidimensional numerical integration

I have the following 9-D integral, where the domain of integration is a nine-dimensional hypercube of unit length. The problem is that Mathematica takes too long to evaluate this. Is there any ...
1
vote
1answer
58 views

NArgMax plotting partially wrong solution

In the following MWE, NArgMax finds the correct argmax (br1) as a function of the parameter ...
3
votes
2answers
187 views

Maxima turn out to be false maxima when extremising function locally

In short: I have a 2-D function that gives this plot, where the orange dots are maxima: There are 4 maxima in this plot. Now, I plot the function again in a smaller region, close to these maxima, ...
1
vote
1answer
1k views

How do I plot this 3-D, double integral?

I have the following function: I need to plot a 3-D with coordinates f (p, q), p and q. I mean, I enter values for p and q, so that the integral of f (p, q) must be a number. This number must be ...
8
votes
1answer
122 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 ...
2
votes
1answer
66 views

Finding “missing” solutions of differential equation with NDSolve

I was working with NDSolve, and suddenly this question, appeared, so I decide to try something: Define a differential equation: ...
3
votes
1answer
108 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 ...
0
votes
0answers
37 views

Inconsistent and oscillatory behavior with formula

I have the following code ...
1
vote
1answer
49 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 ...
1
vote
1answer
105 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
236 views

Break NDSolve when condition is “almost” constant

I'm trying the solve a differential equation using NDSolve, starting at x=0.001. I'd like the solver to stop when the function ...
2
votes
1answer
87 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. ...
0
votes
1answer
78 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 ...
3
votes
0answers
59 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
vote
1answer
72 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 ...

1
2 3 4 5
32