All Questions

Filter by
Sorted by
Tagged with
10
votes
1answer
1k views

How to compute Singular value decomposition of a large matrix with Python

Language: Python3 Problem: I have a matrix Q of shape [51200 rows x 51200 cols] stored in a binary file, each of the element in this matrix has a data type of complex64. To load the data into memory I ...
2
votes
1answer
55 views

Why Is This Python Code Faster Than Fortran Wrapper with F2PY?

I am writing a proof-of-concept implementation of Newton's method for minimizing the negative log-likelihood term in a logistic regression model. I'm comparing the performance of a native python ...
0
votes
0answers
5 views

Dealing with Extra Categories in Test Set

Suppose I have a data set which consists a dependent variable y and independent variables X. Suppose that there is a specific ...
3
votes
0answers
39 views

Solving for a single element of a solution of a linear system

I wish to solve a linear system $A x =b$ in which $A$ is dense but not too large, say no larger than $10\times10$. However, I am not interested in the full solution vector $x = [x_0, x_1, \dots]$, ...
2
votes
0answers
27 views

Multigrid method: linear solver and modified residual

I am trying to better understand the FAS multigrid algorithm for Euler equation in FV discretization. The usage of the modified residual (the residual with forcing) inside the different cases: ...
3
votes
0answers
71 views

Stable iterative solver for complex symmetric linear systems

I am interested in the iterative solution (preferably Krylov-type solvers) of a problem Ax=b, with x, b ∈ ℂn x 1 and A ∈ ℂn x n. A is symmetric, invertible, and its real and imaginary parts are ...
3
votes
1answer
398 views

Poisson image blending artifacts

I am trying to implement Poisson image blending as in the paper Poisson Image Editing. This is the task of filling in a masked region of an image by minimizing $$\min_f\int_\Omega \left | \nabla f - \...
0
votes
0answers
14 views

Resampling an array of objects

Context I have an array of objects (or a list of dictionaries), sorted in order based on a property of each object, say, time. In JSON, it would look something ...
1
vote
1answer
59 views

Accelerated Inverse Power Method with Rayleigh Quotient

I am considering implementing the accelerated inverse power (AIP) method with Rayleigh quotient to speed up eigendecomposition of a real square symmetric matrix. Halton (1996) gives an example ...
3
votes
1answer
148 views

How to find a pair of divisors as close as possible to each other?

For a given integer $n\in\mathbb{N}^*$, I want to find a pair $(x,y)\in{\mathbb{N}^*}^2$ such that $x*y=n$ and $|y-x|$ is as small as possible. A naive algorithm I found is : ...
1
vote
1answer
44 views

Verification of coupled system of equations for light propagation

