Questions tagged [numerics]
The numerics tag has no usage guidance.
958
questions
1
vote
0
answers
43
views
Efficiency of developing PDE solvers using sparse matrices versus loops
I am new to solving PDEs, but have been looking at different implementations of finite difference and finite volume schemes. One thing I have noticed in different implementations is that some ...
1
vote
1
answer
71
views
A question on the Poisson equation with Neumann and periodic boundary conditions on a rectangular region
I am trying to solve the following PDE by using finite difference
\begin{eqnarray*} \Delta u&=& f ~~on~~(0,1)\times(0,1)\\
\frac{\partial u}{\partial y}(x,0)&=&0=\frac{\partial u}{\...
0
votes
0
answers
46
views
Reference request for finite elements theory
Consider a domain $\Omega \subseteq \mathbb{R}^{2,3}$ which is non convex and with $C^2$ boundary. Could you recommend a good reference where it is explained how:
without needing isoparametric ...
2
votes
0
answers
91
views
FEM applied to heat equation and incompatible conditions
Consider the problem $$u_t - \Delta u = f \text{ on } \Omega\times (0,T)\\u=0 \text{ on } \partial \Omega\times (0,T) \\ u(x,0)=g(x) \text{ on } \Omega$$
with $g$ NOT vanishing on the boundary. If I ...
1
vote
2
answers
118
views
Secant Method for finding $\sup f^{-1}(0)$
Let $f \in C^0[0, 1]$, and suppose $f \ge 0$. How can I compute $\sup f^{-1}(0)$ efficiently?
2
votes
0
answers
63
views
Numerical scheme for the heat equation on the icosahedral hexagonal grid
I have a predefined grid(like this) that is spawned from a regular icosahedradron. It consists of many hexagons and 12 pentagons (corresponding to icosahedradron vertexes). I can tweak the granularity ...
3
votes
0
answers
73
views
Are there radial basis functions $\phi_n(x)$ which can be factored as $f_n(x) x^{\alpha}$ for $0<\alpha<1$ and $n>0$?
I am looking for a set of radial basis functions $\phi_n(x)$ on $\mathbb{R}^+=[0;\infty[$ which satisfy some othogonality condition
$$ \int x \phi_n(x) \phi_{n'}^*(x) dx =\delta_{nn'}$$
and "...
3
votes
0
answers
126
views
Numerically solving a 6th order non-linear differential equation in Matlab
I've posted yesterday a question about solving a non linear equation : it was not clear so I am reformulating my question.
I am trying to solve a high-order non linear differential equation presented ...
0
votes
0
answers
38
views
Multigrid/Two-grid method restriction and prolongation of residual
Starting from the problem $Au=f$, I'm not sure that I understand why a coarse grid solution is implemented on the coarse grid residual $r_c^{(k)}=P^Tr^{(k)}$, with $r^{(k)}=f-Au^{(k)}$ and $P^T$ ...
0
votes
1
answer
43
views
Interpolation and Restriction operators in Multigrid
I saw in several places that interpolation operator ($P$) and restriction operator ($P^T$) are usually transposes of each other (up to multiplication by a constant).
As I understood it related to ...
2
votes
0
answers
70
views
Numerical instability in the inverse Laplace transform
I have a problem with Laplace inversion and my function is not numerically stable for the Laplace inverse, but I do not understand the cause of this problem.
Here is my code and graph of this problem. ...
5
votes
0
answers
65
views
Largest singular value without using the adjoint
The square of the largest singular value of a linear map $A$ can be computed by using the power iteration for $A^TA$ and one advantage of this is that the iteration is matrix free, i.e. you only need ...
3
votes
1
answer
75
views
Robust ways of evaluating $j_n(x+iy)/e^y$
For reasons to do with extending the range of applicability of this Mathematica package, I would like to have a good handle on the numerical evaluation of functions of the form
$$
f(x) = \frac{j_n(\...
6
votes
3
answers
163
views
Why in scientific papers convergence of finite difference and finite volume schemes is tested using multiple norms ($l_1$, $l_2$ and $l_{\infty}$)?
In peer reviewed numerical papers, the order of accuracy of finite difference and finite volume for PDEs is computed in multiple norms, usually $l_1$, $l_2$ and $l_{\infty}$, and other times $l_{\...
2
votes
1
answer
91
views
Finding the correct order of eigenvectors of a parameter-dependent Hermitian matrix
so, I have a symmetric, analytic matrix $\mathbf{H}(x)$ ($x$ is real). Because $\mathbf{H}(x)$ is analytic and $x$ is real, it is possible to find analytic functions for the eigenvectors and the ...
2
votes
1
answer
142
views
How to use an adaptive step size in boost::odeint
This is a combination of these two previous questions:
How to get ODE solution at specified time points?
Stop integration in odeint with stiff ode
I need to solve the following differential equation ...
0
votes
1
answer
148
views
Solve a large-scale linear system of equations with millions of unknowns
I have a large-scale system of linear equations: $Ax = b$, where $A$ is an $n\times n$ square symmetric positive definite matrix (not sparse), $b$ is an $n \times 1$ vector and $x$ is $n\times 1$ ...
1
vote
1
answer
76
views
Beam propogation method for a waveguide. How to get single mode?
I am simulating a waveguide using diffractio python library (https://diffractio.readthedocs.io/en/latest/readme.html). The idea is to create a single mode waveguide using wave propogation method.
...
0
votes
0
answers
44
views
Why is the solution in FEM bounded by zero?
Consider the following problem:
$$ -\nabla^2 u = f,$$
Referencing to this post: FEM, we write the problem in variational form
I'm assuming Dirichlet boundary conditions here): Find $u\in H^1_0(\Omega)$...
0
votes
0
answers
18
views
Transparent Boundary Conditions relationship with intermediate BCs in ADI-PR method
I have read some materials about ADI - PR method with the aim to understand how to put boundary conditions in my 2D scheme which solves the Time-Dependent Schrodinger Equation.
All the theory I read ...
0
votes
0
answers
44
views
Convergence of Conjugate Gradient Method
Can anyone help me prove that, if the residual $r_0 = b-Au_0$ can be written as a linear combination of $k$ eigenvectors of $A$, then the CG method will converge to a solution $x^{*}= A^{-1}b$ in at ...
1
vote
0
answers
34
views
Generate numerically stable equation automatically
I remember there is a software (and its website interface) that can generate numerically stable equation from an expression automatically.
To see the problem it tries to solve, let’s take a look at a ...
2
votes
1
answer
143
views
Why is my Runge-Kutta 4 solution to the 1-D advection equation decaying so quickly?
I am trying to numerically solve the advection equation $y_t + y_x = 0$ using a the "classical" Runge-Kutta 4 explicit timestepping method, along with a left-hand finite difference ...
0
votes
1
answer
43
views
Numerical Error source when dealing with integer series
I am currently trying to compute the value of the first Fibonacci number recursively. the idea is as follow:
Compute $f_{n}$ and $f_{n-1}$ for $n = 2,...,100$,
Compute $f_k$ for $k = n−2, n−3, \dots, ...
0
votes
0
answers
81
views
Weighted Jacobi Not Working on 1D Poisson (Issue with Optimal $\omega$)
I've been trying to learn some numerical linear algebra, and I decided to try to implement the weighted Jacobi method to the 1D Poisson problem $$-u''(x)=f(x),\qquad u(0)=a,\ u(1)=b,$$ where we ...
1
vote
0
answers
56
views
robust numerical calculation with large (almost) offsetting terms
I am attempting to evaluate an expression that defines a probability of a particular event. With 3 different events, I can (under some statistical assumptions) characterize the probability of event 1 (...
4
votes
1
answer
192
views
Stochastic SIR using SDEint python package
I want to use the SDEint package to give a numerical solution (plot) of the following stochastic SIR model. Namely, a system of SDEs.
$$\begin{cases}
dS = -\beta SIdt - \sigma SIdW \\
dI = (\beta SI -...
0
votes
1
answer
50
views
What does it mean for a finite difference method to be conditionally stable? Specifically when solving the diffusion equation
The diffusion equation is
∂u/∂t =∂^2u/∂x^2.
Consider using an explicit finite difference method to solve it. What does it mean for that explicit finite difference method to be conditionally stable?
5
votes
1
answer
89
views
Are Python/MATLAB/Mathematica numerical eigenvectors affected by eigenvalue degeneracies outside region of calculation?
I have a discretized 2D mesh over which I calculate eigenvalues and eigenvectors of some
Hermitian 2 x 2 matrix at each point along a closed loop parameterized by parameter t. The eigenvectors are ...
3
votes
1
answer
170
views
Solving Kepler's Equation with Newton-Raphson Method
Note (2022/03/07): This question is solved. Unfortunately, I'm not able to accept the correct answer by Lutz Lehmann, because I screwed up my registration and the account which posted this question is ...
2
votes
0
answers
44
views
Rosenthal equation for multi track
Rosenthal's equation lets one calculate the temperature profile of a moving point heat source analytically for thin and thick plates. For simplicity I use the equation for thick plates defined as:
$$T-...
10
votes
2
answers
856
views
Why is RK45 used as the "default" method for non-stiff ODEs rather than a multistep one?
From what I read, the "default" go-to method for non-stiff ODEs is the Dormand-Prince Runge-Kutta pair; for instance, in Matlab docs, "Most of the time, ...
2
votes
1
answer
56
views
Algorithm to numerically determine whether my computed solution for a 1st order ODE is stable/unstable?
We were given an assignment where we had to determine the numerical solution of Dahlquist's equation $\dot x$ = $\lambda x$, ($\lambda$ = $-7$) for time steps ${0.5,0.25,0.125}$ using explicit euler ...
0
votes
0
answers
72
views
Solving an apparently tricky geodesic BVP in Matlab
I want to be able to solve the BVP
$$\ddot \mu_k = -\frac{\mu_k}{2} \left ( \sum_{i=1}^n \frac{\dot \mu_i^2}{\mu_i} - \frac{\dot \mu_k^2}{\mu_k^2} + \frac{ \left [ \sum_{i=1}^n \dot \mu_i \right ]^2}{\...
0
votes
1
answer
142
views
Best method to solve this system of PDEs?
I have a system of PDEs constituting an initial value problem (IVP) consisting of three coupled PDEs:
\begin{align}
\partial_t \rho + \partial_x(\rho v) &= \left(k_A (1-\phi) + k_B \phi \right)...
4
votes
0
answers
50
views
How to troubleshoot numerical instability using finite difference for steady-state non-linear heat conduction equation
I have a problem which I believe is numerical instability when trying to solve a heat conduction equation using finite difference. The short version is that when the parameter $I=80.3$ I get the blue ...
7
votes
0
answers
87
views
How do we approximate the numerical error a numerical scheme (e.g Runge Kutta, Euler etc) makes without having access to an analytical solution?
So I recently encountered this question in my head while taking my Scientific Computing class, where the lecturer talked about computing numerical error of a scheme.
My guess would be that we take a ...
0
votes
0
answers
59
views
Contact analysis does not converge due to the projection falls outside valid domain
I implemented Node-To-Surface contact algorithm (Wriggers, Peter, Computational contact mechanics., Berlin: Springer (ISBN 3-540-32608-1/hbk). xii, 518 p. (2006). ZBL1104.74002.). The code is done by ...
0
votes
0
answers
33
views
Gridline cutouts after FFT and iFFT on Python
EDIT: I think I messed up on the coordinates of $(p,q)$. Num was missing a multiple of $2\pi/N$. Assuming my interpretation of DFT isn't wrong.
I am currently using FFT to run Fresnel Diffraction as ...
1
vote
0
answers
41
views
Anyway to escape ODEintWarning (scipy)?
I am trying to fit a differential equation to some data and obtain the parameters of the underlying model. This requires me to try out various parameter values, but this often gives me an ...
1
vote
0
answers
52
views
How do people deal with resized grid steps while numerically integrating using discrete Fourier Transform?
I am trying to simulate light propagation on python using FFT following the Fresnel diffraction equation given on Wikipedia:
The problem with this is that the output matrix from the DFT would be ...
0
votes
0
answers
46
views
State change of input-output system
Edited
Given a computer model $F:\mathbb{R}^3 \to \mathbb{R}$, with inputs $x, w$ and $z$, and output $y=F(x,w,z)$, where for any input, we are able to evaluate the output, my goal is to tune the ...
2
votes
1
answer
128
views
Importance Sampling for multidimensional integrals and random numbers from multivariable pdf's
I am aiming to get a numerical value for a five-dimensional integral using Monte Carlo Integration. I am getting good results using the Mean Value Method, but I would like to try to use Importance ...
0
votes
0
answers
69
views
Numerical Partial Differentiation Check
In my computer vision course, we are working on extracting a 3D surface from a chain of 2D images taken under several conditions. This procedure is known as Photometric stereo. Prior to extracting the ...
6
votes
0
answers
87
views
What is the best method to do a MC Integration of a multidimensional integral where the integration limits depend upon other variables?
What is the best method to do a Monte Carlo Integration of a multidimensional integral where the integration limits depend upon other variables?
I am interested in getting a numerical value of a 5 ...
2
votes
1
answer
250
views
Difference between asymptotic and non-asymptotic convergence in optimization?
I am reading some optimization methods and I am facing some issues with two terms "asymptotic and non-asymptotic convergence". What is the difference between them?
2
votes
1
answer
85
views
Implicit integrator for ODE with quadratic right-hand side
I have an ODE for an unknown $x(t):[0,\infty)\to\mathbb R^n$ of the following form:
$$
x_i'(t)=a_i^\top x(t) + x(t)^\top Q_i x(t),
$$
for $i\in\{1,\ldots,n\}$. Here, the vectors $a_i\in\mathbb R^n$ ...
5
votes
0
answers
84
views
Is this a legit way to sample a random matrix spectrum?
In order to undergird a theoretical model concerning many body physics, I want to have exponentially large eigenvalue spectra from the random matrix GOE ensemble. its properties are mainly
(i) a ...
1
vote
0
answers
116
views
Fast evaluation of trigonometric polynomials
Suppose you have a trigonometric polynomial of the form
\begin{equation*}
x(t) = \sum_{k = 0}^N a_k \cos(2 \pi k f_0 t).
\end{equation*}
Using Clenshaw algorithm, one can evaluate this polynomial in $...
2
votes
0
answers
112
views
Floquet theory for periodic delay differential equations: current numerical routines
I would like to determine the stability of a system of periodic delay differential equations (a seasonal host-parasite model). I've tried to implement the method described in Lemma 2.5 in this paper:
...