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
0answers
144 views

Derivative of an interpolation function is noisy

I have a set of numerical data of 1501 points, in the form of $\{x_i,a_i\}$ which I uploaded to here and here. I need to compute the numerical derivative of this data. In particular, I need the ...
3
votes
1answer
255 views

Newton's Method

Problem statement: I'm currently new to Mathematica and have been trying to solve this problem. I was digging around and found this code: ...
1
vote
1answer
85 views

How to get solutions for this system of inequalities?

I am new to Mathematica and I am struggling finding the solution for the following problem. I am studying this piecewise function: ...
1
vote
0answers
34 views

Inverse of Normal Distribution CDF incorrect for large value?

I have a function F which is the CDF of the standard normal distribution. The inverse of F should be infinity at 1. However, I ...
3
votes
0answers
172 views

On Ж, and the fine-structure constant

I'm trying to reproduce the results from a certain infamous paper that has been moving around the web for the last few days. The details are irrelevant. This paper claims to have a closed-form ...
3
votes
1answer
121 views

Computing numerically infinite sum of some double series

Let's consider the series: $$ F(t) = \sum\limits_{n=0}^{\infty}\sum\limits_{k=0}^{\infty} \frac{(-b)^k(-a)^n\binom{n+k}{k} t^{2n+k(2-\alpha)}}{\Gamma(2n+k(2-\alpha)+2)} $$ where $a,b$ are ...
1
vote
0answers
83 views

Is it possible to solve following question about integer programming using mathematica?

Consider a $5$-uple $(r,a,b,c,s)$ with $a,b,c\in\mathbb{Z},s\in\mathbb{Q}_+,r\in\mathbb{Z}_+$, denote $\frac{1}{2}(a^2-b^2-c^2)-\frac{s}{r}$ by $\Delta(\mathbf{v})$. Let $A$ be a positive real number....
14
votes
4answers
384 views

Terrible accuracy of DawsonF

DawsonF[30.] returns 0. The correct value is 0.016676... At least it prints a warning message, ...
0
votes
3answers
163 views

Using WhenEvent to Change the Sign of a Constant

I am attempting to change the sign of a constant when a certain condition is met during a numerical integration. Here is the code: ...
3
votes
1answer
135 views

How to compute many sums or tables efficiently

I have some questions about programming in Mathematica and I would really appreciate it if you could help me. I wish to plot the following function against the variable X, but to do this, first I ...
2
votes
1answer
66 views

Taking a derivative of an eigenvector

I'm trying to calculate the derivative of an eigenvector that I obtain by ...
1
vote
1answer
91 views

Help to extend this evaluation!

I'm performing a stochastic evaluation, where i'm interested in the assymptotic behavior of the solutions, but my computer can't stand very large times. So I thought that I could evaluate a certain ...
0
votes
1answer
61 views

Numerical solution of an ODE using NDSolve

I am to find the solution $R(\rho)$ to the following differential equation, $\frac{\partial}{\partial\rho}\left(A^2\frac{\partial}{\partial\rho}R(\rho)\right)-l(l+1)R(\rho)=0$ where $A$ is a ...
0
votes
3answers
123 views

How to solve these equations numerically?

I have some differential equations as below. I have tried to solve them numerically with NDSolve: ...
2
votes
2answers
307 views

Solving 2D+1 PDE with Pseudospectral in one direction with periodic boundary condition?

According to the documentation about the pseudospectral difference-order: It says: Following the discussion here: I found the messy behavior is always on the artificial boundary in $\omega$-...
0
votes
1answer
59 views

How can I plot the solutions to this system of non linear ODEs?

