New answers tagged numerical-methods
0
votes
Green's Formula for vector fields in the Navier Stokes Weak Formulation
The Green's formula for vector fields u = (u1, u2, u3) and v = (v1, v2, v3) can be derived from the scalar Green's formula as follows:
Apply the scalar Green's formula to each component of the vector ...
0
votes
Use the bisection method to find the minimum of the function
The bisection method to find the minimum of a function is quite useful in many applications. One application is minimizing the following 1-dimensional problem called the exact line search for ...
2
votes
Accepted
Solving $y'=(x-1)y$ $y(0)+2$ using $RK2$
This is an older tradition, here going back to the original papers of W. Martin Kutta in 1901 and Karl Heun in 1900, to name the parameters with the greek or latin alphabet letters. See https://...
0
votes
Accepted
Existence of a lower-bound for an interesting function!
Let
$c := \frac14\lambda_{\min}(H) > 0$.
By Cauchy-Bunyakovsky-Schwarz and AM-GM, we have
$$(x-z)^\top\nabla f(z)
\ge - \sqrt{\|x-z\|^2 \|\nabla f(z)\|^2}
\ge - 2c \|x-z\|^2 - \frac{1}{8c}\|\nabla ...
1
vote
Accepted
Recommendations on numerical methods and numerical analysis books for machine learning?
Justin Solomon “Numerical Algorithms - Methods for Computer Vision, Machine Learning, and Graphics” (2015)
2
votes
How do you *accurately* calculate distances in the hyperboloid model of hyperbolic geometry?
The biggest source of precision loss is how the value inside of $\operatorname{arcosh}$ goes to 1. We'll use the definition of $\operatorname{arcosh}(x) = \log(x + \sqrt{x^2-1})$. Making the ...
1
vote
Accepted
The smallest distance between the curves
Hint : Transform the first equation under a polar form :
$$r^4-r^2(\cos^2 \theta-\sin^2 \theta)=0 \ \iff \ r= \sigma\cos(2\theta)$$
Or under an equivalent parametric form :
$$\begin{cases}x&=&...
1
vote
Accepted
While solving Wave equation using FDM, how to solve and related eigenvalues
Let $D\in\mathbb{R}^{n\times n}$ have purely imaginary eigenvalues $\{\lambda_1,\dots, \lambda_n\}$ and corresponding orthonormal eigenvectors $\{v_1,\dots,v_n\}$. Now consider $A = \begin{pmatrix} 0 &...
1
vote
I am trying to solve a two point Boundary Value Problem using linear shooting method
Yes, so far this is correct. Now use that the equation is linear, thus the solutions superpose, thus the value at the end of the interval is a linear function of the state at the start of the interval....
0
votes
Machine limit analysis of $\sqrt {x^2-a^2}-(x-a)$
May I add the standard binomial expansion
$$
\sqrt{x^2-a^2}-(x-a)
=a+[\sqrt{x^2-a^2}-x]\frac{\sqrt{x^2-a^2}+x}{\sqrt{x^2-a^2}+x}\\
=a+\frac{-a^2}{\sqrt{x^2-a^2}+x}\\\approx a-\frac{a^2}{2x}
$$
So the ...
0
votes
Machine limit analysis of $\sqrt {x^2-a^2}-(x-a)$
If you want to properly compute $L(x)$, multiply by the conjugate and use Taylor to get
$$L(x)=a-a\sum_{n=0}^\infty \frac{\alpha_n} {\beta_n} \left(\frac{a}{x}\right)^{2 n+1}$$ where the ${\alpha_n}$ ...
2
votes
Evaluating (or tightly bounding) $\sum_{j=1}^\infty\frac1{x_j(1+a)^2-a}$, where $x_j$ is the $j$-th positive root of $a\tan\sqrt x=(1+a)\sqrt x$
Just for the roots !
Let $x=t^2$ and $k=\frac{1+\alpha}\alpha$ and to remove the discontinuities, search to the zero's of function
$$f(t)=k ~t \cos (t)-\sin (t)$$ Expanding around $t= \left(n+\frac{1}...
2
votes
Evaluate $\pi$ using $\arctan(\frac{\sqrt{3}}{3})$
Just a bit late !
Using the incompleta beta function
$$R_{2n} = (-1)^{n}\int^{\frac{\sqrt3}3}_0 \frac{t^{2n}}{1+t^2}\,dt=-\frac{i}{2}\,(-1)^{-n}\, B_{-\frac{1}{3}}\left(n+\frac{1}{2},0\right)$$
$$\log(...
0
votes
Accepted
Analytically Solving an Equation System of the type $kn x^{n - 1} + x^n$ for $k$ and $n$
Maple 13's solve command yields:
$$k=-\frac{r}{y}(uz-vy)x^\frac{ux}{r(uz-vy)},\ \ n=-\frac{ux}{r(uz-vy)}.$$
Maple 13's eliminate command yields:
$$n=\frac{1}{\ln(x)}W\left(\frac{ux\ln(x)}{ky}\right),\ ...
2
votes
Accepted
Detailed exp does Euler's method fail for second order sinusoidal ODE?
You can try some symbolic iterations.
The state vector $$Y=\begin{pmatrix}y\\
v
\end{pmatrix}$$
has derivative $$f(x,Y) = \begin{pmatrix}v\\
\sin x
\end{pmatrix}$$
and I.C. $$Y_0 = \begin{pmatrix}0\\
-...
0
votes
Accepted
Lagrange interpolation and orthogonal polynomials
Since $L_i$ is a polynomial of degree $n-1$, $L_i^2$ is of degree $2n-2$, thus we can reuse (I),
$$\int_a^b L_i^2(x)dx = \sum \lambda_j L_i^2(x_j) = \lambda_i.$$
And by (I), $\lambda_i = \int_a^b L_i(...
1
vote
Implementing Boundary Conditions at Infinity in Numerical Method
The way to approach this numerically is to implement a perfectly matched layer boundary condition. When you are doing a graphical analysis of your numerical solution, you can only do it in a finite ...
-1
votes
Can the order of convergence be defined for a bisection method?
Bisection is a simple and wasteful method. All the better methods use the available data about function values and build a model from them. The root of the model is then taken as the new midpoint. The ...
0
votes
Approximating the integral of the exponential of a quadratic function
Completing the square leads to the imaginary error fuction
$$I=\int e^{ax^2+bx+c}\,dx=\frac{1}{2} \sqrt{\frac{\pi}{a}}\,\,e^{c-\frac{b^2}{4 a}}\,\,\text{erfi}\left(\frac{2 a x+b}{2 \sqrt{a}}\right)$$
...
1
vote
Initial approximation to inverse of beta distribution function / quantile of beta distribution
I suppose that the second approximation assumes that $x$ is small.
By Taylor
$$\frac{B_x(p,q)}{B(p,q)}=x^p \left(\frac{1}{p B(p,q)}+\frac{(1-q) x}{(p+1)
B(p,q)}+O\left(x^2\right)\right)$$
Using the ...
0
votes
What should the initial guess be for the Babylonian method of calculating square roots?
If you are using a computer, the number will be stored in binary and from this storage you can render the number as $a×4^n$ with $1\le a<4$ and $n$ an integer. Since the method will converge from ...
0
votes
asymptotic expansion of exponential solution to ODE
If you let $u=z \sqrt x$, the equation becomes
$$x^2 z''+x z'+\left(x^2-\frac{4\gamma+1}4\right)z=0$$ which is a Bessel equation.
Let $k=\frac{1}{2} \sqrt{4 \gamma+1}$ to obtain
$$z=c_1 \,J_k(x)+c_2\,...
0
votes
Uniqueness of Hessenberg matrix in Cholesky factorization of Hankel matrix
This is not $\textit{very}$ evident, but it does come down to a cool property of powers of Hessenberg matrices and induction: Suppose we have a "Hessenberg upper triangular-like matrix" $M$ ...
0
votes
Asymptotic expansion of root of $\varepsilon x \tan(x)=1$
I do not see any problem if you look for the zero's of
$$f(x)=x\sin(x)-k \cos(x) \qquad \text{where}\qquad k=\frac 1 \epsilon$$ Expnd it as a series around $(2n+1)\frac \pi 2$
and use power series ...
2
votes
Accepted
Uniqueness of Hessenberg matrix in Cholesky factorization of Hankel matrix
I would assume the upper Hessenberg matrix here is unreduced, i.e. the subdiagonal entries are all nonzero.
The first column of $T$ is of course $Te_1$, and so is determined by (2.4).
If $T$ is ...
1
vote
Accepted
Best root finding algorithm to use for this problem..
I got all nerd-style with your question...
Preamble: I hope my math is OK.
Starting with the approach suggested by @Paul Sinclair, if we define $Z = \sigma \sqrt{T} $ (since both $\sigma$ and $T$ are ...
1
vote
Inscribing a square bar in a box
I've implemented the method outlined in the question, and used the Newton-Raphson multivariate method to arrive at a the solution.
The cuboid example I had dimensions $20 \times 30 \times 30 $ and $d =...
0
votes
Solution of $a^x=\Gamma(x)$ for $a \geq 1$
For sufficiently large $n$, $a^{n!} >> a^{n^2}=(a^{n})^n>>(a!)^n$ so there's no need to solve such a difficult problem
If you curious though, try to solve the log version
$$x\log(a) =\log(\...
2
votes
closed-form solution for 1/tanh(x) - 1/x that can be evaluated at/near x=0?
If you accept an infinite series as a closed form solution, there is one.
$$y=\frac{1}{\tanh (x)}-\frac{1}{x}=\sum_{n=0}^\infty \frac{2^{2 n+2}\, B_{2 n+2}}{(2 n+2)!}x^{2n+1}\tag 1$$ use use power ...
2
votes
Solution of $a^x=\Gamma(x)$ for $a \geq 1$
There is a good approximation (have a look here).
$$x_0 \sim a \,e^{1+W(t)}+\frac 12 \qquad \text{with}\qquad t=\frac{\log \left(\frac{a}{2 \pi }\right)}{2 e a}$$ $W(.)$ being Lambert function.
For $...
2
votes
Accepted
What is the importance of the largest eigenvalue / spectral radius of a symmetric positive matrix being equal to 1? Particularly in attention.
First of all, $\rho(\mathbf{A}) < 1$ doesn't mean $\lVert \mathbf{Ax} \rVert < \lVert \mathbf{x}\rVert$, an example is $\mathbf{A} = \left(\begin{matrix}0 & r^{-1}\\ r &0\end{matrix}\...
0
votes
Accepted
Is this method I made, (Babylonian Approximix) to find square roots with an approximate answer accurate and useful?
My answer is similar to Ethan. If $a<<x$, then $$\frac{(x+a)^2}{x}=x+2a+\frac{a^2}{x}≈x+2a$$
Now my own contributions. I have tried to replicate your process as a singular function, then you're ...
0
votes
Is this method I made, (Babylonian Approximix) to find square roots with an approximate answer accurate and useful?
It's clever. It works because
$$
(x+a)^2 = x^2 + 2ax + a^2
$$
so
$$
\frac{(x+a)^2}{x} = x + 2a + \frac{a^2}{x} \approx x + 2a
$$
when $x$ is large compared to $a^2$.
Whether or not it's useful ...
2
votes
How to evaluate $\sum\limits_{n=3}^ \infty \frac{1}{n \ln(n)(\ln(\ln(n)))^2}$
Known acceleration approaches are Euler–Maclaurin and Abel–Plana. Let's take the second one:
$$
\sum_{n=a}^\infty f(n)=\frac12f(a)+\int_a^\infty f(t)\,dt+i\int_0^\infty\frac{f(a+it)-f(a-it)}{e^{2\pi t}...
0
votes
How to transform this expression to a numerically stable form?
It is sure that, if you access the described function, @njuffa provided he perfect answer.
If this is not the case, using Taylor series
$$f(x, t)=\frac{\left(1+x\right)^{1-t}-1}{1-t}=\sum_{n=0}^\infty ...
0
votes
Numerical approach of integral equation
I assume you are taking a non-trivial solution ($s(t) \neq D$). Let I be the integral, by Leibniz's rule we have
$$\frac{\partial I}{\partial s} = -\int_0^t f(s,\tau)d\tau$$
$$\frac{\partial^2 I}{\...
0
votes
Solving $n \ge \frac{K_n^2}{\epsilon^2} \frac{\log K_n}{\epsilon}$, where $K_n = (\log n)^3$
The problem is simpler if you let $n=e^x$ and then you search for $x$ such that
$$ f(x)=e^{-x} x^6 \log (x)-\frac {\epsilon^3}3 >0$$ The derivative is
$$f'(x)=e^{-x} x^5 (1-(x-6) \log (x))$$ ...
2
votes
How to evaluate $\sum\limits_{n=3}^ \infty \frac{1}{n \ln(n)(\ln(\ln(n)))^2}$
In general we can approximate a sum $S=\sum_{i=m}^n f(i)$ by an integral $I=\int_m^n f(x)dx$, more precisely for $n=\lfloor x\rfloor$ and $f(x)=1/(x\log(x)(\log\log(x))^2)$ we have $f(n)\geq f(x)\geq ...
1
vote
How to evaluate $\sum\limits_{n=3}^ \infty \frac{1}{n \ln(n)(\ln(\ln(n)))^2}$
Not a complete answer, but maybe it helps..
Here, have some derivatives:
$$\frac{d}{dx}\log x = \frac{1}{x}$$
$$\frac{d}{dx}\log\log x = \frac{1}{x\log x}$$
$$\frac{d}{dx}\frac{1}{\log\log x} = \frac{-...
0
votes
How to evaluate $\sum\limits_{n=3}^ \infty \frac{1}{n \ln(n)(\ln(\ln(n)))^2}$
Using Python script:
...
1
vote
Determining algebraically a point of intersection.
I think that it could be better to write the equation as
$$e^x\,\log(x)=1$$
By inspection, the solution is $\in (1,2)$.
Expand the lhs as
$$f=e^x\,\log(x)=e \sum_{n=1}^\infty a_n\,(x-1)^n$$ where the ...
0
votes
Gauss-Hermite quadrature of entire function
See Theorem 3.3 https://www.sciencedirect.com/science/article/pii/S0022247X12002600?via%3Dihub#s000015 and also a recent preprint https://arxiv.org/abs/2312.07940.
3
votes
Accepted
Approximation of $\int_0^{\infty} e^{-bx^2}sin(ax^2)dx$ when a>>b
If you use Euler representation of the sine function, the antiderivative is an error function since
$$\int e^{-bx^2}\,\sin(ax^2)\,dx=\Im \left( \int e^{ (b-i a)x^2}\,dx\right)$$
Edit
As @Travis Willse ...
0
votes
Convergence problems with numerical integration
Are you trying to integrate over a semi-infinite interval, i.e. you want $\int_0^\infty f(x) dx$? Just making the interval really large (e.g. you mention $10^{10}$) is a probably bad idea, because ...
0
votes
Is the notion "If a polynomial has small coefficients (relative to the exponent), then it has small roots" true?
A bit late to the party, but I always find it insightful to look at the easiest or most know answers. In this case look at the standard roots for the quadratic equation $ax^2+bx+c$:
$$
x = \frac{-b\pm ...
9
votes
What is meant when mathematicians or engineers say we cannot solve nonlinear systems?
I think what you see there is essentially an oversimplified negation of the statement 'linear systems are solvable'. This is a true statement, they can be solved exactly if they are reasonably small ...
10
votes
What is meant when mathematicians or engineers say we cannot solve nonlinear systems?
Your question is indeed overly broad. As asked, the answer is probably that the unsolvability refers to the absence of answers that are essentially formulas of some kind. The numerical methods you ...
1
vote
Accepted
If $A$ is symmetric positive definite then so is $2D-A$
As you said $D=\operatorname{diag}(A)$. Then $$2D-A$$ is the matrix flipping the signs of all sub diagonals, but the diagonal keep the same entries. Let $x$ be arbitrary vector and $y$ be the one in ...
4
votes
Accepted
Why no one uses the product formula for sine function to calculate $\pi$?
Let $$\tilde\pi_{(m)} = \frac{2}{\prod_{n= 1}^m\left(1-\frac{1}{4 n^2}\right)}=\pi \,\frac{ \Gamma (m+1)^2}{\Gamma \left(m+\frac{1}{2}\right)
\Gamma \left(m+\frac{3}{2}\right)}$$
$$\frac{\tilde\...
3
votes
Why no one uses the product formula for sine function to calculate $\pi$?
It's obviously slow. Let the sequence be $x_n$ then $\dfrac{x_n}{x_{n-1}}=\frac{1}{1-\frac{1}{4n^2}}\approx1+\frac{1}{4n^2}$
Let's say you wanna have $100$ significant digits then $\frac{1}{4n^2}<\...
Top 50 recent answers are included
Related Tags
numerical-methods × 14190ordinary-differential-equations × 1794
linear-algebra × 1192
numerical-linear-algebra × 1183
partial-differential-equations × 1110
integration × 1037
calculus × 885
real-analysis × 653
matrices × 587
approximation × 537
interpolation × 532
numerical-calculus × 512
finite-differences × 510
matlab × 507
optimization × 456
numerical-optimization × 441
analysis × 431
polynomials × 395
newton-raphson × 347
roots × 336
runge-kutta-methods × 336
algorithms × 326
computational-mathematics × 317
derivatives × 296
taylor-expansion × 295