All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Solving the heat equation using a finite element method with backwards Euler time discretization

I am solving the heat equation using a 1d finite element method with backwards Euler time discretization. What happens when the time step is greater than or equal to the spatial step and why? Edit - ...
-1
votes
0answers
20 views

How to form Two-Electron Integral Symmetry array from an input?

I am doing a code that can calculate the hartree-fock energy. I want to form the two-electrons integral array by reading the data from the input like this one below to calculate the Fock matrix. Note:-...
0
votes
0answers
13 views

Overflow in Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods

I'm having trouble with the following implementation of the KS model (see below) found on Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods When tN > 300 an overflow ...
0
votes
1answer
26 views

Time & Space matlab discretization Finite Differences confusion

I have been trying to solve this equation and write the finite difference scheme in matlab for months, but I still am not successful. Given the KdV Equation $$\tag{1}u_{t} -6uu_x+u_{xxx}=0$$ I have ...
-1
votes
0answers
23 views

How to find the probabilty distribution of a particles trajectory?

I'm new bee in computational physics. I know theoretically what is probability distribution mean, but I'm little confused how to implement this theoretical concept. SO for example we've trajectories ...
1
vote
0answers
39 views

Numerical evaluation of Duhamel's integration

I am trying to numerically evaluate the following Duhamel's integration: $$ x = \frac{-1}{\omega_d} \int_0^t \ddot{x}_g (\tau) e^{-\zeta \omega_n(t - \tau)} \sin{\left( \omega_d (t - \tau) \right)} d\...
0
votes
0answers
23 views

Monte Carlo Simulation of Power Law [closed]

I have a euqation: P(a) = a^(-b)+C. I have 15 randomly generated 'b' values in a list list_x....
1
vote
1answer
15 views

Why are weight changes in Oja's rule and BCM so different?

I simulated Oja's rule and BCM for a single postsynaptic neuron with two presynaptic neurons, and for 10000 inputs, where I randomly select one of $(0,1)$ or $(1/2,\sqrt{3}/2)$ as input. My learning ...
7
votes
1answer
351 views

How to find the smallest ellipse covering a given fraction of a set of points?

I have a set of points $P$ and want to find the ellipse with the smallest area that covers at least a fraction $f$ of these points. How can I do this? These questions ask the same thing, but folks ...
1
vote
0answers
33 views

How to write a simple finite element solver in python in order to solve Poisson equation in 2D

I would like to write a simple finite element solver in python in order to solve 2D Poisson equation and then visualize it. $$ -\nabla^{2} u(x,y)=f(x,y), \quad x,y \quad in \quad \Omega\\ u(x,y) = u_D ...
2
votes
0answers
38 views

Comparison on adaptive mesh refinement on finite elements and finite differences

My current work requires using (Adaptive Mesh Refinement) AMR to resolve multi scale physics. I have a general question whether finite element is better than finite difference in this aspect or not. I ...
2
votes
0answers
72 views

Going to try to move some of my scipy/numpy calculation to GPU, how to avoid disappointing results?

I have a layer of atoms on a surface and am trying to do a 2D Frenkel–Kontorova-like energy minimization using at first simplex then once that works, with simulated annealing. The number of atoms ...
0
votes
1answer
103 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)...
0
votes
0answers
23 views

Finite volume method on a nonuniform grid

I would like to ask a question on the implementation of finite volume method on a non-uniform grid in solving Navier-Stokeq equations. I will just post the screenshot of a PhD thesis, where I found ...
0
votes
0answers
41 views

Slow convergence of Stokes solver used with the Immersed Boundary method

I am using Immersed Boundary Method to simulate elastic particles in 3D Stokes flow. Specifically, one has $\nabla ^2 \mathbf{u}-\nabla p + \mathbf{f}(t) = 0$, $\nabla \cdot \mathbf{u} \; $, where $\...
0
votes
1answer
38 views

Scipy Find Peaks

I am trying to find the peaks. I have list x_period and y_power. I find the peaks from the ...
4
votes
1answer
86 views

Sparse least squares with a (black-box) ill-conditioned operator

It was suggested on math.stackexchange.com that I try to ask this question here. Consider a bounded linear operator $A : U \to V$ where $U$ is finite dimensional and where $V$ is a separable Hilbert ...
4
votes
0answers
38 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 ...
-1
votes
0answers
28 views

