All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
60 views

Pivoted Cholesky vs Modified Cholesky

I am solving nonlinear least squares problems with the normal equations approach, so on each iteration, I need to solve: $$ J^T J \delta = -J^T f $$ for the step $\delta$, where $J$ is a large (...
0
votes
1answer
78 views

Relation between Stress/Strain and normal derivative of displacement

I calculated the stress $\sigma$ and strain $\varepsilon$ for a solid plate with dirichlet boundary conditions $u = g$, where $u$ is the displacement. With these I want to calculate $\nabla_n u = t$ ...
0
votes
0answers
36 views

Stokes Equation fails to converge for an ellipse

This might be because of the mesh, but the following code blows up for all values of b not 1. Does anybody have any experience working with the ellipse mesh in Fenics? ...
1
vote
2answers
64 views

identifying peaks in data

I have data with peaks on some background, for example: The two prominent peaks at ~390 and ~450, as well as the much smaller peak at ~840. What are some options to programmatically find the position ...
3
votes
1answer
83 views

Plug-and-go Clebsch-Gordan computation in python?

I started a little project in python, under the assumption that it would be easy to find a routine for numerically computing Clebsch-Gordan coefficients in some library such as scipy. When it came ...
1
vote
1answer
78 views

Finite difference methods

I am currently applying the finite difference method to the solution of the diffusion equation. I think that a problem has occurred, and is as follows, my explicit method is the most accurate when ...
2
votes
1answer
67 views

Residual value goes to NaN while solving a system of nonlinear equations

I am solving a system of coupled nonlinear equations using Newton's method, similar to $$\begin{split} c_A(A, B)\partial_tA&=\nabla\left(k_A(A, B)\nabla A\right) + f_A(A, B, t)\\ c_B(A, B)\...
0
votes
0answers
26 views

Obtaining integer digits using the GNU Multiprecision Arithmetic Library (gmplib)

I'm using the GNU Multiprecision Arithmetic Library (gmplib) for some experiments in computational mathematics. I want to extract, and manipulate, the base-b digits (with 2 <= b <= 10) of ...
2
votes
1answer
62 views

How to check experimental data against a theoretical curve? (Python)

I am trying to check the agreement of a dataset against a theoretical curve, specifically a bandstop filter in an RLC circuit. I have generated a function which describes the curve we expect from the ...
2
votes
2answers
143 views

Automatic timestep adjustment in a CFD solver

I have developed my own 3D Finite Volume Navier-Stokes solver based on projection method for nonuniform grid. I am looking to incorporate automatic timestep adjustment at each time step based on ...
2
votes
1answer
219 views

Forward and backward integration — cause of errors

I write a test program to integrate foward on $[0,T_f]$ and then backward on $[T_f,0]$ from the endpoint of the forward integration an Hamiltonian system: $$ \dot q(t) = \frac{\partial H}{\partial p}(...
0
votes
0answers
31 views

How to show equivalence between two programs?

Consider the following space $A = \{(x_1,x_2,x_3)\in \mathbb{R}^3|x_1+x_2+x_3 = 1\}.$ Then say that we want to minimize a function $J(y):\mathbb{R}^{3}\to \mathbb{R}$ subjected to the constraint that $...
0
votes
0answers
25 views

Finding the polynomial for the solution of an ODE

I’m stuck trying to solve part (b) and (c) of the below problem, but part (b) is the one of main concern here as I think (c) should follow easily once (b) is completed. I don’t know where to start ...
1
vote
0answers
43 views

Finite dimensional optimization problem over dynamical system

I am interested in solving numerically the following mathematical problem Consider an ode of the form $$ \dot q(t) = f(q(t),t_1,\ldots, t_N),\qquad t\in [0,T], $$ where $q\in \mathbb{R}^n$ is the ...
7
votes
1answer
112 views

Is there any explicit symplectic Runge-Kutta method?

As far as I know, all the symplectic Runge-Kutta methods are implicit which need to solve non-linear equations during the calculation. Is there any explicit method? If not, why?
4
votes
2answers
70 views

How to efficiently invert $K \otimes M+I_T\otimes \Sigma$?

I'm looking for a way to efficiently invert $$K \otimes M+I_T\otimes \Sigma$$ where the inverses for $M,K$ exist. $I_T$ is the identity matrix of dimension $T$, and $\Sigma$ is a diagonal matrix, with ...
2
votes
1answer
73 views

Automatic differentiation via ADOL-C and the Heaviside Function

I am writting a c++ program in which I define a function $$\displaystyle F(t) = \sum_{i}r_i\,H(t-t_i)$$ where $H$ is the heaviside function, $t_i$ are optimal parameters which are mutable. The ...
0
votes
0answers
49 views

Strange spectral (finite) element results of a solid plate

I tried to implement the spectral element method1 as proposed in [1]. I simulated an aluminum plate and a vertical concentrated force was applied at the middle of the top left quarter of the plate2. I ...
5
votes
0answers
94 views

How to solve a 4th order nonnegative LASSO problem?

I need to solve the following 4th order nonnegative LASSO problem: $$ \min_{x \geq 0} \quad || |Ax|^2 - b ||^2 + \lambda ||x||_1 $$ where $|\cdot|^2$ denotes element-wise squared. $A$ is small size (e....
0
votes
0answers
36 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
1answer
64 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
46 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 ...
7
votes
0answers
60 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 ...
1
vote
1answer
54 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
79 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
26 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
78 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
42 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 ...
2
votes
1answer
36 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(...
4
votes
1answer
36 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 ...
1
vote
0answers
47 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
27 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
vote
2answers
202 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
48 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
112 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
60 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 ...
29
votes
16answers
9k 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
43 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
36 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
82 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
12 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
103 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
133 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
35 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. ...
1
vote
0answers
37 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 ...
2
votes
1answer
79 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
70 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, ...
2
votes
1answer
66 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
62 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 ...
1
vote
1answer
38 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{...

15 30 50 per page