# All Questions

9,980 questions
Filter by
Sorted by
Tagged with
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 - ...
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:-...
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 ...
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 ...
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 ...
39 views

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 ...
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 ...
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)...
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 ...
41 views

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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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}$,...
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 ...
75 views

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 ...
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 ...
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 ...
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 ...
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,...