# All Questions

9,827 questions
Filter by
Sorted by
Tagged with
245 views

### Error in python (jupyter): index 1 is out of bounds for axis 0 with size 1 [closed]

I am an amature in python, I wrote a simple code in jupyter. But it is giving an error. I want to plot a function: ...
58 views

### Comparing minimas of two different functions

The goal is to find vectors $x_u$ and $y_i$, both of the same length $f=64$, and to do this the following loss function is minimized: $$\sum_{u, i} (1 + \alpha \cdot r_{ui})(p_{ui} - x_{u}^{T}y_i)^2$$ ...
314 views

81 views

### Stability analysis simplification for PDE

I have the nonlinear PDE $$\frac{\partial U(z,t)}{\partial t} + A(U)\frac{\partial U(z,t)}{\partial z} + B(U)U(z,t) + C(z,t) = 0,$$ where $A(U)$ and $B(U)$ are guaranteed to be real and positive. I ...
85 views

### How is the integral of a projection over an element $T$ computed in practice? (deal.II related)

I'm studying an error estimator for the equation $\nabla\cdot(\beta u) + cu = f$ and it contains the following term $$||f - cU_h - \Pi(f-c U_h) ||_T$$ where : $\Pi$ is the local orthogonal $L^2$ ...
187 views

### Algorithm for solving systems which are nearly symmetric/adjoint?

I am familiar with Cholesky decomposition and LU factorization for solving systems of linear equations. I have a problem where I have large sparse matrices (say, 1000x1000 or larger) where only one or ...
128 views

### Why is Time evolving block decimation so efficient?

I have a short question about Time evolving block decimation (TEBD). During a lecture I was told that this method is very efficient in evolving 1D quantum spin systems with only nearest neighbor ...
51 views

### About the the stability of using an explicit scheme on the heat equation

Before I get to the heat equation I'd like to talk about the advection equation. Descritize that with FD in time and BD in space: \begin{equation} \dfrac{u^{n+1}_i - u^{n}_i}{\Delta t} + v \dfrac{u^{n}...
5k views

### Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

I've always had this question in mind (even if it may sound vague), but in my numerical analysis courses we've always learned how to analyze and optimize code. However, since most linear algebra ...
81 views

### Type of computer used for computation

In some scientific papers I see that authors provide what type of simulation tool and what type of computer was used for computation. For example: The computations were performed using MATLAB in ...
53 views

### Basis function in a tetraedron for finite elements contex

In the finite element method we need to know a base for the fem spaces. For example, a base for the space $P_1(\hat{K})=<\{1-x-y,x,y,z\}>$ is a typical base for the polynomials of degree less ...
10k views

### Why are higher-order Runge–Kutta methods not used more often?

I was just curious as to why high-order (i.e. greater than 4) Runge–Kutta methods are almost never discussed/employed (at least to my knowledge). I understand it requires greater computational time ...
185 views

### Term for the typical "linear in the larger dimension, quadratic in the smaller" cost for linear algebra

Many dense linear algebra decompositions (QR, SVD...) on an $m\times n$ matrix have cost $$O(\max(m,n)\min(m,n)^2)$$ when implemented in practice on a computer. Is there a colloquial name or a more ...
47 views

### Fortran: Can a procedure, contained in a module, call another procedure contained in the same module? [closed]

For instance, consider a module with the following general structure: ...
147 views

### Software and tutorial for FEM

i'm looking for some advice for finite element analisys. i'm a biomedical engineering student with few knowledge about the FEM. Tools like Comsol and Ansys are very powerfull but also complex and i ...
154 views

### Compile-time error control vs. interval arithmetic?

I use interval arithmetic for reliable computing. Now, a procedure coded in a good implementation of interval arithmetic takes perhaps about eight times as much as the same procedure carried out ...
60 views

### Compute 2D numerical double integration with Boost C++ with parameters

I am trying to compute the double Richardson and Wolf integrals for the focusing of a lens with Boost in C++ (using the Gauss Kronrod method). As a starting point, I used the example presented in this ...
26 views

### Astrophysics context : Introduction of a factor $\Delta\ell$ when summing equal distants $C_\ell$