I need to solve the following system: $$\left\{ \begin{array} { l l } { (u')^2 + (v')^2 = 1 } \\ {u'v'' - u''v' = uu' + vv' } \end{array} \right.$$ and it's a task that's proven to be quite hard by ...
-1
votes
1answer
76 views

Numerical Inversion of an incomplete beta function expressed as gauss hypergeometric function using Mathematica

I am currently working with this hypergeometric function ${_2}F_1$, $\rho(r)=\frac{2b}{1-q}(1-(\frac{b}{r})^{1-q})^{\frac{1}{2}}{_2}F_1(\frac{1}{2},1-\frac{1}{q-1},\frac{3}{2},1-(\frac{b}{r})^{1-q})$ ...
2
votes
0answers
51 views

What is the acceptable error in numerical calculations? [closed]

I am doing a calculation where I try to simplify a very complicated complex function. I did this step by step and I checked that the numerical values that the function gets for certain values of the ...
4
votes
2answers
203 views

Solve gives an incorrect answer

...
2
votes
2answers
250 views

Unstable solution of 2D+1 time PDE with periodic boundary condition

Now I am trying to solve the following 2D+1 type of PDE: $\partial_t u(t,x,y)=-y\partial_{x}u+\partial_{y}\left[a y+b sin(x)u+c\partial_{y}u\right]$ with $u(0,x,y)=\frac{1}{2\pi}e^{-((x-\pi/4)^2+y^2)...
0
votes
1answer
115 views

What is wrong with this MonteCarlo? [closed]

I am making a trial for a MonteCarlo. In this code I simulate 10 protons hitting on a slab of gold: ...
1
vote
1answer
86 views

How would one go about plotting this parameterized curve using numerical resources (analitically it's too hard)?

I'm working with the system of differential equations: $$\begin{align*} \left\{ \begin{array} { l l } { (u')^2 + (v')^2 = 1 } \\ {u'v'' - u''v' = -v' + u' } \end{array} \right. \end{align*}$$ Where $...
2
votes
1answer
113 views

Non-linear numerical solution with variable parameter

I have solved the following system non-linear: ...
3
votes
1answer
73 views

Machine Epsilon is not equal to $MachineEpsilon

I try to wrap my head around machine precision calculations in Mathematica (11.2, Linux). I do not understand the following behavior: ...
1
vote
0answers
34 views

Determine if nonlinear function can be positive subject to nonlinear constraints [closed]

I am trying to determine if a certain nonlinear function can be positive when the variables have to satisfy multiple nonlinear constraints. Currently my code looks like ...
6
votes
4answers
130 views

Suppress trailing 0s in numerical values

For example, this is what I want In[1]:= N[Table[4^(i/4), {i, 1, 4}]] Out[1]= {1.41421, 2., 2.82843, 4.} But if I want a few more digits only from the irrational ...
3
votes
2answers
180 views

Increase Performance of WhenEvent in NDSolve

I'm trying to reset the value of functions $u_{i}$ when they reach a threshold $θ$. Below the threshold, they evolve according to a simple differential equation. The $r_{i}$ resets the derivative to ...
2
votes
0answers
310 views

How to Solve this Fokker-Planck Equation?

I need to solve this Fokker-Planck equation in Mathematica and my attempt to perform this integration is above: My first attempt is above: ...
0
votes
2answers
117 views

Computing a sum with high precision

I am aware that a similar question has been asked, for example, here and here, but none of the proposed solutions solves my problem, so please wait before you mark this question as a duplicate. ...
15
votes
1answer
271 views

What happened to SequenceLimit?

In older versions of Mathematica, there was a function called SequenceLimit that allowed taking the limit of a numerical sequence. It is useful for speeding up the ...
2
votes
1answer
47 views

FindMinimum finds a zero value for solving a system but does not converges. Can I interpret it as the solution for system?

I am solving a system of three non-linear equations for three unknowns. I am using FindMinimum to minimize the norm of residuals of the system. I have played a lot ...
1
vote
0answers
69 views

Solve the 'Eigenvalue' problem efficiently [closed]

Usually, an eigenvalue of a matrix A is defined as |A-b*I|=0, where I is the identity matrix and |..| is for the determinant. Now my question becomes a little different, let's say A is a function of ...
3
votes
2answers
266 views

Solve PDE involving implicit function of independent variables

I have a differential equation given by -4*D[S[u,v],u,v]==V[u,v]*S[u,v] with boundary conditions ...
1
vote
1answer
50 views

Precision error in FindMinimum

I am trying to solve a system of three non-linear equations for three unknowns (e1, e2, phi). I am using FindMinimum to solve the system (I am minimizing the norm ...
1
vote
1answer
66 views

How to make Mathematica show small and large results? [closed]

I have two equations with x=r+Log[-1+r] and v=(1-1/r)/r^3 forms. When I substitute ...
3
votes
1answer
97 views

Problem with the function N with second argument

I was asked to look at a complicated definite integral that could be integrated analytically, but numerically did not behave as expected. After a lot of simplifications I arrived at the following: <...
2
votes
1answer
81 views

How can NDSolve be used to get just the positive or just the negative energy solution to the Klein-Gordon equation?

The Crank-Nicolson technique below is obtained from: "http://reference.wolfram.com/language/tutorial/NDSolvePlugIns.html" ...
0
votes
0answers
56 views

FindMinimum Error - cvec: Constrained optimization is only supported with scalar valued variables

I want to solve a non-linear equation derived with a forward march finite difference technique (defined as "f" in the code). I am using FindMinimum, since I know an approximate initial value for each ...
1
vote
2answers
291 views

Error when using NDSolve

I am trying to solve a system of differential equations as follows: ...
0
votes
1answer
55 views

Solving transcendental equation and plotting solution

I would like to solve ...
2
votes
1answer
159 views

NIntegrate: NumericQ and derivatives

I need to integrate a function with a singularity at the origin. I need this integration to happen quite fast, and while Integrate[] simply keeps on going forever, using NIntegrate with LocalAdaptive ...
0
votes
1answer
46 views

FindRoot does not work with Piecewise including complex-valued function

Suppose we have the following Piecewise function: ...
1
vote
1answer
45 views

Numerical solution to integration of function which parameters define the integral limits

I have following equation: $\int^{\delta_c}_{\delta_c-\pi}\sqrt{h^2_c(\cos(\delta_c)^2-\cos(\delta)^2+\Omega_c(\delta_c-\delta)}\text{d}\delta=\pi$, where $\delta_c=\frac{1}{2}\arcsin\left(\frac{\...
0
votes
1answer
130 views

Solve transcendental equation and plot the roots

I am practicing solving the following transcendental equation in Mathematica: ...
5
votes
1answer
230 views

Handling “ill-conditioned” system of ODE's with NDSolve

I am currently dealing with a system of coupled ODE's which I would like to solve numerically. I have already implemented the system in Mathematica using NDSolve. ...
7
votes
2answers
645 views

Why changing to float-point value does't improve the speed?

I am testing the first tip of this article Use floating-point numbers if you can, and use them early. I've compared a pair codes and finding it's not helpful to use the float-point number during ...
2
votes
1answer
196 views

How to solve a PDE with periodic boundary conditions in one of the variables?

I need to solve a PDE where one of the variables is an angle, so I need to know how to deal with periodic boundary conditions. As a warm up, I am trying to solve the Helmholtz equation in polar ...
10
votes
1answer
601 views

Nonlinear ODE eigenvalue problem

How does one find eigenvalues $\lambda$ of the following problem? $$ \frac{\mathrm{d}^2 u}{\mathrm{d}x^2} = \lambda \left( -u + u^2 \right),$$ $$ u(0) = u(1) = 0. $$ Can this be tackled by ...