I am trying to simulate the propagation of light in material using the non-linear schrödinger equation (NLSE): $$\partial_zE=\frac{i}{2k_0}\nabla^2_\perp E+\frac{ik_0n_2}{n_0}\vert E\vert^2E-0.5\beta^{...
3
votes
1answer
98 views

Choice of iterative solver for a sparse asymmetric matrix with symmetric structure

I have a sparse $nxn$ matrix A with pretty interesting structure. It has a block structure with symmetric structure but asymmetric blocks. Expressed mathematically the block $A_{jk} = A_{kj}$ but $A_{...
2
votes
0answers
33 views

Help with restart functionnality in sef-made GMRES solver in python

I am new to this forum and to computational science in general. I started to learn numerical liner algebra on my own and would like to code a GMRES solver in python (no preconditioner for the time ...
3
votes
0answers
32 views

Find $x$ that satisfy $(I-A^*A)+x(\frac{A+A^*}{2})\prec0$ using LMI or SDP on Matlab

Given $A\in\mathbb{C}^{n\times n}$, I want to use LMI or SDP to find feasibility of $x>0$ in the following inequality: $$(I-A^*A)+x(\frac{A+A^*}{2})\prec0,$$ where $D\prec0$ means that $D$ is ...
-2
votes
0answers
27 views

About Thymeleaf can't get the model value [closed]

I met a problem when I use the construction method to return the String the Thymeleaf can't get the user's value in Html. ...
-1
votes
0answers
55 views

Are GNNs effective to the task?

Recently, the application of Graph Neural Networks (GNNs) has become more and more extensive, and it has in many fields without topology,such as NLP. In several experiments, I have not got the STOA by ...
1
vote
1answer
107 views

SIPG method for $-\nabla \cdot (\nu \nabla u)=f$

Consider the diffusion equation with a coefficient $\nu$: $$-\nabla \cdot (\nu \nabla u)=f$$ with Dirichlet boundary conditions $u = g_D$ in $\partial \Omega$. If the coefficient would be constant, ...
8
votes
2answers
2k views

Markov (Chain) image generators?

Markov Chains can be used to generate, or auto-complete, text. https://en.wikipedia.org/wiki/Markov_chain#Markov_text_generators Training text is read, and some information about the text is ...
3
votes
3answers
496 views

Minimum number of elements (mesh size) for electromagnetic simulation

Does someone have a reference for the minimum number of elements (or maximum mesh size) for electromagnetic simulations where a mathematical or numerical explanation is given? I have found several ...
6
votes
1answer
325 views

Why is the central difference method dispersing my solution?

I am solving numerically the ODE $\ddot x(t)=-c\dot x(t) -\sin(x(t))+F\cdot \cos(\omega t), \;\dot x(0)=x(0)=0$ for $t\in [0,20\pi]$ on an $N=2000$ dimensional grid. I am working on Python, and I ...
2
votes
1answer
97 views

What exactly are WENO schemes and where are they used?

I am currently trying to understand what WENO schemes are and most of the literature on web talks about cell-face reconstruction. What I am unable to understand is the origin of these discontinuities ...
0
votes
1answer
95 views

Derivative of a signal $y(t)$ wrt to another signal $x(t)$

I am running a sensitivity study on the model $y(t) = x(t - \tau)$ where $y(t)$ and $x(t)$ are 2 time signals and $\tau$ a time lag. Basically I want to study the sensitivity of $y$ to a change in $x$....
1
vote
2answers
79 views

What is known about C0 triangular finite elements with nonstandard mesh point placement?

I'm curious about the general case, but for ease of explaining lets just take the case of a $P^2(\Omega)$ approximation. For simplicity, let's also just consider the reference element $(0,0), (0,1), (...
2
votes
1answer
80 views

Formulating this optimization problem

Suppose I want to minimize below objective function $\sum | g(x_i) \cdot I_{g(x_i)<0} |^2$ i.e, the latter penalty terms like $ |g(x_i)|^2 $ are only computed when $g(x_i)<0$. $|g(x_i)|^2$ are ...
2
votes
2answers
208 views

(Lack of) Availability of Finite-Difference library for simple 2D PDEs

I would like to solve two types of simple 2D problems, namely the stationary heat equation on an L shaped geometry like this: And also compute the magnetostactic field in an air gap of the following ...
3
votes
2answers
1k views

Generate random smooth 2D closed curves

I would like to know how can I generate a collection of random 2D closed smooth curves. I thought about generating a random 3D surface with random peaks, and then intersecting the Z=0 plane with it, ...
4
votes
1answer
102 views

Computing second derivatives with Neumann boundary condition

I am implementing a finite difference method for a PDE with a Neumann boundary condition. I will simplify my question to a single dimension. Suppose I have a PDE $$\frac{\partial u}{\partial t} = \...
2
votes
1answer
674 views

More Smearing with decreasing timestep in advection problems

I find it kind of counter intuitive, that the result of an advection gets more smeared out at the borders when decreasing the timestep (which should make it more accurate). Let there be a equally ...
0
votes
1answer
113 views

R function or package for carrying out maximum likelihood techniques in random effect models

I am applying optim() function in R to obtain maximum likelihood estimates of the fixed effects and random effects in a model with bivariate random effects. The ...
2
votes
1answer
33 views

Simulate circular mold spread using cellular automata - square emerges instead

I am trying to simulate the spread of mold in a petri dish using a cellular automata based approach. Thanks to the answer in my other question Stochastic cellular automata - algorithm limited by 1 ...
8
votes
1answer
323 views

Accurate and efficient computation of the inverse Langevin function

The Langevin function $\mathcal{L}(x) = \mathrm{coth}(x) - \frac{1}{x}$ occurs in computations related to elastomers and paramagnetic materials. It is easily computed accurately and with high ...
2
votes
0answers
23 views

Scheduling Algorithm Goal is to Fix Max Number of Appointments

First post. Hi everyone. I’m trying to develop an algorithm to later code that schedules appointments in a way such that the number of hours occupied by the appointments in a given day is maximized. ...
0
votes
0answers
28 views

What is the limit involving `Sum`, `Subsets`, and `RankedMax` as `t` approaches infinity?

This question is different from the last one as I have changed $d$. Now suppose have a countably infinite $A$ and $F_1,F_2,\cdot\cdot\cdot$ are an infinite sequence of finite sets (denoted $\left\{F_n\...
5
votes
0answers
71 views

Is there a way we can compute my sum involving `subsets` more efficiently?

Suppose we have a countably infinite $A$ and $F_1,F_2,\cdot\cdot\cdot$ are an infinite sequence of finite sets (denoted $\left\{F_n\right\}_{n=1}^{\infty}$) such that $\bigcup\limits_{n=1}^{\infty}F_n=...
1
vote
1answer
101 views

Area of 8-node rectangular serendipity finite element

I am trying to compute the area of an 8-node rectangular serendipity finite element from the equation $$ \sum_{i= 1}^8 det \, J(\xi,\eta) \cdot W_i $$ based on Gaussian quadrature, where $$ J(\xi,\eta)...
2
votes
2answers
118 views

How is FEM used in structural engineering?

I have learned about the finite element method (FEM) as a method for solving boundary problems given by a PDE. The way I learned it is to approximate the solution by a linear combination of test ...
3
votes
1answer
70 views

"Optimal" domain partitioning in domain decomposition algorithms

When solving a PDE numerically by domain decomposition methods, what is the "optimal way" to split the domain? Are there any results stating that a particular partition of the domain yields &...
-1
votes
1answer
65 views

How asymmetric encryption is done very fast [closed]

In any asymmetric encryption specifications, there is a step where we need to calculate data ^ public_key mod e to get ...
20
votes
6answers
6k views

How does one determine the point group of a molecule?

You've managed to finally find out how the atoms are spatially arranged on your newly-discovered molecular entity. Through, say, spectroscopic means, you are now in possession of a bunch of atom ...
3
votes
1answer
676 views

Calculation of Mean Square Displacement for Brownian dynamics system with Lennard Jones interactions in python3

I have a problem getting a sensible result for the Mean Square Displacement (MSD) for a simulation of $N$ particles under Brownian dynamics with Lennard-Jones interaction between them with or without ...
3
votes
1answer
153 views

How to include negative number in the log-sum-exp?

I want to know summation of some small numbers, such as {e^-1000, -e^1001, e^1002...} If all numbers are positive, I can use log-sum-exp algorithm. But unfortunately, negative numbers are also ...
0
votes
0answers
32 views

How can i fix this error in lammps? [migrated]

I'm working on this project where I have to simulate a gold nanoparticle impact in a gold plate, my script is: ...
2
votes
0answers
65 views

2d advection-diffusion: cell Péclet number and numerical stability

I am studying the numerical resolution of 2d advection-diffusion problems with finite element methods. $$\frac{\partial u}{\partial t} + \beta\cdot\nabla u = \nabla\cdot(\nabla u) \, .$$ It is said in ...
2
votes
2answers
70 views

Filter size of large eddy simulation with Smagorinsky sub-grid stress model

I am trying to implement Large eddy simulation for solving air flow simulation with large Reynolds number using Smagorinsky sub-grid stress model. I read that the filter size should be calculated ...
1
vote
1answer
90 views

Question about step in the proof of standard discrete trace inequality

I'm studying from Guermond lecture notes available at https://www.math.tamu.edu/~guermond/M661_FALL_2019/chap12.pdf (see Lemma 12.8( Discrete trace inequality).) Consider the simple case $p=r$, i.e. ...
1
vote
0answers
28 views

Weird behavior in for solving TISE in harmonic oscillator potential using the shooting method

I was solving the time independent Schrödinger equation using the shooting method for harmonic oscillator potential. This is the code that I wrote for that with the results (code is written in julia): ...
-1
votes
1answer
28 views

Two-dimensional ordering issue – alternate sort order ascending/descending to reduce fluctuations - trivial?

New to stackexchange, so hopefully I’m posting this in the right place. Please let me know if you think this is inappropriate. I have a solution in search of a problem that some of you could perhaps ...
-2
votes
0answers
84 views

Need a help for a mathematical formulation

I have a set of $n(n-1)/2$ numbers. I should put them in a descend order، then multiply every set by this related value: the first set has $ {(n-1) numbers} \times\ 1$; the next set has $ {(n-2) ...
9
votes
1answer
424 views

How to solve a second order differential equation (diffusion) with boundary conditions using Python

I am having trouble implementing a model from a publication. Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625 scihub link: https://sci-hub.se/10.1021/ie030109q I ...
0
votes
2answers
97 views

Problem of half-planes intersection

Consider the half-planes $\{x \leqslant 2\}$ and $\{x+y \leqslant 3\}$. These two half-planes are coded with the R package 'rcdd' as follows: ...

15 30 50 per page
1
2 3 4 5
197