I have the following formula which is the error on a $C_\ell$ : $$\sigma_(C_{\ell})=\sqrt{\frac{2}{(2 \ell+1)\Delta\ell}}\,C_{\ell}\quad(1)$$ where $\Delta\ell$ is the width of the multipoles bins ...
17 views

### How can this attempt to implement a Milstein numerical approximation for an Ito process of multiple components be fixed?

I have been reading Kloeden and Platen's Numerical Solution of Stochastic Differential Equations, and have more or less been trying to systematically complete the various exercises therein as I go ...
187 views

### Prescribing variables as an excitation in Runge-Kutta method

I am using Runge-Kutta to solve a $3 \times 3$ 2nd order linear ODE $$M x'' + C x' + K x = 0$$ and initial conditions are all zeros. Then I prescribe the 2nd variable to follow a given path. As for ...
40 views

### successive convex approximation and Convergence

In successive convex approximation method, can the solution be considered to be an acceptable solution if the algorithm reaches the maximum number of iterations without noticeable convergence? or it ...
58 views

### Change of random variables and check by plot

Question As a test, I transform a uniform distribution over the unit square. But when I check the transformed distribution with Monte Carlo, it is wrong. What went wrong? Thanks. Problem Random ...
23 views

### Sample Average Approximation vs. Numerical Integration

In the sense of the calculation of the expected value of objective functions, we have two choices to evaluate the value; 1. Sample Average Approximation (SAA): $$\frac{1}{N}\sum_{i=1}^N f(x,\xi^i).$$...
37 views

### elementwise function of low rank approximation

I recently ran into an interesting result. I have a matrix $D$ containing pairwise distances between all points in a dataset. This matrix is converted to a similarity matrix $S$ via an RBF kernel. ...
1k views

### Examples of numerical solution of stochastic differential equation(SDE)?

I want to simulate a nonlinear stochastic differential equation $${\rm d}X_t = f(X_t) {\rm d}t + g(X_t){\rm d}B_t$$ where $f,g \in C^{\infty}({\mathbb R}^n ,{\mathbb R})$ and $B_t$ is one-...
49 views

### What is the most common loss function used with collocation methods for differential equations

I was looking at the Cheney and Kincaid book (6th edition) on numerical methods, with respect to collocation method for differential equations. Now for linear systems of ODES, collocation is just a ...
38 views

### Adding a "cost term" to a linear regression, so solution values are minimized

I'm using Python's optimize.lsq_linear method to run a linear regression with the bounds set between 0% and 100% power usage. ...
2k views

### 2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
223 views

### Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make "A Thousand (Gaussian) Points of Light" )

For a finite object size diffraction simulator, I need to generate arrays which are the sum of thousands of instances of a Gaussian (or other) 2D kernel at centroids that will not fall in any ...
736 views

### Error in Simpson's 3/8 rule is higher than that of Simpson's 1/3 rule

For a given function $f(x)$, I have tried to find its numerical integral using Simpson's 1/3 and Simpson's 3/8 rules. I then compare the solution from the numerical quadratures to the analytical ...
114 views

### Project to nearest point on convex polyhedron

I have a point $y \in \mathbb{R}^d$ and a convex polyhedron $\mathcal{P}$ given as the intersection of half-spaces: \mathcal{P} = \{x \in \mathbb{R}^d \mid a_1 \cdot x \le b_1, \dots, a_n \cdot x \...
157 views

### Preconditioning vs. regularization

I used to be more of a numerical linear algebra and computational science person, but recently, I've crossed into stats and machine learning. For this discussion, let's focus on matrices that are not ...
35 views

### Best search algorithm for optimal weight factor in SOR method

I had written an algorithm that searches for the optimal weight parameter to be implemented in the successive-over relaxation (SOR) method which worked cleanly by vectorizing the interval and for ...
143 views

### How to generate the convolution of f(x, y) with a parametric function g(t), x(t), y(t) in Python? (Something better than this brute-force sum)

The answer to Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make "A Thousand (Gaussian) Points of Light" ) involves summing a 3D array over ...
119 views

### Getting euclidean distance between vector A and C without anyway of retrieving them when their distances with a common vector B is known

Motivation: My plan is to get the overall euclidean distance matrix for all the vectors in N number of dataset. Each dataset is basically an array of n-dimensional points. For e.g: A dataset can be ...