Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
36 views

Understanding this code to truncate the SVD

In Brunton's and Kutz's data-driven science and engineering book, page $19$, is a description of one way to truncate the SVD of a given matrix I want to understand what the code for the variable <...
KZ-Spectra's user avatar
0 votes
1 answer
39 views

Estimating the rate of convergence of Projected Gradient Descent on constrained polynomial objectives

I am estimating the order of convergence of Projected Gradient Descent (GD) on quadratic polynomials with random coefficients independently drawn from Uniform(-1,1) and bounded by a unit hypercube. I'...
ufghd34's user avatar
  • 23
3 votes
0 answers
118 views

Quantifying the inefficiency of Gauss–Hermite quadrature

I am trying to understand the following part of the paper https://doi.org/10.1137/20M1389522 where the author argues about the inefficiency of Gauss-Hermite quadrature. I think I get the gist of the ...
Loik's user avatar
  • 31
0 votes
0 answers
36 views

Solving for expectation using iteration in a implicit function

For a implicit function $V(k,l)$, taking $l$ as given and $k$ to be the only variable, $k$ is sampling from an unknown distribution and $\mathbb{E}k = \bar{K}$. Using Taylor expansion on $V(k,l)$ ...
Zuba Tupaki's user avatar
0 votes
0 answers
40 views

Advanced computing on FPGA

I am an absolute beginner in the FPGA topic (so far I have only implemented a couple of simple logic gates in Verilog and simulated them in ModelSim). I studied digital electronics, logic elements, ...
ayr's user avatar
  • 131
1 vote
0 answers
33 views

Imposing higher order finite difference schemes for boundary value problems on a finite interval

I have some questions. I'm going to assume everything is in 1d with a Laplacian operator. If I discretize the Laplacian operator using $p = 2a+1$ grid points with periodic boundary conditions, I ...
Cuhrazatee's user avatar
0 votes
0 answers
57 views

On Newton-Raphson Method for Single Degree of Freedom Systems

I am trying to understand the geometric interpretation of the Newton-Raphson method as used in nonlinear structural mechanics. The fundamental governing equation of nonlinear structural mechanics is ...
frustrated_engineer's user avatar
0 votes
0 answers
49 views

