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
1answer
120 views

Numerically computing the eigenvalues of an infinite-dimensional tridiagonal matrix

I have one infinite dimensional tridiagonal matrix whose eigenvalues I have to compute. How can that be done numerically using Mathematica? Let me expose the concrete case I want to do it. I shall ...
8
votes
7answers
1k views

How to display very small numbers in Mathematica?

I am trying to evaluate the function: $$f(x) = \cos(x) - \mathrm{e}^{-2.7 x}$$ at $x = 1.7 \times 10^{-25}$ and Mathematica keeps returning '0.' How do I evaluate the expression in a better way?
3
votes
2answers
215 views

Solution or artifact?

I am trying to increase the precision of the code ...
1
vote
2answers
189 views

Multivariate Newton-Raphson method and FindRoot module [closed]

Let's suppose that we have the following equation ...
6
votes
2answers
180 views

Does Mathematica gives us a wrong result for the integral of a function including elliptic functions?

Calculus tells us that the differentiation of the integral of a function should be itself, but at least in one case Mathematica answers NO. I feel very confused. The new figure seems to bifurcate at ...
3
votes
1answer
98 views

Problem with the Inverse CDF of Non-central F Ratio Distribution

In[3]:= n = 5; n1 = 4; n2 = 6; γ = 0.05; α = 1/370; InverseCDF[NoncentralFRatioDistribution[1, n1 - 1, n1/γ^2], 1 - α - (n - n1)/n2] During evaluation of In[3]...
1
vote
1answer
71 views

Numerical solution to approximate the singular integration using collocation method

I am working to solve "numerically" the following integral equation IE: u[x]=f[x]+Integrate[(1/(x-t)^(1/4))*u[t],{t,0,x}]+Integrate[(1/(x-t)^(1/4))*u[t],{t,0,1}] ...
6
votes
1answer
130 views

Recycling solutions of multidimensional NDSolve

Dear wolfram community, I hope my problem is clear and easy to solve. I have already solved the following heat equation over a domain: ...
0
votes
1answer
107 views

Problems with numerical integration

I tried to plot beam intensity using a function that evaluates a numerical integral, but it didn't work. Here is my code, which did not produce a result. ...
6
votes
2answers
189 views

Catastrophic loss of accuracy in Orthogonalize

Context In connection to this question I am interested in orthogonalizing known matrices. As a test case, let us consider the definite positive $15 \times 15$ matrix ...
0
votes
1answer
131 views

Good practice about numerical precision

In one of my calculations, I get -1.11022*10^-16 as one of my eigenvalues for a matrix. It's essentially zero and I suppose I could use SetPrecision to make it zero but I wonder what's a good practice ...
0
votes
1answer
63 views

Increasing MaxExtraPrecision arbitrarily changes numerical result

I am trying to confirm that a function $f$ satisfies a particular differential equation of the type $D f=0$, for some differential operator $D$. I set $Df$ as Diffeq...
4
votes
3answers
285 views

Turn the following values into percentage [closed]

I have the following data: {2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017} {5914, 6143, 6182, 18000, 18173, 18344, 18454, 18506, 18800, 19216} My data is already in Matrix form in ...
0
votes
0answers
46 views

High numerical precision failing [duplicate]

N[(1 - 2*6.674*6*10^13/(6371000*299792458^2))^(0.5), 20] 1. What I expect: ...
1
vote
2answers
180 views

A numerical boundary conditions paradox

For $(t,z)\in[0,1]\times[-1,0]$ zmin = -1; tmax = 1; and some fields $w(t,z)$ and $y(t,z)$ ...
1
vote
1answer
33 views

NIntegrate fails with functions that have (necessarily) numeric lists as arguments

I'm not able to NIntegrate a function that has a numeric list as an argument. My original problem involves a compiled function, but a MWE is the following: ...
1
vote
1answer
78 views

How to deal with this error in Compiled Function?

...
0
votes
1answer
68 views

Wrong divergence with numerical value

this is my first question in this forum. I'm trying to evaluate some complicated function of, say, $x$ near $x=0$ (in order to integrate it later). The problem is that the numerical value of this ...
0
votes
1answer
117 views

Removing zero dot after solving [closed]

I've a question regarding "zero dots". Im using a lot of calculation in an application which i am building within mathematica. However when i use the output of solve for instant i will not have the ...
2
votes
4answers
162 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
39 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
318 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
32 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
31 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
61 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
58 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 + ...
1
vote
1answer
63 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
168 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
42 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
72 views

how can I make a grid? [closed]

I would like to make a grid for x between 0 to 1 and use following Table ...
-1
votes
1answer
161 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$. ...
3
votes
0answers
44 views

ContinuedFraction: different result with different representation of argument

Why if I write: In[7]:= ContinuedFraction[3.15] FromContinuedFraction[%] N[%] I get: ...
1
vote
1answer
54 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,...
3
votes
1answer
63 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
57 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
55 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
78 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). ...
1
vote
2answers
123 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
115 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
58 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
2answers
96 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 ...
1
vote
0answers
38 views

Finding zero linear combinations of polynomials (numerically)

I have two functions of real variables defined on two compact spaces ...
0
votes
1answer
59 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
42 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
14 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
55 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 ...
1
vote
0answers
33 views

Do you know what's issue of my code, NDsolve and ParametricPlot [closed]

Could you please point out my isse of the code? Frustrated. ...
8
votes
2answers
111 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
58 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
94 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^...