Tag Info

Hot answers tagged

3

If you use the first two members of the Taylor series of the numerator and the denominator then you get $$\frac{x-\sin x}{1- \cos x}\approx \frac{x}{3}.$$ The error of this approximation is less than $10^{-8}$ over the interval $(-0.01,0.01).$


2

In the same spirit as Yves Daoust, for more accuracy than using Taylor series, you could use Pade approximants. The simplest one would be $$\frac{x-\sin x}{1- \cos x}\approx \frac{x \left(420-x^2\right)}{45 \left(28-x^2\right)}$$ The error is extremely small : $\approx 10^{-15}$ over the interval $(-0.01,0.01)$. Another could be $$\frac{x-\sin x}{1- \cos ...


2

Here is my Matlab code for Cholesky, I hope it works also on Octave. It is taken step by step by the wikipedia Cholesky–Banachiewicz algorithm: function[L]=MyChol(A) [n,m]=size(A); L=eye(n); for k=1:n-1 L(k,k)=sqrt(A(k,k)); %Computing the diagonal L(k+1:n,k)=(A(k+1:n,k))/L(k,k); %Computing the lower part ...


2

The inequality comes from multiplying $\|x - x'\| = \|A^{-1} (b - b')\| \le \|A^{-1}\| \|b - b'\|$ and $\|b\| = \|A x\| \le \|A\| \|x\|$, and dividing the result by $\|x\| \|b\|$. So you'll get equality whenever $\|x - x'\| = \|A^{-1}\| \|b - b'\|$ and $\|b\| = \|A \| \|x\|$. Choose $x$ to maximize $\|A x\|/\|x\|$ with, say, $\|x\| = 1$, and $b = A x$. ...


2

First, $H^{(1)}_0(z)$ used in Matlab and Mathematica has a branch cut over the line $(-\infty, 0]$. Thus your real line integration does not give the answer you're looking for. Fix your code with %% I PATH f = @(z) besselh(0,1,z).*exp(-1j*z*t); z = @(R) R - 1e-20j; % under branch cut dzdr = @(R) 1; g_I = integral(@(R) f(z(R)).*dzdr(R), a, -a) Next, to ...


2

Probably Limited Memory Broyden–Fletcher–Goldfarb–Shanno algorithm as it is a very general algoritm for optimization that takes very little function calls, if you can calculate the first derivative analytically. If you cannot, you will have to calculate the first derivatvie numerically which is hard, but in this case lBFGS is probably still a very good ...


1

There are many methods. Here I will suggest one - formulating it as a sum of two non-smooth functions with (relatively) easily computable proximal operators. Then, you can use any method for optimizing a sum of two non-smooth functions, such as Douglas-Rachford. You can re-formulate it as: $$ \min_{x,y} ||y||_{\infty} \quad \mathrm{s. t.} ~ Bx = c, y = Ax ...


1

Centralization is, at least as far as I know, not really as important as normalization for some inverse problems. Note that $A^{-1} = (DA)^{-1}D$ for diagonal $D$ which, depending on how you compute an inverse, may affect the stability of the computation if the columns of $DA$ are much more on the same scale compared to the columns of $A$, due to the adjoint ...


1

Simpson's Rule is generated by fitting a quadratic curve to each set of neighbouring three points. If the intervals are unequal you would have to generate your own formula to fit the data.


1

The exact solutions to Volterra-Lotka are convex, almost circular curves. The explicit method follows the tangents of these curves, which means that every step changes to a more outward curve. The implicit method is the exact reverse, each step changes the level to a more inward curve. You need higher-order explicit methods for better preservation of the ...


1

Any Runge-Kutta method can be used as a quadrature formula. Just apply it to $$ \frac{dy}{dx} = f(x) $$ so $$ y_{n+1} = y_{n} + h \sum b_i f(c_i). $$ Let's assume that the method is of third order. Thus evaluating $y_{n+1} - y_n$ as $$y_{n+1} - y_n = \int_{x_n}^{x_{n+1}} f(x) dx \approx h \sum b_i f(c_i)$$ shoud have an error of $O(h^4)$ magnitude (local ...


1

It may be very unclear what stands for $$ \frac{d}{d\epsilon}(u+\varepsilon v)'(x)^2 $$ Let's put the $x$ argument along with the derivative inside. Since the derivative is taken with respect to $x$, $\epsilon$ stands as a constant term. $$ \frac{d}{d\epsilon}\big(u'(x)+\varepsilon v'(x)\big)^2. $$ Now it is clear that $$ ...


1

The $$ \omega_{i+1} = \omega_i + \frac{h}{2}(3f(t_i,\omega_i) - f(t_{i-1},\omega_{i-1})) $$ is an explicit two-step (using three points $i-1, i$ and $i+1$) method. In contrast, the second one $$ \omega_{i+1} = \omega_i + \frac{h}{2}(f(t_{i+1},\omega_{i+1}) + f(t_{i},\omega_i)) $$ is an implicit one-step (using two points $i$ and $i+1$) method. It is ...


1

The bisection method approximates the roots to the function. Since it's an approximation, there exists some error. Your precision tells you how close you want the approximation to be compared to the actual value (the actual root). So basically, the number of steps $n$ you need to take to get a particular precision $\epsilon$ is given by $$n = \log_2{\frac{b ...


1

The thing that evaluates to $0.1$ or less is the absolute error. Since $f(x)=x^5+x+1$ is continuous, $f(-\frac 78)<0$, and $f(-\frac 34)>0$, the intermediate value theorem guarantees that there is a root of $f(x)$ in the interval $$-\frac 78<x<-\frac 34$$ Another way of writing that inequality is $$\left| x-\left(-\frac{13}{16}\right) ...


1

You've mixed Richardson extrapolation (which extrapolates single value obtained from two or more evaluations with different step sizes) and interpolation which is used to reconstruct continuum solutions from pointwise data. Unless you're using some finite element method which gives continuum approximation whatever stepsize you take, you can use Richardson ...



Only top voted, non community-wiki answers of a minimum length are eligible