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 [numerical-methods]

Questions on numerical analysis/numerical methods; methods for approximately solving various problems that often do not admit exact solutions.

0
votes
1answer
6 views

Determining coefficients of a parametrization of an epicycloid given a predefined arc length.

I am trying to determine the coefficient q in the parametrization of a epicycloid which gives me the arc length of 4.25. The parametrization can be glimpsed in my attempt of a solution in the ...
0
votes
0answers
5 views

Finite element method with mixed boundary conditions problem

I have the problem in the attached picture which is a finite element method. I tried to get the last equation but I couldn’t . Could someone thankfully help me out? (Sorry for not writing it in ...
0
votes
0answers
9 views

Calculating derivative of any unknown function $f(x)$ at a fixed $x$ using finite difference method

Let's say I have a one variable function $f(x)$ and know its values at some given values of $x$ i.e. I have the following data x=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] f(x)=[a, b, c, d, e, f, g, h, i,...
1
vote
1answer
18 views

derivative approximation for the first derivative $f'(x_0)$ and the second derivative $f''(x_0)$

Consider a quadratic interpolant based on the data $(x_0-h, f(x_0-h)), (x_0, f(x_0))$ and $(x_0+h, f(x_0+h)).$ How do I find the derivative approximation for the first derivative $f'(x_0)$ and the ...
2
votes
0answers
14 views

Newton's method for the inviscid Burger's equation

I am trying to solve the inviscid Burger's equation with help of Newton's method in Banach spaces. So I want to solve $\partial_t u(x,t) + u(x,t) \partial_x u(x,t) = 0$ with u(x,0)=f(x), let's ...
0
votes
1answer
19 views

Prove that in a floating point system with truncation the number of significant digits is $n$.

I was requested to prove that in a floating point system $\text{F}(\beta, n, m, M)$ with truncation the number of significant digits is $n$. (where $n$ is the number of digits and $m < \text{...
0
votes
0answers
9 views

Numerical method for ODEs without frequency error

To solve an ODE numerically, one usually use finite difference methods. For example, simple harmonic oscillator, i.e. $$y''=-\omega^2y$$ can be discretized by $$\frac{y_{n+1}-2y_n+y_{n-1}}{\...
0
votes
1answer
14 views

2nd vs. 3rd Order Gauss Quadrature

I have read that using Gauss Quadrature integration, $$\int_{-1}^{1}f(x)dx=\sum_i f(x_i)w_i$$ for polynomials of degree $\leq2n-1$ (and otherwise it is an approximation). Using weight functions $w_i$ ...
1
vote
0answers
22 views

Questions about an equation

I derived the following equation in my research but I don't understand the equation very well. I hope to get some help here. $\displaystyle \frac{\partial f(r,t)}{\partial t} = h_0(t) f(r,t) \Big( \...
1
vote
1answer
55 views

Why does the Monte-Carlo Method Work?

I've been reading about the Monte-Carlo Method and how it is much simpler for computers to use the Monte-Carlo Method to guesstimate solutions to complex problems like the Standard Model. It is ...
1
vote
0answers
18 views

Error bound explanation (answer given)

I have been able to derive the interpolation polynomial $P_2(x)$ of degree two which interpolates $f(x) = \sin x$, given the points $(0,0), \left(\frac{\pi}{2}, 1\right), (\pi, 0).$ Solution: $$P_2(x)...
0
votes
0answers
16 views

Two Point Gauss-Laguerre Integration

I have the following question and in the notes we are taught about general gaussian integration and gauss-legendre, but only briefly about gauss-laguerre so I am a bit stuck. The question is as ...
0
votes
1answer
17 views

How to understand the order of convergence $\|x_{k+1} - x\| \le C \|x_k - x\|^p$ (Convergence of a power function form)?

By definition, a sequence $x_k \in \mathbb{R}, k \in \mathbb{N}$ converges with order $p \in [1,\infty)$ to $x := \lim_{k\to\infty} x_k$ if \begin{align} \exists C \in [0,\infty): \forall k \in \...
0
votes
1answer
28 views

Finding solutions to multiple non-linear equations

I am trying to calculate the solution(s) to these equations 1, the k0,k1,k2,k3 are the unknowns, everything else is known. The problem is that I cannot find a point of intersection of all equations so ...
1
vote
0answers
10 views

Approximation of Inverse Hessian or Inverse Hessian Square Root times a vector

I know there are good methods for approximating a Hessian times a vector without actually forming the hessian. (Example here). Are there any methods of approximating the Inverse of hessian times a ...
1
vote
0answers
18 views

Diagonalization and numerical simulation of a 2x2 System of PDEs

I'm new here and looking for help - so, hello! I tried to find something related to this topic but couldn't find anything that fits my needs. I try to make it as easy, short and clear as possible. ...
1
vote
0answers
20 views

Numerical Solutions to Differential Equations

I am trying to show that a linear multistep function has a unique solution. My current idea is to use Banach fixed point theorem. I am not sure how to use it though, any thoughts? Thanks in advance.
0
votes
1answer
50 views

Solving a system of second order tightly coupled nonlinear ODE with six initial conditions in Matlab

I am solving a problem from fluid dynamics; in particular tightly coupled nonlinear ordinary differential equations. The following is a scaled-down version of my actual problem. I have solved ...
0
votes
0answers
25 views

Interpolation error with Legendre/Chebyshev polynomials

I remember seeing somewhere that the Lagrange interpolation over Chebyshev nodes has least possible deviation in the sense of $\|\cdot\|_\infty$-norm, while Legendre nodes are optimal in the sense of $...
0
votes
0answers
12 views

Time complexity of least squares curve optimization using QR decomposition with Householder method.

Given a set of $m$ pairs of points, $<x_k, y_k>$, and a curve $y=ax^4 + bx^2 +c $ use the least squares method with QR decomposition and the Householder algorithm to approximate the curve's ...
0
votes
0answers
8 views

Solving multiobjective problem with matlb

I would like to solve a multiobjective problem with matlab with NSGA II procedure. The problem is a maximization/minimizationf objective functions. Can someone porvide me this code, and explain how to ...
0
votes
1answer
29 views

implementing Euler method in matlab for second order ODE

I have to use the Euler method for the differential equation : $$\begin{cases} x^{\prime}=y \\ y^{\prime}=-\frac{k}{m}x-\frac{\beta}{m}x^{3} \end{cases}$$ with $k=4, \beta =-0.04 , m=1$ in matlab. We ...
0
votes
0answers
15 views

Speed of Eigenvalue Solver Convergence with Different Spectral Shifts

I am trying to compute the smallest eigenvalues of a Hessian matrix $A$ (as a low-rank approximation of the Hessian inverse). Following the thread here, I am computing the eigenvalues of the ...
0
votes
0answers
13 views

Multistep methods for semi-explicit DAEs [on hold]

enter image description here enter image description here
1
vote
1answer
45 views

Approximating inverse Fourier transform with inverse discrete Fourier transform

Lets say i want to calculate inverse Fourier transform: $$ f(t)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\exp\left(i\omega t\right)f(\omega)\,\mathrm{d}\omega $$ of function $f(\omega)$ that is ...
0
votes
0answers
18 views

Variable change for numerical power series convergence in DE:s?

In this answer it is explained how to numerically solve differential equations using (truncated) power series expansions. This can be useful within some interval of real line. Let us assume some ...
0
votes
2answers
27 views

discretization error in numerical

I have been able to find the formula to approximate $f''(x_0)$ which uses $f( x_0),f\left(x_0+\frac{h}{2}\right)$ and $f(x+2h)$ with some help, which is the following: $$f''(x_0) =\frac{f(x_0+2h)-4f(...
0
votes
2answers
33 views

Find a formula to approximate $f''(x_0)$

Find a formula to approximate $f''(x_0)$ which uses $f( x_0),f\left(x_0+\frac{h}{2}\right)$ and $f(x+2h)$. My workings so far, $$f''(x) \approx Af(x+2h) + B(x) + C f\left(x_0+\frac{h}{2}\right)$$ ...
1
vote
1answer
16 views

Bounding using Kantorovich inequality

In my homework, I've made it to the point where I obtained this value $$\frac{(v^Tv)^2}{v^TQvv^TQ^{-1}v}$$ where $v \in \mathbb{R}^n$ and $Q\in \mathbb{R}^{n\times n}$ and $Q$ is symmetric positive ...
0
votes
0answers
14 views

Construct a $C^2$-continuous function for symmetric weighting

Let $\alpha>1$. I am looking for a $C^2$-continuous function $w:[0,\infty)\to\mathbb{R}$ which satisfies the following: \begin{align*} w(x)=1, &\ \ \ \ \ \ x\in[0,\frac{1}{\alpha}],\\ w(x)=1-w(...
2
votes
3answers
60 views

Unique solution of $x = \cos\left(\frac{x}{2}\right)$

How does one show that there is a unique solution to this equation? $$x = \cos\left(\frac{x}{2}\right)$$ Furthermore how can we find it?
1
vote
0answers
14 views

Encouraging sparse output in optimization problem

I am trying to define an optimization problem: $$ \min_\theta \sum_{x\in X} L(x, \theta, f_\theta(x),\delta_\theta(x)) + \lambda_s S(\delta_\theta(x)) $$ where $X$ is the dataset, $\theta$ are the ...
0
votes
1answer
10 views

Implicit Linear multistep method order?

Considering the following linear multistep method: $y_{k+2} = y_{k+1} + \frac{h}{12} \left( -f(x_{k},y_{k}) + 8f(x_{k+1},y_{k+1})+ 5f(x_{k+2},y_{k+2}) \right)$ What is it's order? What is the ...
3
votes
2answers
46 views

centered finite difference approximation

Show that the centered finite difference approximation for the first derivative of a function on a uniform mesh yields the exact derivative for any quadratic polynomial $P_2(x) = a+bx+cx^2$ Using the ...
-1
votes
0answers
22 views

Numerical solution for heat equation in two dimensions [closed]

All of us without any exception are familiar with the concepts of heat equation in two dimensions and its numerical solution. There are many numerical methods to solve heat equation in two ...
0
votes
0answers
13 views

A cubic spline with natural boundary conditions

A cubic spline with natural boundary conditions is given by \begin{cases} 1+2x-x^3 & [0,1] \\ 2+b(x-1)+c(x-1)^2+d(x-1)^3 & [1,2] \ \end{cases} Find $b,c,d$ This is the ...
1
vote
1answer
24 views

Question about iteration method (Gauss- Seidel)

We want to solve the linear system $Ax=b$, where $A$ is SPD. We use a method similar to steepest decent method. For the first searching direction $d^1, d^2, \cdots d^n$ are chosen to be the standard ...
-1
votes
2answers
27 views

Creating polynomials from interpolation [closed]

) Assume $f(x)= x^3 – 3x^2 + 1$ and $N = \{-1,0,1\}$ a set of nodes. We are looking for the polynomial $P_2(x) = a_0 +a_1x +a_2x^2$ that interpolates $f$ on the set $N$. a. ) Determine $a_0$, $a_1$ ...
0
votes
0answers
29 views

Numerical differentiation of functions defined by algorithms

Assume we have a function $f: [a,b] \to \mathbb{R}$, which is continuous on its domain, and given by some algorithm which allows us to compute however many digits we want (with ways to estimate error)...
-1
votes
0answers
10 views

Find stability of method

$4x^3+9zhx^2-2zhx+3zh=0$ where $|x|$ < 1 Find condition with $z$ in terms of $h$
0
votes
2answers
36 views

fourth order accurate approx

Prove that the following is a fourth order accurate approximation of the second derivative of a function $f$: $$f''(x_0) = \frac{-f(x_0+2h)+16f(x_0+h)-30f(x_0)+16(x_0-h)-f(x_0-2h)}{12h^2} + O(h^4)$$ ...
-1
votes
0answers
12 views

calculating mean square displacement(MSD) for 10 particles

I have a vector for particle 1 position x1=[1,2,3,4,5,6....100] at time t=[1,2,3,4,5,6.....100]. Following the same procedure I ...
1
vote
0answers
16 views

Condition number on the DFT-like complex vandermonde matrix

Given $M \in \mathbb{N}$ and $0 < L \le M$, $L \in \mathbb{N}$ consider a set of $L-1$ integers, such that $ 0 \le i_1 < i_2 \ldots < i_{L-1} \le M$ Note that this index set has symmetry ...
0
votes
1answer
17 views

upper and lower limits for finding just one (real) solution of an algebraic equation (degree 5 and lower)

While programming an equation solver (using trial and error), I came across the fact that there are multiple real and complex bounds in which all of the solutions should be. For my case, only real ...
0
votes
0answers
11 views

Is LDLT decomposition of stochastic matrices stable?

Matrix A has: non-negative entries columns that each sum to 1. LDLT decomposition requires the matrix A to be positive or negative semi-definite to be stable. https://eigen.tuxfamily.org/dox/...
1
vote
1answer
29 views

Newton's method with Gaussian elimination

Implement Newton's method for a system of nonlinear equations $f(x) = 0$, where $f = (f^1,...,f^n)^T = 0$ and $x = (x^1,...,x^n)^T$. Both the function $f$ and the Jacobian $J$ are given as lambda ...
0
votes
2answers
58 views

Using Matlab to solve $\sin(k+a)=x\cos(k)$ numerically for $a$

I want to solve a trigonometric equation numerically for $a$ via Matlab $$\sin(k+a)=x\cos(k)$$ where $a$ is an argument of a complex number. Both $a$ and $k$ vary between $0\leq k\leq\pi$. I want ...
0
votes
2answers
29 views

Using bisection method

I have created the following code which does the bisection method. I am trying to use it to find the root for the function $f(x)=x^7-6x^6-28x^5+232x^4-336x^3-544x^2+1728x-1152$ on the interval $[1, 3....
0
votes
2answers
26 views

What is the benefit of using forward difference approximation in newton's method of root finding?

I am trying to think of when using forward difference approximation to $$f'(x) = \frac{f(x+\delta) - f(x)}{\delta}$$ in Newton's root finding method of $$f(x_{n+1})=x_n-\frac{f(x_n)}{f'(x_n)}$$ is ...
0
votes
0answers
15 views

What is the definition of spectral convergence?

I don't understand what is spectral convergence. The definitions I found in google are very physics. Is there any definition in mathematics ?