# All Questions

884 questions
Filter by
Sorted by
Tagged with
1answer
161 views

### Where can an undergraduate go to find cores on a budget?

I've may have reached a point in my neural network research that I cannot continue without significant financial investment. I am using neuroevolution to evolve a network on the EMNIST data set. It ...
0answers
109 views

### Numerically compute PDF given a function

Consider $[0,1]$ with the Lebesgue measure $m$ and $f:[0,1]\to \mathbb{R}$, and $x$ a uniformly distributed random variable in $[0,1]$. Then, $f(x)$ itself define a new random variable. We can then ...
2answers
352 views

### Mass conservation in 1d diffusion by method of lines

I am solving the 1D diffusion equation by discretization using the method of lines. My problem is that I don't manage to ensure mass conservation. I have read many similar questions about the topic ...
1answer
125 views

### Crank-Nicholson for diffusion-advection vs diffusion equation

Let's consider the following 1D diffusion equation: $\frac{\partial u}{\partial t} = xk \frac{\partial}{\partial x}(\frac{1}{x}\frac{\partial u}{\partial x})$ where we assume that the diffusion ...
1answer
57 views

1answer
208 views

### Converge rate analysis: issue with time convergence

I have written a code which solves the incompressible formulation of the Navier-Stokes equations. It uses high-order methods both for time and spatial derivatives. I have been conducting convergence ...
2answers
113 views

3answers
346 views

### rank-deficient NNLS

I want to find the minimum-norm solution to a rank-deficient least-squares problem, subject to positivity constraints, e.g. $$\min_x\ \|x\|^2 \quad s.t.\quad Ax = b,\ x \geq 0$$ where $A$ is large, ...
1answer
581 views

### Crank-Nicolson method for inhomogeneous advection equation