VMD polymer draws multiple bonds [migrated]

I'm new to VMD and I'm having some problems with displaying my polymer chain. Instead of just one bond, VMD draws multiple bonds. Why does this happen?
4
votes
0answers
50 views

Decomposing a banded matrix

Suppose we have a linear algebra problem with a banded matrix A which has nonzero entries on the main diagonal, two nearest sub-diagonals, and two other sub-diagonals (such band structure often arises ...
10
votes
1answer
378 views

Generalization of eigendecomposition problem

Let $A\in \mathbb{R}^{n\times n}$ and $v \in \mathbb{R}^n$. We recognize $Av=\lambda v$ for some scalar $\lambda$ as an eigendecomposition problem. Suppose $\mu \in \mathbb{R}^n$, and let $\odot$ ...
1
vote
0answers
37 views

Mineral dissolution and solute transport around a solid

I am trying to simulate solute transport of acid (HCl) and consequent mineral dissolution around a grain (calcite). The governing equation for transport is the advection-diffusion equation, given as: ...
0
votes
0answers
26 views

Find tuples of points from multiple sets

Given n sets of points in general position in dimension 2 (n typically small, 2-6), can one find tuples of points, one from each of the sets, which are close in some sense (the closest, mutual ...
0
votes
0answers
28 views

Can line search solve linear objective with nonlinear constraints?

Consider an optimization problem of the form: $$\max_{f(x)\le K,\\0\le x\le M} c^\top x,$$ where $f(x)$ is nonlinear. Can a line search of the following form be used to solve this problem? $$ \max_{\...
2
votes
0answers
84 views

How to position oneself, if one has little practical engineering background or function, but may have a broader insight into mathematical modeling?

How to position oneself, if one has little practical engineering background or function, but may have a broader insight into mathematical modeling? Or, lets say: I could write models to prove ...
0
votes
0answers
26 views

Restriction in (geometric) multigrid for vectors of non-even length

Naive restriction operators in geometric multigrid that I have seen are typically implemented as a convolution and a subsequent averaging of every two entries in a vector $v^h$. For example: $$\tilde{...
0
votes
0answers
31 views

Differences between Two-Grid Correction and V-Cycle Scheme

I found in A Multigrid Tutorial: Second Edition by William L. Briggs‏, Van Emden Henson‏, Steve F. (here) the following Schemes: Two-Grid Correction Scheme, p. 37: And V-Cycle Scheme, p. 40 I want ...
3
votes
0answers
55 views

Comparing block versus non-block Krylov methods for handling multiple right-hand-sides

Suppose I wish to solve a linear system $AX=B$ iteratively where $A$ is an $m\times m$ matrix and $X,B$ are $m \times s $ matrices (not single vectors). Instead of solving $s$ independent systems I'm ...
15
votes
4answers
2k views

What are some good strategies to test a floating point arithmetic implementation for double numbers?

For IEEE, the single representation is 1-bit sign, 8-bit exponent and 23-bit mantissa. This means that at each exponent value, you can test all 2^23-1 (roughly 9mil cases) possible combination of ...
2
votes
2answers
375 views

Modelling question: example of a physical phenomenon with this jump condition at an interface?

in our finite element class we were talking about interface problems our teacher came up with the following, where $K_i$ are two given functions and $u_i$ is the restriction of the solution $u$ to $\...
3
votes
3answers
116 views

Hypergeometric function $_2F_1(z)$ with $|z| > 1$ in GSL

I need to evaluate the hypergeometric function $_2F_1$ with $|z| > 1$ as in Wolfram Language with GSL but the GSL documentation says the $_2F_1$ needs $|z| < 1$. Is there any way I can use GSL ...
2
votes
1answer
50 views

How to stack N boxes of varying heights into M stacks, most evenly

The "standard" box-stacking algorithm(s) AFAIK assume a single stack and try to put the "largest" boxes on the bottom. The case I want to solve is simply to distribute the N boxes ...
4
votes
1answer
79 views

Worst Case complexity of a search engine algorithm

Computer make it possible to find information in large databases. However, the results are often too large to be returned in their entirety to the user who requests them. Computer therefore sort the ...
2
votes
0answers
86 views

Solve Rational Equation for Root Music in MATLAB

I'm trying to estimate DOA in the Hybrid architecture using root music so I need to solve the attached equation to find the roots for the Root_Music equation in Matlab. Does anyone have an idea for ...
7
votes
0answers
72 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 ...
4
votes
1answer
146 views

Is there any way/any python function to calculate the condition number of the roots of a polynomial directly?

I know that NumPy has linalg.cond(A) to find the condition number of a matrix A. But, if I want to find the condition numbers of the roots of a large polynomial ...
0
votes
1answer
62 views

Finding total derivative of a multivariate function in Maple

In Maple, I have a function $f(x(t),y(t),t)$ that I want to differentiate with respect to $t$. I know the command for partial derivative $\frac{\partial f}{\partial x}$,$\frac{\partial f}{\partial y}$,...
-1
votes
0answers
48 views

Numerical scheme HJB equation

Without dwelling on details on how to obtain the HJB equation for this problem, I would like to know if the scheme I wrote for solving it numerically is viable or did I miss something. I need to solve ...
2
votes
1answer
75 views

Elementary matrix of Raviart-Thomas elements

We can use the $RT0$ to solve the Darcy equation, i.e. $$k^{-1}\mathbf{u}+\nabla p = 0, \text{ in } \Omega,$$ $$-\nabla \cdot \mathbf{u} = 0, \text{ in } \Omega,$$ $$p = p_D \text{ on } \partial\Omega,...
-1
votes
0answers
36 views

Identifying Noetherian symmetries from general Lie symmetries of a differential equation

I know the Lie symmetry group of the harmonic oscillator differential equation from the literature. It is an 8 parameter Lie group. 5 of these generators generate Noether symmetry: $$G_1=\sin(2t)\frac{...
0
votes
0answers
56 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 ...
1
vote
1answer
76 views

Can someone explain the equivalence between Oja's rule and PCA in a simple way?

I have to give a presentation on unsupervised learning in 2 days, and I have to explain/show the equivalence between Hebb's learning rule (or Oja's rule to be more specific) and PCA. The thing is that ...
3
votes
2answers
138 views

Test functions of Raviart-Thomas elements?

The test functions of general finite elements are like interpolation functions (if my understanding is correct). But how about test functions of Raviart-Thomas elements? Let's raise the $RT0$ element ...
0
votes
0answers
48 views

Solve simultaneous differential equations with embedded functions and a parameter estimation

The aim is to solve the below equations and plot $m$ with time, i.e. $\frac{dm}{dt}$ $k$ is unknown and needs to be estimated. For the parameter estimation, the below values in the table for m versus ...
3
votes
0answers
41 views

Appropiate Artificial Boundary Conditions for the radial part of the Klein Gordon equation?

I am trying to simulate the following equation using FDTD $ \left(- \partial^2_t + \partial^2_x + V(x) \right) \psi(x,t) =0 $ subjected to the initial conditions $\psi(x,0) = f(x),~ \partial_t \psi(x,...
12
votes
2answers
1k views

How do I find the minimum-area ellipse that encloses a set of points?

I have a set of points that resembles more of an ellipse than a circle. I implemented the optimization formulation below and the solution gives a circle. I tried with various initial values, still to ...
0
votes
1answer
71 views

1D wave equation using Finite difference method MATLAB

I have the wave equation $$u_{tt} = 4 u_{xx}$$ with the boundary conditions $$u(0,t) = u(L,t) = 0\,,\quad x \leq 0 \leq 2\pi \,,\quad t\geq 0$$ and initial conditions $$\begin{align} &u(x,0)=\...
2
votes
0answers
52 views

ICCG negative residual products $r^TM^{-1}r$

I have a linear system $Ax=b$ resulting from a finite element discretization of the Poisson equation. I am applying an IC0 (incomplete Cholesky ($LDL^T$) with the same sparsity as the original matrix) ...
1
vote
1answer
56 views

solve_ivp doesn't work with toms748

I have the following code ...
0
votes
0answers
26 views

Conserved current for a 1d oscillator using Maple

I found out the conserved current for harmonic oscillator with angular frequency 1, particle falling in gravity close to ground ($g=1$) using maple. I'm unable to understand the result: $$J[t](t, x(t)...

15 30 50 per page
1
2 3 4 5
200