All Questions

0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
1
vote
1answer
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 ...
5
votes
0answers
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 ...
0
votes
1answer
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 <...
-2
votes
1answer
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, ...
1
vote
0answers
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 ...
0
votes
0answers
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, ...
0
votes
1answer
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 ...
1
vote
1answer
25 views

Discretization with non-constant matrix containg entries form unknown vector

Consider a system of PDEs $$ \begin{cases} u_t = \nabla \cdot (D(u)\nabla u) + \frac{c}{K_U+c}u-ku\\ c_t = d_c\Delta c -\frac{\nu_U c}{K_U + c}u \end{cases} $$ with some boundary conditions. Here, $D(...
3
votes
1answer
32 views

Single-variable multimodal derivative-free optimization (for a well-behaved function)

Are there well-established approaches to single-variable multimodal optimization? Given $f:\mathbb{R}\rightarrow\mathbb{R}$ that: has several local minima within a given range of interest $[a,b]$ is ...
0
votes
0answers
38 views

Numerically Approximating the Jacobian and Comparing the Eigenvalues With Analytical Form

I am trying to study the stability of numerical discretization schemes using the Jacobian matrix of the residues with respect to the vector of conserved variables. For a simple diffusion equation ...
0
votes
0answers
22 views

Density functional theory: Total energies and forces

In DFT, forces are calculated using the Hellman-Feynman theorem, such that: $$\frac{\text{d} E_\lambda}{\text{d} \lambda} = \left \langle \psi_\lambda \left|\frac{\text{d} \hat{H_\lambda}}{\text{d}\...
-1
votes
0answers
13 views

Nevergrad not assessing bounds properly

I'm using Nevergrad by Facebook in Python and am observing some strange behaviour relating to bounds. Let's find the minimum of a standard simple function: ...
1
vote
2answers
62 views

Creating 3D Mesh from stl files with gmsh

After long hours of searching for an answer I thought it might be better to ask the community. The problem I have is that I need to convert STL files to mesh files. I know that I therefore need to ...
0
votes
1answer
44 views

Training accuracy improves but test set accuracy remains the same

I have built an ANN model with 5 hidden layers and 100 nodes in each layer to solve a multilabel classification problem. After the first run, I get a training accuracy of ~66% and a test set accuracy ...
4
votes
2answers
99 views

Is saying “math modeling and numerical simulation” wordy and redundant?

I'm describing some work on my website, and I'm wondering if my math modeling and computer simulation work is described ok: I say math modeling and numerical simulation. Should I say "...
4
votes
0answers
49 views

Fast approximate solver for vehicle routing problem

I need to solve capacitated asymmetrical vehicle routing problem with time windows on ~30k points. Time limits for calculations are 2 hours. I've tried using Clarke and Wright savings algorithm, it is ...
26
votes
12answers
8k views

Good examples of “two is easy, three is hard” in computational sciences

I recently encountered a formulation of the meta-phenomenon: "two is easy, three is hard" (phrased this way by Federico Poloni), which can be described, as follows: When a certain problem is ...
2
votes
1answer
39 views

Time complexity analysis

I want to know the time complexity of following code Say I have a list unique_element[] There is an array which contain elements {4,5,2,4,7,8,1,5,9,8,1} Now as per my code I want to find out the ...
2
votes
0answers
25 views

How to determine the order of convergence of the Euler-Maruyama method?

This question is originally posted in Quant.StackExchange but has been unanswered for some time so I ask in here. To make this simple let us consider the Geometric Brownian Motions (GBM). My ...
1
vote
1answer
73 views

Dirichlet to Neumann Operator

EDIT: I am trying to specify my Question. Also I am not going to clearify which spaces I use, because I am only interested in the basic idea. I am looking at a standard elliptic second order PDE: \...
0
votes
0answers
9 views

XDMF version 3: how to describe uniform-grid image data?

I have the following, functional, XMDF file (version 2, or something like that) which I use to describe HDF5-stored heavy data for visualization in Paraview. I would like to upgrade to XDMF3 (just to ...
4
votes
2answers
89 views

Finite difference for a highly nonlinear equation - The wind within the forest

Based on the Navier-Stokes equations and a few parameterizations, the horizontal steady-state wind $u(z)$ within a forest of height H satisfies: $$ a\left(\frac{du}{dz}\right)^2 + b\frac{du}{dz} \...
1
vote
2answers
45 views

How to use MeshFunction in FEniCS (dolfin)?

I'm a beginner user of FEniCS and still struggling with some of the basics. Specifically, I have some issues doing the tutorials in the Langtangen-Logg book Solving PDEs in Python - The FEniCS ...
1
vote
0answers
30 views

Changing geometry scale breaks simulation

I'm trying to find the capacitance matrix for a small array of metal boxes in air using Comsol 5.4. The geometry presented here is a simple geometry that recreates the problem I'm experiencing. ...
0
votes
0answers
15 views

Print Matrices A and B [closed]

I use OpenFoam 5.0. I Want to print or save in xlsx file the matrix A and B in equation Ax=B in OpenFoam Solvers. Can anyone guide me?
1
vote
0answers
30 views

Stability of SVD, Eigendecompositions, and pseudoinverse procedures in modern LAPACK routines

I have proposed an optimisation algorithm which I claim has improved upon the previous algorithm in a number of ways. One of these claims is that my proposed solution requires no explicit SVD and ...
1
vote
2answers
61 views

How to add extra constraints to a linear system for probabilities?

Background: I have an equation which looks like as follows: $W \times P = R$ $$\left[\begin{array} &{1}&{0}&{0}&-\frac{w_{1}}{w_{o1}} &\dots &{0} &-\frac{w_{1}}{w_{0} } \...
2
votes
1answer
61 views

How to justify using available code (in different language) for comparing algorithms

I have proposed an algorithm for a scheduling problem in a submitting paper. In the revision, the reviewer asked us to compare with another algorithm from the literature. Our algorithm is in MATLAB, ...
1
vote
0answers
45 views

User friendly scipy optimize wrapper package?

I'm creating too much throw away code for interfacing with the scipy optimize package in a user friendly way. (See code below for example of interruptible optimization that keeps last optimization ...
0
votes
1answer
50 views

Dirichlet boundary conditions in the 1D Heat Equation

Please consider the assignment I have uploaded on the picture. I am confused about the functions $g_L(t)$, $g_R(t)$ and $\eta(x)$. What are they and how do I find them... My question: Is it possbile ...
0
votes
1answer
67 views

How to plot 1/energy units in the energy (E) vs density of states (DOS) plot?

I have calculated the eigenvalues of Hamiltonian by exact diagonalization. Now I want to plot density of states (DOS) on y-axis and E on x-axis. DOS counts the number of energy levels in unit interval ...
1
vote
1answer
36 views

How to calculate the analytical solution of linear advection equation with Dirichlet's boundary conditions?

I am trying to find the solution of linear advection equation of the form: $\frac {\partial c}{\partial t}+u\frac {\partial c}{\partial x}=0$ $c(x,0)=0$ $c(0,t)=\{c_0 \ \text{for}\ t \leq t_1 \text{...
2
votes
1answer
40 views

Damped Harmonic Oscillation. Efficient algorithm to find the parameters resulting in threshold oscillation amplitude

Let's assume, that we have damped harmonic oscillation of a body in the form of a cone, immersed in a liquid. Equilibrium condition of the body is: $$m\overrightarrow{a} = \overrightarrow{F_\text{...
0
votes
1answer
132 views

Solving $n$ coupled equations numerically in Matlab

I would like to solve the following equations simultaneously and numerically for all $X, Y, Z, W$ where i = 1:Nw, j = 1:Nl, k = 1:K. $W_\text{net1}$, $W_\text{net2}...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
3
votes
1answer
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 ...
0
votes
2answers
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 ...
4
votes
1answer
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 ...
2
votes
1answer
54 views

Rank of Hadamard Product with Masked Matrix

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 ...
0
votes
0answers
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 ...
1
vote
1answer
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$ ...
0
votes
0answers
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 ...
2
votes
0answers
63 views

How can one prove the duality of Voronoi and Delaunay?

Hoping I'm not misunderstanding the concept here, but it is my understanding that Voronoi Diagrams and Delaunay Tesselations are 'dual' to one another, owing to the fact that each' solution makes ...
0
votes
1answer
99 views

Numerically solving a non-linear PDE

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

15 30 50 per page