# All Questions

7,738 questions
16 views

### Neumann boundary conditions on arbitrary surface for finite difference diffusion

I am facing the following problem, formulated in practical terms: I have a region $\Omega$ in two or three dimensions, represented as a binary mask, and an initial density $u_0$ within that region ...
20 views

### Online Parameter Estimation using Lyapunov method

I have a first order system which is described by the following differential equation: $\ \dot{x} = -a*x + b*u$ where u is the input $\ u = 5*sin(3*t)$ and also the state ...
40 views

### Is “Gradient Computation” in Finite Volume Discretization Really 2nd order accurate?

Based on this, pp 245, we go through these steps to discretize a gradient statement, namely $\nabla\phi$: 1- Gauss theorem reads, $$\int_V\nabla \phi dV = \oint_{\partial V}\phi dS$$ 2- Integral ...
28 views

### Demagnetizing field using scalar potential method

I want to calculate the stray magnetic field from a ferromagnet using the scalar potential method (1). The problem consists of a ferromagnetic cuboid divided into small cuboidal cells in which the ...
36 views

### How reproducible are conda environments?

I am aiming at keeping my scientific studies and analyses reproducible: I am automating them as much as possible, I am sharing them, and I sharing them together with the execution environment(s) I've ...
47 views

### Online Parameter Estimation using steepest descent

I have a first order system which is described by the following differential equation: dx/dt = -a*x + b*u where u is the input <...
60 views

### How to : numerical integration by quadrature in C language / remove NaN

What I wanna solve it the problem following ( by quadrature method ) I want to get two arrays of data ( z & tau ) from z[0], tau[0] to z[2249], tau[2249]. Since the integrand diverges at z=0.9, ...
12 views

### Metis: how to use and tutorial recommendation

I am new to METIS and trying to use it in my fortran code. I read the manual online. But still, I am not sure about how to implement it my code. I tried the test cases in the graphs directory. For ...
46 views

### Second derivative using Fornberg finite difference method

I have some discrete data, non-equispaced in x, y=f(x). I want to use a numerical finite difference method to calculate the second derivatives of y, at some point. I am using the Fornberg method, ...
27 views

### Plotting ratings matrix

Hello fellows and folks. I have been looking to do this for 1 month and still cannot find the way to do it. Here’s what’s going on: I have a csv file called ratings.csv with the following ...
25 views

45 views

### Solving a non-convex optimization problem using fmincon

I am trying to solve a non-convex optimization problem using fmincon(). At each iteration, I am iteratively looking for the optimum value and when the termination ...
51 views

### Is there a simple way of implementing dark energy into a n-body simulation?

I'm working on a gravitational n-body simulator and would like to implement dark energy into it but all I can find is papers with relativistic equations which I don't really understand. Is there a ...
37 views

### Animation using matplotlib

I am trying to animate a plot of two distinct points (blue and green points) moving about the complex unit circle using Python's Matplotlib library. The problem I am having is that the animation does ...
24 views

### PCJACOBI works but the default PCBJACOBI failed in PETSc

I am using PETSc and libmesh to solve a simple linear elastic problem with quite complicated geometry, using linear tetrahedral elements. I am always using the KSP CG as the solver. I noticed that ...
70 views

### Why would BFGS converge to a local minima of a non-convex function but maintain a large gradient?

I'm using BFGS to optimize a smooth but non-convex function $f$ that is computed by a simulation. The simulation also gives me a semi-analytical gradient $g$, which is verified by the numerical ...
72 views

### 3d vs 2d finite element method

Is the theory of 3d finite element method just an assembly of 2d finite element analysis by putting planes on top of each other, or, a much more comple and different theory applies for 3d, with ...
41 views

### Definition of Lagrange nodes in Gmsh

When gmsh uses higher-order tetrahedral elements, there is an underlying Lagrange basis used to specify the map from reference space to the element. I'm trying to load a gmsh mesh of 3rd degree ...
54 views

I have a matrix $A\in\{0,1\}^{d\times n}$ and $rank(A)=d,d<n$, and another matrix $X\in \mathbb{R}^{d\times n}$, but I do not know the rank of $X$. What can we say about the rank of their Hadamard ...
33 views

### Solve the PDE with mathematica [migrated]

$[\frac{\partial^2}{\partial x^2}+\frac{\partial^2}{\partial y^2}]u(x,y)-6[\sin^2(x)+\sin^2(y)]u(x,y)+4.1209 u(x,y)=0$ with the periodic boundary condition $-4\pi <=x,y<=4\pi$. How to write the ...
65 views

### Missing something fundamental about condition number estimation

In Higham's Accuracy and Stability of Numerical Algorithms, Chapter 15, algorithm 15.3 and 15.4: The topic is ostensibly condition number estimation, but these algorithms show how to compute $\gamma$ ...
40 views

### Adding physical units to 2D lattice computational model [closed]

I have implemented the Gillespie algorithm on a 2D lattice where at each time step a randomly selected reaction can occur. Either: A node randomly moves (movement); Two neighboring nodes interact to ...
I have this non-linear partial differential equation. $$\frac{\partial C}{\partial t}=\left(\frac{\partial C}{\partial x}\right)^2+C\frac{\partial^2 C}{\partial x^2}$$ I want to use the finite ...