All Questions

Filter by
Sorted by
Tagged with
-1
votes
1answer
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: ...
0
votes
0answers
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$$ ...
1
vote
1answer
314 views

Lower bound for bilinear form in FEM

I'm searching for lower bounds of bilinear forms arising in FEM for elliptic second order PDEs with mixed boundaries. I did some research and found: $$\max_{v_{h}\in\mathcal{V}_h(\mathcal{\Omega})}a(...
1
vote
0answers
91 views

Weird "oscillatory" modes appearing in FEM simulations

I am using COMSOL to solve a mathematical model involving thermoelectric hydrodynamic (TEMHD) flow. I am running a very large parameter sweep and using the solutions obtained to make some plots. ...
1
vote
2answers
121 views

Need software for generating self-avoiding random walks on a tetrahedral lattice

I am looking for FOSS code that can generate self-avoiding random walk trajectories on a tetrahedral lattice. The purpose of the exercise is to create random conformations of model polymer chains that ...
0
votes
0answers
27 views

shifting mass along a vector field

I have a positive matrix $\rho \in \mathbb{R}^{n,n}_+$ as a discrete probability density. Furthermore, I have a tensor $u \in \mathbb{R}^{n,n,2}$ that is constant in time and acts as a vector field. I ...
8
votes
1answer
4k views

Computational methods for finding the energy eigenvalues of the time-independent Schrodinger equation with arbitrary potential

I have seen in some papers that the energy levels in some arbitrary potential are specified. How can one find the energy levels in such arbitrary potentials. For example, $V(x)=\sin^2(x/2)$ with $x\in[...
3
votes
2answers
920 views

Convergence problem for Poisson equation with periodic BC

I have written Poisson solvers using two different methods: A classic Jacobi scheme and one using the multigrid solver Hypre. I made up a couple of test cases ensuring the validity of those solvers. ...
4
votes
2answers
519 views

Difference between MoM and FEM

Method of Moments and Finite Element Methods are two of the most used methods in computational electromagnetics to solve electromagnetic equations. As it is known, in FEM sparse matrixes are used ...
4
votes
0answers
70 views

Global reconstruction defined elementwise in a-posteriori error estimator

This question is a follow-up of this previous one. In "Error Control for Discontinuous Galerkin Methods for First Order Hyperbolic Problems" by Georgoulis et al., an error estimator is ...
1
vote
1answer
253 views

Numerical solution of non-linear heat-diffusion PDE using the Crank-Nicolson Method

I am trying to solve numerically the following 1D EBM: $C\frac{\partial T[x,t] }{\partial t} - \frac{\partial }{\partial x}\left ( D(1-x^2)\frac{\partial T[x,t] }{\partial x} \right ) + I[T] = S[x,t](...
2
votes
1answer
81 views

Bounds for the optimal bandwidth of 2D/3D FEM stiffness matrices

is anyone here aware of whether there exist bounds on the optimal bandwidths of 2D/3D FEM stiffness matrices? Edit: more specifically, I would like to have bounds on the minimum bandwidth after ...
2
votes
1answer
67 views

Dividing a continuous domain into small squares; how to perform storage and querying?

I recently had a software engineering interview and was asked a series of questions that was a bit outside of knowledge realm, and I feel like there's some scientific computing principles here (I took ...
1
vote
1answer
73 views

What is the conventional approach for sparse matrix multiplication?

When you're multiplying sparse matrices against other sparse matrices or dense matrices, what is the conventional approach for each? How are the sparse matrices stored? What does matrix multiplication ...
18
votes
1answer
2k views

How to Run MPI-3.0 in shared memory mode like OpenMP

I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays ...
3
votes
4answers
142 views

Solving the eigenvalue from a set of coupled second order differential equation numerically

I met a problem in solving a set of coupled differential equation, as shown below: $$A_1\psi_1(z)+A_2\frac{d^2\psi_1(z)}{dz^2}+A_3\frac{d\psi_2(z)}{dz}=\lambda\psi_1(z)$$ $$A_4\psi_2(z)+A_5\frac{d^2\...
3
votes
1answer
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 ...
0
votes
1answer
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$ ...
6
votes
1answer
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 ...
0
votes
1answer
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 ...
1
vote
0answers
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}...
24
votes
8answers
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 ...
3
votes
1answer
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 ...
0
votes
2answers
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 ...
22
votes
5answers
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 ...
5
votes
2answers
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 ...
0
votes
2answers
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: ...
1
vote
2answers
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 ...
6
votes
1answer
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 ...
1
vote
1answer
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 ...
0
votes
0answers
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 ...
1
vote
0answers
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 ...
1
vote
1answer
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 ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
1
vote
0answers
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). $$...
1
vote
0answers
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. ...
7
votes
2answers
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-...
0
votes
0answers
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 ...
2
votes
0answers
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. ...
3
votes
1answer
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 ...
3
votes
3answers
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 ...
2
votes
1answer
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 ...
2
votes
1answer
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 \...
3
votes
1answer
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 ...
0
votes
1answer
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 ...
1
vote
1answer
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 ...
0
votes
0answers
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 ...
0
votes
1answer
55 views

Does the leap-frog algorithm conserve energy for n-body problems?

The leap-frog algorithm is able to conserve to a certain extent the energy of a system, which flucutates as a cosine around a stable value. Is this true if we apply the algorithm to a n-body ...
0
votes
0answers
37 views

Use of 7-node rectangular serendipity element

I am would like to use 8-node quadrilateral serendipity elements to model a problem. However it seems to me that mid-nodes are not required at the boundary, as shown in the diagram below i.e. elements ...

15 30 50 per page