Suppose we have the inhomogeneous advection equation $$\left(\frac{\partial}{\partial x}+\frac{1}{c}\frac{\partial}{\partial t}\right)u(t,x)=v(t,x)$$ for $u,v:\mathbb{R}\times\mathbb{R}\to\mathbb{R}$ (...
3answers
197 views

### Optimization of a blackbox function

Let's say that we have an objective function $f(\mathbf x,\mathbf y)$ which has the parameters $\mathbf x=[x_1\ldots x_n]$ and $\mathbf y=[y_1\ldots y_n]$. Here, $\mathbf y$ is a blackbox variable ...
1answer
772 views

### Direct multiple shooting (numerical optimal control)

Please, I am currently implementing direct multiple shooting methods* and I need one simple but fundamental concept answered: When I want to provide not only objective function value (the result of ...
2answers
3k views

### scipy.integrate.odeint: how can odeint access a parameter set that is evolving independently of it?

I might have some non-linear ODEs that are being solved by scipy.integrate.odeint. However, a parameter at each time step might have to be updated by using a non-DE ...
2answers
82 views

Note: this is a continuation of Generate Random Number outside Bounds. I have a function (thanks to the previous question) with the following prototype which returns an integer in the range $[0,b]$, ... 2answers 460 views ### What method do you suggest to solve this minimax, quadratic in both variables problem? I have a problem of the form, \begin{align} minimize_{y} maximize_{x}&\quad x^T y - y^T (B\odot x x^T) y\\ s.t. &x\in [l,u]\\ &Ay=b \end{align} How to efficiently solve this problem? ... 1answer 127 views ### TDMA with 3rd order upwind scheme I'm trying to implement a model I found in a paper, but there is something I do not understand. The authors say they use TDMA to solve their equations; however, they use a 3rd order upwind biased ... 2answers 314 views ### Numpy FFT gives me a pulse shorter than it should be. Not sure what I am doing wrong I've created a code (Python, numpy) that defines an ultrashort laser pulse in the frequency domain (pulse duration should be 4 fs), but when I perform the Fourier Transform using DFT, my pulse in the ... 1answer 324 views ### Solving first versus second order PDE I am trying to numerically solve a PDE, and just had a question as to the validity of a certain approach. For example, given the PDE: \frac {\partial ^2 E}{\partial t^2} = - k\frac {\partial E}{\... 1answer 112 views ### How to do Weierstrass-transform in MATLAB? I have a diagonalization problem. I have the eigenstates correctly, and I want to do a Gaussian-smearing (Weierstrass-transform) on them. So I have the wave functions (\Psi), and the continuous ... 0answers 526 views ### Looking for C++ function for performing optimization of parameters for multivariable function I am adapting a Java program from C++ and need a C++ function to perform the same task as the Java BOBYQAOptimizer() function. Can anyone recommend a C/C++ library with equivalent or similar functions ... 0answers 66 views ### Determine Lagrange nodal variables of a simplex T Consider a simplex T in R^d with N_1(T) = \left\{N_i\right\}_{i=0}^{d}\subset P_1^{*}(T) be the Lagrange nodal variables (or nodal evaluation). By the Riesz representation theorem, there exist ... 0answers 185 views ### Numerically solving a system of stiff nonlinear PDEs I am attempting to numerically solve the following: \begin{align} \frac {\partial y_1}{\partial t} &= i(y_2y_3 - y_2^*y_3^*) - y_1 \tag{1}\\ \frac {\partial y_2}{\partial t} &= y_1^*y_3 - y_2 ... 2answers 226 views ### Effective way to build the neighbor's list in MD I'm trying to implement the following form of the cell/neighbor list method in my MD code. I have divided my simulation box into a fixed number of cells, and according to its positions, I have ... 1answer 439 views ### Gnuplot: How can I determine the maxima of a fit function in gnuplot? I have a set of data data.txt which can be fit to a Gaussian function, f(x). I want to determine the coordinates of the point of ... 1answer 93 views ### Classification of method for solving PDEs If I have a system of equations as follows (where i = \sqrt{-1}): \frac {\partial A}{\partial t} = iA^*B - A \tag{1} \\  \frac {\partial B}{\partial z} = AB^* - B \tag{2} $$Using the ... 1answer 131 views ### How to compute turbulent energy cascade I need to compute the kinetic energy cascade using a finite volume solution in an equally spaced grid. I wonder if it is more correct to first compute the kinetic energy in the space (or time) domain, ... 0answers 828 views ### linearly interpolate and determine gradients for data on non-uniform grid I have measurements of a quantity on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but ... 0answers 76 views ### PDE discretization (via finite difference sheme) question So after posting this question and reading all your comments I would like to make this new question (update). If you consider the three equations presented here:$$\frac{\partial \rho}{\partial t} +\... 0answers 1k views ### Crank-Nicolson for 2nd- and 4th-order finite differences I modeled the heat equation, $$u_t = au_{xx}$$ using the common 2nd-order Crank-Nicolson scheme, $$\frac{u^{n+1}_i-u^{n}_i}{dt} = \frac{a}{2\,dx}\left(u_{i-1}^{n+1}+u_{i+1}^{n+1}-2u_i^{n+1} + u_{i-... 0answers 143 views ### Using backward difference approximations for higher order derivatives I am trying to solve a system of equations and have a question regarding the validity of my approach when implementing a fifth-order Cash-Karp Runge-Kutta (CKRK) embedded method with the method of ... 1answer 80 views ### Isotropic thermal expansion I frequently see the equation$$ \sigma_t = E\alpha \Delta T $$as the equation for thermal stress. Where E is Young's modulus, \alpha is the CTE, and \Delta T is the change in temperature. ... 0answers 33 views ### Minimizing the ratio of two specific non negative quadratic convex functions F is m\times m diagonal, with real non negative elements D is n \times m complex P is n \times 1 complex A is m \times 1 complex. Minimize \Gamma(A), with respect to A.$$\... 1answer 220 views ### Is there any rapid way to calculate the determinant of NXN covariance matrix? I searched the web and found some C code for calculating the determinant of an\times n$matrix. This code however seems timing complexity, and run pretty slow especially when handling a larger ... 1answer 721 views ### roots of polynomials of high degree: LinAlgError: Eigenvalues did not converge I wrote a simple script to generate random polynoimals$\displaystyle f(z)= \sum_{k=0}^N a_k \frac{z^k}{\sqrt{k!}} $of high degree and find their roots. For more discussion on random polyomials see ... 2answers 351 views ### Numerical evaluation of the first and second complete elliptic integrals To get a numerical evaluation of the first (K) and second (E) complete elliptic integrals: $$K(k)=\int_0^1\frac{dt}{(1-t^2)^{1/2}(1-k^2t^2)^{1/2}}, \ \ \ \ \ E(k)=\int_0^1\frac{(1-k^2t^2)^{1/2}}{(1-t^... 1answer 64 views ### openmp critical Following this question, for the code below (from MS OpenMP docs example) ... 2answers 675 views ### Mixed formulation of the Poisson equation (FEM) I'm solving the Dirichlet problem for the Poisson equation in a 2d domain D:$$ \begin{cases} \Delta u = 0 \quad \text{in$D$}, \\ u|_{\partial D} = u_0. \end{cases}$$I'm interested in ... 2answers 312 views ### Calculating integrals for a function approximated by Chebyshev polynomials Setup (complete, but all very standard): My problem is how to best calculate the cumulative integral of a function which comes out of Spectral Collocation with a chebyshev basis. Take some function$...

15 30 50 per page