All Questions
11,503
questions
0
votes
0
answers
6
views
Projecting the initial state on a Discontinuous Galerkin basis
Context
I want to solve a 1D Burgers equation with a discontinuous Galerkin approach. I want to project the function $u(x) = e^{-\frac{(x-0.5)^2}{0.02}}$ over basis functions. The choosen basis are ...
4
votes
2
answers
355
views
Solving a generalised eigenvalue problem with non-square matrices
I need to solve a generalised eigenvalue problem of the form
$$A\mathbf{x}=\lambda B \mathbf{x}$$
where $A$ and $B$ are $m \times n$ complex matrices, that are not symmetric with $m>n$.
I am aware ...
2
votes
1
answer
520
views
Overflows and underflows in Python
I’m writing some Python code using NumPy. Since I got an overflow warning, I decided to check for underflows as well at all places in the code, using ...
0
votes
0
answers
17
views
Why does Energy -> temperature conversion failed to converge in my OpenFOAM simulation [closed]
How can I resolve this issue?
I want some help in resolving it. Thanks.
0
votes
1
answer
56
views
How to properly use ARPACK's dsaupd and dseupd?
In Rust, I am trying to solve an eigendecomposition problem through ARPACK. I made the following subroutine for this purpose:
...
0
votes
0
answers
21
views
formula for the elliptical orbit of the magnetic field in a current carrying circular loop [closed]
In a circular current carrying loop the magnetic field lines form elliptical orbits if I have constant value for current and a point let's say at r distance from the center of th current carrying loop ...
0
votes
0
answers
79
views
Guidelines for finding a preconditioner for a matrix that is "near" singular
Given a large non-symmetric non-sparse matrix $A=(a_{m,n})$ with the property that the columns of $A$ are "close", making the matrix very ill-conditioned and near singular. For example, ...
-1
votes
1
answer
67
views
optimal gradient algorithm to determine best $α_k$
Let's consider an optimal-step gradient algorithm and assume that:
$g(α) := f(X_k - α∇f(X_k)) = 2α^2-4α+17$, how can we determine the optimal $α_k$?
Here is my simple solution:
$g(α) = 2α^2-4α+17$
$g'(...
0
votes
1
answer
43
views
step-fixed algorithm first iterates
let us have the fixed-step gradient algorithm, with $p = 2$ and we assume that for $X = (x, y)$,
$∇ f(X) = \begin{pmatrix}
x -1\\
y -2
\end{pmatrix}$
Let me assume we intialize with $X_0 = (0,0)$ what ...
0
votes
1
answer
65
views
step-fixed algorithm to minimize f, which step to ensure convergence?
If we want to apply the fixed-step gradient algorithm to the minimization of $f(x) = \frac{1}{2}(Ax, x)$ where $A$ is a symmetric 2x2 matrix with eigenvalues $\lambda_1 > \lambda_2 > 0$, for ...
1
vote
1
answer
57
views
What are some good medium matrices with known eigenvectors?
I am trying to test if an eigendecomposition I have is working properly. For this I would like some matrices that are 10x10 (ish) with trivial (or known) eigenvectors and eigenvalues so that I can ...
0
votes
0
answers
40
views
conjugate method for minimization of quadratic equations of dim n, upper bound for iterations is n?
Is it true that in the worst case, the conjugate gradient algorithm needs 20 or 21 iterations to converge for the minimization of a quadratic equation of dimension 20? Let's suppose it won't find the ...
0
votes
0
answers
42
views
What techniques are there to take averages and errors in a Monte Carlo simulation in C? Can my code be improved?
I'm trying to perform a Monte Carlo simulation in C and these are the steps I'm following:
We assume an infinite reservoir compound of CO and NO molecules with partial pressures 𝑦CO and 𝑦NO(= 1 − 𝑦...
0
votes
0
answers
33
views
Problems with High-Performance Computing and Stack Exchange Data Explorer. Any Advice? [closed]
I'm currently experiencing some challenges with my high-performance computing setup and a Stack Exchange product. As someone relatively new to managing both hardware and software in this capacity, I ...
2
votes
1
answer
66
views
When does linear system have linearly growing singular values?
Suppose $W$ is a large matrix where $i$th smallest singular value grows as $O(i)$. What kind of matrix can $W$ be?
For instance, this appears to hold for random matrix with IID entries and for lower-...
0
votes
0
answers
44
views
Solve beam equation with elastic term using scipy solve_bvp
I want to solve the beam equation with distributed load and elatic term (which depends on how much the beam interact with the terrain) :
$$
EI\frac{d^4w}{dx^4}+k*(w(x)-t(x))=q(x)
$$
where $q(x)$ is a ...
1
vote
0
answers
35
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 <...
2
votes
2
answers
164
views
(Isoparametric) Mapping of physical coordinates to their equivalent parametric coordinates on a reference element
I have some experiece with finite element methods (FEM), in general. However, I mainly worked with Cartesian grids -- i.e. using orthogonal (non-curved) elements.
Recently, I became interested in a ...
0
votes
0
answers
46
views
1D FDTD simulation of plane wave propagation and the Courant stability condition
I'm currently trying to simulate a simple case of wave propagation in free space before adding in more complexities, and already I'm stumped. I understand the Courant stability condition. However, I ...
2
votes
1
answer
52
views
Good references for the P3/P1dc element
I am struggling to find some good references for the P3/P1dc element (cubic element for velocity and linear piecewise discontinuous for pressure) for the Stokes/Navier-Stokes equations.
Is there a ...
0
votes
2
answers
80
views
Source for scalability challenge for number of finite element nodes per process
Context
In distributed simulation of a finite element mesh with $N$ nodes and $P$ processes, a professor stated to me that "achieving good scaling for more than 25,000 finite element nodes per ...
0
votes
0
answers
33
views
Fastest way to calculate the eigenvector with the largest eigenvalue for a 3*3 positive-definite matrix [duplicate]
As stated in the title: I have a 3 by 3 positive-definite matrix $M$. What I need is the eigenvector corresponding to the largest eigenvalue, since I am calculating the solution to maximize the value ...
0
votes
1
answer
38
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'...
3
votes
0
answers
47
views
Datasets for inverse heat transfer problems
I was wondering if there is an available, real-life known inverse heat transfer problem dataset to benchmark oneselfs algorithm, as in MNIST for deep learning. Talking about... (well in this case I ...
1
vote
1
answer
50
views
Solving TOV equations that describes neutron stars in modified f(R, T) gravity
Sorry for the long post, tldr at bottom.
I'm trying to use standard RK4 code in C/C++ to solve a coupled system of 2 modified TOV equations in f(R,T) gravity and reproduce some of the results of this ...
3
votes
2
answers
156
views
Finding ALL Eingenvalues of a Sparse Integer Matrix
I would like to find ALL Eingenvalues of a huge, very sparse integer matrix. This matrix has a lot of known properties, e.g. that it is symmetric and nearly tridiagonal, with very few (max. ca. 4 per ...
0
votes
0
answers
59
views
How to correctly discretize volume elements in different geometries?
I am solving a reaction-diffusion problem in one dimension for a catalyst particle to get the internal effectiveness factor ($\eta$),as given below:
$$ \eta = \frac{\int_0^{V_p}{R_i\ dV}}{R_i^{surf}\...
0
votes
0
answers
43
views
Rule-Based Link Prediction for Social Network [migrated]
Relevance to Site
I believe this question is suitable for the Computational Sciences Stack Exchange site as it pertains to the implementation of a graph algorithm. According to this widely accepted ...
5
votes
1
answer
344
views
Time integration of first-order ODE with higher-order information
Suppose I wish to derive a numerical integrator for the first-order ODE $$x'(t)=F(x(t)).$$ By differentiating both sides of the expression in $t$, I can write a second-order relation also satisfied ...
9
votes
0
answers
168
views
What's the most computationally efficient implementation of Kalman Filter
I know there are many formulations of the Kalman Filter. A few I can name are:
Classical Covariance Form
Informational Filter Form
Square-Root Form or Factor Form
But somehow it's hard for me to ...
2
votes
1
answer
158
views
How to add damped constraint force to constrained dynamics simulation?
I have implemented a constraint dynamics physics simulation as proposed by Andrew Witkin et al 1990, but I cannot get the initial constraint "snapping" correctly.
I implemented
$$ JWJ^{T} \...
1
vote
1
answer
130
views
Coupled Partial Differential Equations
I'm trying to solve the following system of coupled differential equations, the two-temperature model for $e$ = electrons and $l$ = lattice.
$$
\rho_{e}C_{p,e}\frac{\partial T_{e}}{\partial t} = k_{e}\...
0
votes
1
answer
81
views
optimize this python code that involves matrix inversion
So I have this line of code that involves a matrix inversion
X = A @ B @ np.linalg.pinv(S)
$A$ is an $n$ by $n$ matrix, $B$ is an $n$ by $m$ matrix and $S$ is an $...
0
votes
1
answer
77
views
GMRES implementation does not converge for singular Hermitian problems
I've just implemented the GMRES algorithm based on chapter 4 of Fundamentals of Numerical Mathematics for Physicists and Engineers using the problems in Numerical Analysis by Timothy Sauer for ...
1
vote
0
answers
11
views
Guidelines for image detection model for statis sample
I have 20,000 plus images of art (paintings, sculptures, jars, etc). My goal is creating a computer vision model that, from an input (image), identifies the exact same piece of art and returns its id, ...
0
votes
0
answers
69
views
How can I get more accurate electric scalar potential in 2D closed box?
I am trying to use poisson equation to plot the electric scalar potential in close 2D space. The details in in this video
and this one
The following in written in Matlab for quick prototype.
...
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 ...
2
votes
1
answer
278
views
Asking advice for implementation of Conservative Finite Difference Scheme for numerically solving Gross-Pitaevskii equation
I am trying to numerically solve the Gross-Pitaevskii equation for an impurity coupled with a one-dimensional weakly-interacting bosonic bath, given by (in dimensionless units):
\begin{align}
i \frac{\...
0
votes
0
answers
38
views
Split RAM asked between nodes and different partitions
I'm using a Slurm-based HPC at my university to run memory-intensive software. I need to know if it's possible to distribute the required RAM across multiple nodes and partitions. My lab has exclusive ...
1
vote
1
answer
204
views
Boundary Conditions on the Inlet and Outlet in a Discontinuous Galerkin framework
In the book Discontinuous Galerkin Method (DGM), Analysis and Applications to Compressible Flow by Vít Dolejší and Miloslav Feistauer, Springer, it is mentionned, in section 8.3.2 that deals with ...
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)$ ...
4
votes
1
answer
102
views
How can I efficiently find an anti-symmetric generator of a special orthogonal matrix?
Given a special orthogonal matrix $O$ (i.e: $OO^T = 1$ and $\det(O) = 1$), I am trying to efficiently find a matrix $X$ such that $O = e^X$ and $X = -X^T$ using Python (NumPy & SciPy).
One obvious ...
1
vote
0
answers
74
views
Eigenvalue Problem with Pseudospectral Chebyshev Polynomials
I am solving a linear 4th Order Eigenvalue ODE (Euler-Bernoulli Beam):
$$
{\frac{d^{4}w}{dx^{4}}} = - \alpha {\frac{d^{2}w}{dx^{2}}}
$$
The method I used was to apply a truncated spectral expansion ($...
0
votes
0
answers
56
views
What is the best finite volume method for the following equation?
I'm trying to create a partial differential equation that approximates 1-D climate in a rocky planet's atmosphere, which accounts for energy transport via radiation and convection. I am only ...
1
vote
1
answer
89
views
How to run scipy.optimize.minimize with L-BFGS-B for maxiter (completely)
I want to run the below code for maxiter = 20001. I don't want it to stop by some default criteria.
...
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, ...
0
votes
0
answers
40
views
How can I calculate ROC50 in python?
I need to calculate ROC50 for a classifier in python. The ROC50 value is defined as the AUC when the 50th true negative is found. I have tried setting the max fpr value for roc_auc_score in sklearn to ...
1
vote
0
answers
42
views
How can I apply a mixed boundary condition to a multi-material heat transfer problem using Crank-Nicolson?
I am working on a mixed material model for a melting material and need to enforce both a Dirichlet and Neumann type condition at the interface. Subject to an external surface heat flux at the top of ...
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 ...
0
votes
1
answer
106
views
Is the NLP formalism sub-optimal for real-world problems
My home-brew optimization studies have raised yet another fundamental question. The Nonlinear Programming formalism, "minimize f(x) subject to inequality and equality constraints, and x ...