All Questions

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

Time step too big in Kinetic Monte Carlo (KMC)

I'm computing some phase transitions with KMC and having trouble with the magnitude of the time step, and possibly it's dimension. The idea is to compute the desorption of some molecules as a function ...
-1
votes
2answers
38 views

Calculating versors of a plane from the normal versor

I'm trying to calculate the 2 perpendicular versors (unit vectors), $\vec{n_1}$ and $\vec{n_2}$, that define a plane whose normal versor (unit vector) is $\vec{n_n}$. For example, assuming that the ...
1
vote
1answer
16 views

Find best matching ranges below limit in defined set of numbers

I am trying to calculate the best set of cuts for some wood cutting to reduce the waste. So: Given a set of numbers, the goal is to find the best matches below a limit (size of wood beam). Example of ...
0
votes
0answers
31 views

Numerically solving schrodinger equation [duplicate]

Consider the potential given above: $$U(r) = \frac{U_0}{\exp[(r - r_0)/\epsilon] + 1}\, .$$ How to solve the Schrodinger equation with this potential numerically and find the eigenvalues?
1
vote
1answer
104 views

Non-reflective boundary condition

I'm currently solving incompressible Navier-Stokes system of equations with periodic flow and high viscosity. Is there any outlet boundary types that avoids the reflection of flow from the outlet back ...
2
votes
2answers
256 views

Semi-infinite domain transformation

Question is mostly related to literature or suggestions. Given a semi infinite domain: $x=[0; +\infty);y=[0; +\infty)$. Willing to transform it to computational domain of: $[0,1]\times[0,1]$. I did ...
5
votes
2answers
433 views

Computational method to compute both the (log) determinant and inverse of a matrix

Suppose I have a square matrix $\mathbf{A} \in \mathbb{R}^{n\times n}$ and a vector $\mathbf{b}\in\mathbb{R}^n$. In my application I need to accomplish two things. I need to find the solution of the ...
-1
votes
0answers
20 views

Do we need smallest vectors to obtain the optimized solution in Gradient Descent?

I'm new to topics about optimization. I am currently reading about Steepest Descent Method in Gradient Descent optimization. I saw this equation where we need to find a new iterate with an initial ...
4
votes
1answer
91 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]$, ...
5
votes
1answer
110 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 ...
2
votes
0answers
49 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: ...
0
votes
0answers
19 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 ...
3
votes
0answers
38 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 ...
-2
votes
0answers
29 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. ...
3
votes
0answers
38 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 ...
-1
votes
0answers
59 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 ...
7
votes
1answer
335 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 ...
3
votes
0answers
77 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 ...
-1
votes
2answers
120 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
82 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), (...
1
vote
1answer
67 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 ...
4
votes
1answer
103 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
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 ...
2
votes
0answers
24 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. ...
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 ...
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 &...
2
votes
2answers
124 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 ...
2
votes
0answers
67 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 ...
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: ...
1
vote
0answers
29 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): ...
2
votes
2answers
73 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
votes
1answer
66 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 ...
-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
86 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) ...
2
votes
1answer
171 views

Solving stiff ODEs: Dealing with Jacobian terms which take too long to compute with finite differences

I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with ...
9
votes
1answer
429 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 ...
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)...
1
vote
0answers
46 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$. I want $d$ that gives different values for different $F_t$. Note the equation is extremely long because I want the best measure of ...
0
votes
2answers
110 views

Implementation of $[X, \cdot]$ as an $n^2 \times n^2$ matrix, where $X$ is an $n \times n$ matrix

Let $M_n(\mathbb{R})$ denote the set of $n\times n$ matrices with real entries. I have an $n\times n$ matrix $X\in M_n(\mathbb{R})$, and I would like to implement the linear operator $[X, \cdot] : M_n(...
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. ...
5
votes
2answers
99 views

Optimizing a quadratic form integral over unit sphere

I have an optimization problem, which is to maximize the following integral over the unit sphere: $$ \max_B \int d\Omega \mathbf{f}^{\dagger}(\theta,\phi) (B^{\dagger} + B) \mathbf{f}(\theta,\phi) $$ ...
1
vote
0answers
29 views

Calculating the number of Flops of SPH density calculation

I would like to calculate the number of floating point operations (Flops) my code is performing in my machine. To do so, I would like to be sure I am counting the operations in the inner-most loop ...
3
votes
1answer
88 views

Parameters estimation with fewer variables than parameters

I am trying to estimate parameters, 4 of them, by fitting a system of 3 ordinary differential equations. I am using a model published that was using 3 parameters and gave a good fit to the data, and I ...
2
votes
0answers
56 views

Variational loss of hp-Variational Physics Informed Neural Networks for 2D-Poisson Equation in Tensorflow

I am trying to reproduce the results from the hp-VPINN paper (https://arxiv.org/pdf/2003.05385.pdf) on tensorflow (v1) for Poisson's equation, particularly the two-dimensional Poisson equation. In one ...
1
vote
0answers
64 views

Attempt on 2d Advection with FDM - With Code

I tried to implement the 2d advection problem with a velocity field, that is not constant in space. My problem is, that the "mass" of my shifted density gets "eroded" or just ...
7
votes
0answers
121 views
+50

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=...
4
votes
1answer
62 views

Stochastic cellular automata - algorithm limited by 1 cell per timestep

Context Let's say I am trying to model the spread of mold in a petri dish, using a stochastic cellular automata approach. The petri dish can be thought of as a grid of 1mm x 1mm squares, each called ...
1
vote
1answer
90 views

What is the difference between Adittive Schwarz as a preprocessor and a solver?

As we all know, the Additive Schwarz approach can be used as either solver or preconditioner, however, my question is, what is the difference between the two? In other words, how to use AS as solver, ...
-1
votes
1answer
192 views

Error in python (jupyter): index 1 is out of bounds for axis 0 with size 1 [closed]

I am an amature in python, I wrote a simple code in jupyter. But it is giving an error. I want to plot a function: ...
1
vote
0answers
91 views

Weird "oscillatory" modes appearing in FEM simulations

I am using COMSOL to solve a mathematical model involving thermoelectric hydrodynamic (TEMHD) flow. I am running a very large parameter sweep and using the solutions obtained to make some plots. ...

15 30 50 per page
1
2 3 4 5
197