How to solve the heat equation using the spectral method (Chebyshev's differentiation matrix), with constant flux boundary condition on both sides?

I am trying to solve a 1d heat equation with a constant flux boundary condition on the right-hand side and a zero flux boundary condition on the left-hand side. I've gained a lot of insight from ...
Kazusa's user avatar
  • 1
1 vote
1 answer
117 views

On the calculation of the first m generalized eigenvectors

This is a classic generalized eigenvalue/eigenvector problem: $$ A\,\vec{x}=\lambda\,B\,\vec{x} $$ which, however, is characterized by: $A,B$ are real, symmetric and positive definite matrices of ...
Monster's user avatar
  • 113
5 votes
2 answers
156 views

Optimized Lanczos method for finding eigenvalues of $A \otimes B$

Recently my supervisor told me about an efficient way to calculate eigenvalues and eigenvectors of matrix $A \otimes B$ with $a_{1} \times a_{2}$ as dimensions of $A$ and $b_{1} \times b_{2}$ is of $B$...
Mohammad. Reza. Moghtader's user avatar
4 votes
3 answers
642 views

Analysis of convergence of Newton method

I often used the Newton-Raphson method in material calculation, where I had to solve a small set of nonlinear equations (size=1..5). In most cases, it worked. However, convergence failure is often ...
kstn's user avatar
  • 289
1 vote
0 answers
96 views

Implicit-Explicit Operator Splitting Scheme

I am trying to solve the 2D advection-diffusion equation in cylindrical coordinates: $$ \frac{\partial c}{\partial t} = D\left(\frac{\partial^2 c}{\partial r^2} + \frac{1}{r}\frac{\partial c}{\partial ...
mht's user avatar
  • 11
6 votes
2 answers
376 views

Order of numerical solver when calculating difference between forwards and backwards solution

I'm working in applied oceanography, where people are sometimes interested in calculating ``backwards trajectories'' of things floating on the ocean, i.e., going backwards in time to figure out where ...
Tor's user avatar
  • 243
1 vote
0 answers
120 views

Iterative PDE solver for 1D Burgers equation

I am looking for an Iterative Numerical PDE solver for 1D Burgers equation. I need to have access to the intermediate solutions of the Numerical Solver. By iterative methods, I mean techniques which ...
rajoy99's user avatar
  • 11
1 vote
2 answers
124 views

Monotonicity of Errors with Respect to Step Sizes in Numerical Methods for PDEs

Consider a non-linear partial differential equation (PDE) (e.g., Burgers' equation) that is solved numerically using a finite difference method (or a similar approach). Suppose a grid search is ...
user572780's user avatar
1 vote
0 answers
39 views

Using of elastic tangent for structural nonlinear solver

I noticed that some finite element programs, such as Plaxis, do not require the constitutive law to return the consistent tangent, but elastic tangent seems to be sufficient. In my experience, using ...
kstn's user avatar
  • 289
0 votes
0 answers
51 views

Calculating a 2D Ewald sum for a multipolar expansion

I am attempting to calculate the potential of a particle at the center of an infinite two-dimensional lattice as per the following reference: Reference: Lambin, PH & Senet, P. Ewald Summation of ...
JasonC's user avatar
  • 43
6 votes
2 answers
973 views

Implementation of Monte-Carlo Integration

After reading the Wikipedia page for Monte-Carlo integration, I have understood the basic idea but I am having trouble implementing it for a general case. The integration that I am trying to do is $$ \...
Michael's user avatar
  • 71
2 votes
1 answer
122 views

Different Results for Double Pendulum

In this study, (Hidden Fractals in the Dynamics of the Compound Double Pendulum) the authors provide various fliptime fractals (of a double pendulum) for different length combinations. However, when I ...
MaximeJaccon's user avatar
2 votes
1 answer
82 views

Computing the Fiedler vector of a large, sparse graph

I have a sparse, undirected and unweighted graph $G$ of size $n$, with $n$ on the order of say several million. I would like to compute the Fiedler vector $f$ of $G$, which is the eigenvector ...
Set's user avatar
  • 503
0 votes
0 answers
24 views

Help in solving Quintessential scalar field using Steep Potential in cosmology

I am attempting to solve the differential equation $\ddot\phi + 3H\dot\phi + \dfrac{dV}{d\phi} = 0.$ For $V(\phi) = V_{0}e^{-\lambda\phi}$, where $V_{0} = 0.7$, $\lambda = 0.1$ and $V'(\phi) = \dfrac{...
user avatar
2 votes
1 answer
101 views

From Runge-Kutta Butcher tableau to general linear methods matrices?

I am trying to understand how the relationship between Butcher tables for Runge-Kutta methods and their generalization to general linear methods matrices (by Butcher also). Runge-Kutta methods can be ...
Vincent's user avatar
  • 343
0 votes
0 answers
53 views

Prof A. Stanoyevitch's finite difference based PDE matlab code

Where can one find Prof A. Stanoyevitch's finite difference based PDE matlab code? They have a book on such a topic but can't find the accompanying code. Is it well received? It's not commonly talked ...
feynman's user avatar
  • 317
0 votes
0 answers
75 views

Best transform of matrix to make it efficient for shift-then-invert?

I am using ARPACK to find the smallest eigenvalue of a matrix. I use the shift and invert method. That is, looking for the largest eigenvalue of $$ (A-\sigma I)^{-1}. $$ However, I do not know $\sigma$...
Ma Joad's user avatar
  • 161
1 vote
0 answers
73 views

Stability of 4-bit matrix multiplication

To use newer accelerators like this, I need to perform matmul in 4-bit precision. How do I tell whether this operation is stable? Wondering if there well common heuristics in terms of properties of ...
Yaroslav Bulatov's user avatar
4 votes
0 answers
192 views

Why for $A^T A$, it is faster to computer the eigenvalues of its inverse than itself?

I have written the following code in MATLAB. I also observe the same effect in Arnoldi iteration in ARPACK in C. ...
Ma Joad's user avatar
  • 161
1 vote
0 answers
85 views

Ways to speed up Lanczos algorithm when we have a very dense cluster of many eigenvalues?

Lanczos algorithm can be used to find the largest/smallest eigenvalues of matrices. I am trying to find a good library in C/C++/Rust for finding the smallest singular value (or eigenvalue). I have ...
Ma Joad's user avatar
  • 161
0 votes
1 answer
95 views

Prof Lawrence Shampine's hpde matlab code

Where can one find Prof Lawrence Shampine's hpde matlab code? Is it well received? It's not commonly talked about.
feynman's user avatar
  • 317
20 votes
9 answers
4k views

C, Julia, Python, Maxima, Mathematica, ChatGPT and numerical errors

I am completely stunned how numerical errors can diverge for so innocent programs. In Python 3.11.7 the program ...
Smilia's user avatar
  • 478
3 votes
1 answer
277 views

How to evaluate the points near/at the boundary when using Richardson extrapolation for improved accuracy of a derivative

If we want to improve the accuracy of our numerical estimation of a derivative, we can use Richardson extrapolation. The method is very beneficial when using a centered difference scheme and the ...
FriendlyNeighborhoodEngineer's user avatar
2 votes
2 answers
112 views

Gradient descent for solving polynomial equations while encouraging variables to be nonzero

I would like to use gradient descent to "randomly sample" solutions to a set of homogeneous polynomial equations. Because the equations are homogeneous, setting all variables to 0 is a valid ...
PPenguin's user avatar
  • 123
1 vote
1 answer
108 views

How can you calculate catastrophic cancellation error?

I'm trying to follow the wikipedia page about catastrophic cancellation but I've hit something that just doesn't make sense to me. They say that subtraction can amplify existing approximation errors (...
profPlum's user avatar
  • 149
0 votes
1 answer
74 views

Why using large bound to supplement inifinity in interior point method can be bad

Here in the documentation of mosek (https://docs.mosek.com/latest/pythonfusion/debugging-numerical.html) we see: Never use a very large number as replacement for infinity . Instead define the ...
Taylor Fang's user avatar
0 votes
0 answers
47 views

2nd-order backward difference approximation for temporal terms of Euler–Bernoulli beam

I am trying to solve the Euler–Bernoulli beam numerically in structural dynamics analysis: $$\frac{\partial^2w(x,t)}{\partial t^2}= \frac {q(x,t)}{\mu(x)}-\frac {1}{\mu(x)}\frac {\partial^2}{\partial ...
Chaozhi Qiu's user avatar
1 vote
1 answer
139 views

Best finite difference scheme in 2D for the mixed derivative

The are good methods to deduce finite difference schemes for derivatives of functions of one variable. But how to get a good one for the mixed derivative of a function of two variables $u=u(x,y)$, ...
Bogdan's user avatar
  • 113
0 votes
0 answers
36 views

Numerical Divergence of a Tensor Field in Spherical Coordinates

I want to calculate the divergence of a rank-2 tensor field $$\nabla \cdot T$$ defined on the surface of a sphere in spherical coordinates. As an example, let the field be given as follows : ...
haricash's user avatar
0 votes
1 answer
86 views

shooting method to compute the interface shape

I am trying to use a shooting method to compute the shape of liquid-gas interface given by the following differential equation: $$ \frac{d^2 \theta}{ds^2} = \frac{f(\theta)}{h(h + 3\lambda)} $$ with $\...
Sthavishtha Bhopalam's user avatar
-1 votes
1 answer
107 views

What is the name of the theory that combines 3d discretized surfaces and distributed numerical algebra

I've looked into distributed numerical computation work before, but I've realized that 3D applications are all about 3d surfaces and meshes.So I'd like to look into related work on mesh and parallel ...
Haitao Xiao's user avatar
0 votes
0 answers
34 views

Order of Error - Confusion: Clarifying Constraints on Constants and Determining Order of Error

I'm struggling to determine the order of error when considering the error value denoted by $\text{err}$ in relation to the variable $h$. Specifically, I aim to ascertain the value of $x$ in the ...
Ferran Gonzalez's user avatar
1 vote
0 answers
58 views

Finite volume method for a general flux

How to approximate flux 𝐹(𝑢)⋅𝑛 where 𝑛 denotes the unit normal outward when using finite volumes? in my case it's not a conservation law so my question is how can we approximate the final term \...
Chems Eddine's user avatar
2 votes
0 answers
57 views

Why the following discrete inequality are equal?

When reviewing papers on the numerical solutions of Partial Differential Equations (PDEs), I observed the following equation: $$ (1-C\tau)||\theta^n||^2 \leq ||\theta^{n-1}||^2 + C\tau (h^{2r+2}), $$ ...
Owen Jun's user avatar
  • 141
13 votes
8 answers
3k views

Real-world applications of eigendecomposition?

Cross-posted on Math.SE Are there real-world applications that call specifically for eigenvalues rather than singular values? I often see eigendecomposition used as "poor-man's SVD" For ...
Yaroslav Bulatov's user avatar
1 vote
1 answer
174 views

How to approximate the flux when using finite volumes?

How to approximate flux $F(u)\cdot n$ where $n$ denotes the unit normal outward when using finite volumes? $$\int_{\sigma} F(u) \cdot \boldsymbol{n}_{K, \sigma} \mathrm{d} \gamma(x)$$
Chems Eddine's user avatar
0 votes
0 answers
39 views

Convergence of Modified Crank-Nicolson Scheme

I'm dealing with a particular reaction-diffusion equation having the form $$ c_t = \alpha \nabla^2 c + F(c,x,t). \tag{1}$$ where $F$ is nonlinear. I would like to solve (1) with a finite-difference ...
zaccandels's user avatar
0 votes
0 answers
110 views

Solving a steady-state PDE

I'm working on trying to solve a steady state PDE in python and I am quite new to python and I am slightly confused on the implementation details. I have an example implementation of solving a non-...
blov's user avatar
  • 43
4 votes
1 answer
148 views

Burger's equation (PDE) does not work with downwind difference?

I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work when using a step-function and downwind difference formula. When using a step-function and ...
blov's user avatar
  • 43
0 votes
1 answer
99 views

How to use a custom OdeSolver in Scipy's solve_ivp

In Scipy's solve_ivp documentation, we see the method argument can be either a string or a user-defined ...
Axel Wang's user avatar
  • 197
3 votes
1 answer
280 views

Finite difference problem

I have a problem to resolve with the Finite Difference method in $[a,b]$: $$-\frac{d}{dx}(\alpha(x)\frac{du}{dx})= g(x),$$ with $\alpha(x) \in L^{\infty}$ continuous in $]a,c[$ and $]c,b[$ and ...
Kaneki Ken's user avatar
3 votes
0 answers
159 views

Numerical integration in Fourier space over 3D grid

I am attempting to implement a model outlined in this paper: General magnetostatic shape–shape interactions Background This model allows the calculation of magnetostatic interaction energies between ...
JasonC's user avatar
  • 43
0 votes
1 answer
68 views

Local truncation error of given implicit 1-step scheme

I'm given the 1-step implicit scheme $$y_{n+1} = y_n + \frac{h}{6}[4f(t_n, y_n) + 2f(t_{n+1}, y_{n+1}) + hf'(t_n, y_n)],$$ where $y'(t) = f(t, y)$, and I'm seeking the scheme's local truncation error. ...
jackyooo's user avatar

1
2 3 4 5
13