Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [numerics]

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

2
votes
4answers
133 views

How to generate repetitive graphs?

I need to create several graph for different values of a parameter $h$. The code is the following ...
0
votes
1answer
29 views

numerical integration with intermediate variables

I'm trying to perform the following integral, where the bounds of the inner integrals become the integration variable in the next integral. disregarding the stuff in the exponential in the sample ...
4
votes
1answer
176 views

Dynamic, nonlinear, damped Euler–Bernoulli beam equation

I would like to solve the 3 coupled PDEs describing a damped, nonlinear (i.e displacements in the $x$ direction along the beam need to be considered along with the $y$ displacements normally ...
0
votes
1answer
27 views

PDE's numerical integration: simplify output: get rid of $[t,r]$'s and ${}^{(0,1)}$'s

When numerically integrating PDE's systems mathematica output can be chaotic and therfore time-consuming or even impossible to understand and use. A major source of confusion are the $[t,r]$'s and ${...
0
votes
0answers
12 views

NDSolve: Method of Lines: same grids for spatial discretization: error: stiff system_zero step size

How can I modify bbgofrey's answer so as to use $n+1$ grid points for variable $y$? My code ...
1
vote
1answer
57 views

Non Trivial Conserved Quantity Fails To Be Conserved After Solving System of ODE's Via NDSolve

I'm trying to solve the following Darboux system of equations numerically. As a result I have the following implementation of NDSolve ...
1
vote
2answers
49 views

Numerics & List Manipulation:ListCorrelate: yield $\{-f1 + f2, \dots, -f2 + f4, \dots\}$ from $\{f1, f2, f3, f4, f5\}$

The command ListCorrelate[{-1, 1}, {f1, f2, f3, f4, f5}] yields {-f1 + f2, -f2 + f3, -f3 + f4, -f4 + f5} is there any simple way to get {-f1 + f2, -f1 + ...
0
votes
0answers
38 views

Applications for \[LeftFloor] and \[RightFloor] [closed]

Studying the movement of bouncing ball on the Site of Physics, can transcribe a code for my application. ...
0
votes
1answer
50 views

Can somebody say what is wrong with my while loop?

I want to impele,nt Newton-Raphson Method and I have written the following: x0=-0.3; k=0;While[k<50, x1=x0; x1=x0-f[x0]/f'[x0]; k=k+1]; f is defined properly ...
0
votes
0answers
21 views
0
votes
1answer
25 views

Why does trying to plot the solution to this system of ODEs this way lead to errors?

I would like to plot the curve $\alpha(s) = (l(s), h(s))$, where $l$ and $h$ are the solutions to the system $l'^2 + h'^2 = 1$ and $l'h''-l''h'=h'\tan(l)$. Here's what I tried: ...
3
votes
1answer
131 views

Eigenvalues of a non-Hermitian complex periodic potential

I have an eigenvalue problem: $$-\frac{d^2}{dx^2} \psi(x) +V(x)\psi(x) = E \psi(x)$$ where $V(x)$ is a complex periodic potential: $$V(x) = 4[\cos^2(x) + i 0.3 \sin(2x)]$$ It has been claimed that ...
1
vote
1answer
28 views

Find a matrix $X$ that block-diagonalizes a particular group of matrices

Essentially, I want to find a single matrix $X$ such that conjugation by $X$ sends: $$\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & 1 &...
1
vote
2answers
70 views

how can I make a grid?

I would like to make a grid for x between 0 to 1 and use following Table ...
0
votes
1answer
84 views

Why can”t I get a smooth curve?

I used "Table" to calculate and plot the following complicated function. First, we choose an initial value for $G$ and other parameters, but at later times $G$ changes with function $I_a$. ...
1
vote
1answer
41 views

Performing a FindRoot from Numerical integration

I am trying to evaluate: FindRoot[Xfnew[γ, w, Hi, mx]*92*10^23*γ^(4/(1 + w)) == 1198/10000, {Hi, hs}, MaxIterations -> 10000] for some starting value hs,...
0
votes
0answers
25 views

Solving a linear system with a badly conditioned matrix or reduce computing time [closed]

I have a linear system Ax=B,and the matrix A is a badly matrix. If I use the code"x=Inverse[A].B" or "x=LinearSolve[A].B" , I will get a obviously wrong result like the upper image. But if I use the ...
2
votes
1answer
48 views

ParallelDo gives different solution to Eigensystem

I am trying to calculate the eigensystem of a large matrix (e.g. 256x256). I have found that when I do this within a ParallelDo (because I am actually calculating many of these eigensystems), the ...
2
votes
0answers
47 views

How to construct a time-dependent matrix quickly?

In the process of discretization of a 4D PDE, I need to construct a final sparse matrix $B$, which is very large (I denoted by $\text{size}$ here) and time-dependent, viz, some of its entries change ...
0
votes
0answers
20 views

Properly parallelising FindRoot for multiple starting values

I have a problem I want to find numerical solutions for with different starting variables. Let F be a vector supposed to vanish, which in its definition includes ...
0
votes
1answer
39 views

Solve nonlinear differential equation system (Plot solution)

When I solve the system of differential equations I get two solutions for each variable (See the picture). My question is how I can neglect one of the solutions at the plot (The yellow and the blue). ...
0
votes
1answer
67 views

I have two lists that are the same, yet I get a FALSE when i try to show they are equivalent

I have tried changing the variables, reevaluating the cells, but it just keeps giving me false. The weird part is that it was originally true and it changed to false, randomly.I did not want to post ...
3
votes
1answer
98 views

Solve a system of 4-th order polynomial equations (numerically)

I have a function defined on $ S^6 \times S^6 $ (two spheres embedded in $ \mathbb{R}^7 $ individually). Let us call this vector $ \vec{f}(\vec{x},\vec{y}) $, where $ \vec{x} $ and $ \vec{y} $ are ...
3
votes
1answer
42 views

Numerical precision problem

I have this simple code: ep = 1 - 80000000000 (-(199999/200000) + 1/E^(1/200000)) ep // N -8.27404*10^-8 ...
0
votes
1answer
37 views

Finding the best representation of a numerically-inverted function via InterpolatingPolynomial and/or variations

Below is the routine I am using to sort of represent the numerically-inverted function $TP$. Basically I am finding a necessary interpolating polynomial $TPint$ that fits with the data points given by ...
1
vote
0answers
35 views

Finding zero linear combinations of polynomials (numerically)

I have two functions of real variables defined on two compact spaces ...
0
votes
1answer
35 views

Total derivative after numerical solution of a system

I have a system of three equations in three unknowns, $k$, $\theta$ and $w$. I am interested in the behavior of the variables when one parameter changes. I first specify the system: ...
0
votes
0answers
41 views

Proper implementation of numerically integrated function inside a differential equation

I have a numerically-inverted function TP which is then fed to the differential equation below. My question is: What is the right way to implement this ...
0
votes
0answers
12 views

Relationship between working precision and precision

Please is it possible that the working precision specified for a particular computation be equal to the precision of the numerical value gotten. What are the conditions that would make the numerical ...
4
votes
1answer
42 views

AccuracyGoal & PrecisionGoal: how to know which was used to yield the result?

With NMinimize (or many other functions), when an answer is found without any warnings, this means that a certain convergence criterium was achieved. It could be ...
8
votes
2answers
108 views

Robust DuplicateFreeQ for numerical data

I am looking for a fast and robust DuplicateFreeQ equivalent for numerical data. Floating point numbers should normally be compared with some tolerance, as ...
1
vote
1answer
36 views

Interpolation error of InterpolatingPolynomial[]

this is my first post so if I have any error while writing this, I'm sorry. I had to do a polynomic interpolation for one of my lab experiments, and I need to get the error from it in order to ...
3
votes
1answer
78 views

Problem involving a system of nonlinear coupled ODE's with adjustable boundary

The problem is to solve the following system ODEs: I. $\ \ \ \ \ \ \ \dfrac{4}{r}[1+a(r)]\left(\dfrac{dH}{dr}\right)^2+\dfrac{dG}{dr}=0$ II. $\ \ \ \ \dfrac{1}{r}\left(\dfrac{dA}{dr}\right)+f(r)+k^...
23
votes
1answer
280 views

Which second arguments is VectorQ/MatrixQ/ArrayQ optimized for?

VectorQ and similar functions (MatrixQ, ArrayQ) treat certain second arguments specially. ...
5
votes
2answers
109 views

Why is $\sum\limits_{k=1}^{100} 0.01 $ different than $\sum\limits_{k=1}^{100} \frac{1}{100}$?

Why does evalutating $\sum\limits_{k=1}^{100} 0.01$ not result in 1? What I get is 1.0000000000000007. I know that the number 0.01 in binary results in an infinite sequence of zeros and ones, which ...
0
votes
0answers
50 views

Find minimum precision setting

I am using FindMinimum command to find a local minimum of an object function. My code is below ...
4
votes
2answers
108 views

Getting additional control over MaxRecursion/PlotPoints

I'm occasionally in a position where I need to compute a RegionPlot with some small area of the plot being computationally much more expensive then the rest of the ...
0
votes
0answers
32 views

Weird fluctuations in DensityPlot

I have a really long multi parameter Lorentzian function: ...
1
vote
1answer
53 views

How can I solve this non linear system of ODEs using NDSolve?

I want to find solutions to the system: $$\begin{align*} -2b'(s)\sin(b(s)) &= \sin(b(s))(a'(s)b''(s) - a''(s)b'(s)) - (a'(s))^3 \sin^2(b(s))\cos(b(s)) \\ &(a'(s))^2\sin^2(b(s))+(b'(s))^2 = 1\...
1
vote
1answer
77 views
5
votes
0answers
48 views

Details of NDSolve calling LSODA

Inspired by my question regarding the computation time of NDSolve using the LSODA backend I was wondering how NDSolve is actually calling LSODA (what arguments are sent to LSODA), i.e. what are the ...
0
votes
1answer
46 views

Numerical Approximation of erfc

I have a crazy output. I already tried the N[] function. All it does is condense the inputs. Any idea of how to have a numerical output from the code?
2
votes
2answers
58 views

NDSolve producing message Power::infy

I am trying to solve geodesic equations in some 3D black hole spacetime. It is a coupled ODE system with boundary conditions. Due to the symmetry of the spacetime, I expect the solutions to be even ...
2
votes
0answers
92 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
125 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: ...
0
votes
0answers
35 views

Problem with significant digits [duplicate]

I wrote this short code ...
1
vote
1answer
79 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
24 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
148 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 ...