Most Popular

1500 questions
9
votes
2 answers

What does the priority of a PBS job really mean?

The qsub command which submits PBS jobs has a -p option that allows you to set the priority. From the man page: Defines the priority of the job. The priority argument must be a integer between -1024 and +1023 inclusive. The default is no priority…
David Z
  • 3,383
  • 2
  • 27
  • 34
9
votes
1 answer

What numerical quadrature to choose to integrate a function with singularities?

For example, I would like to numerically compute the $L^2$-norm of $\displaystyle u = \frac{1}{(x^2+y^2+z^2)^{1/3}}$ in some domain that includes zero, I tried Gauss quadrature and it fails, it is kinda far from the real $L^2$-norm on the unit ball…
Shuhao Cao
  • 2,552
  • 17
  • 30
9
votes
5 answers

How to efficiently compute the determinant of a matrix with unknown diagonal entries?

I would like to ask Python to compute the determinant of a large symmetric matrix where all off diagonal entries are known. The diagonal entries could vary. Since I need to compute the determinant many times with different diagonal entries, it seems…
9
votes
1 answer

Why is it that SVD routines on nearly square matrices run significantly faster than if the matrix was highly non square?

In Python / Matlab, if you run a routine for SVD on a significantly non-square matrix, X, such as X.shape = (2,15000) you will get significantly longer run time than on a matrix with X.shape = (800,1000), even though 2*15000 = 30000, and…
tisPrimeTime
  • 203
  • 1
  • 6
9
votes
3 answers

More stable algorithm to calculate `sqrt(a^2 + b^2) - abs(a)` in MatLab

Suppose we want to calculate $\sqrt{a^2+b^2}-|a|$ in MatLab. Using sqrt(a^2 + b^2) - abs(a) will have some problems: If a or b are too large, it may cause overflow if a and b are too small, it may cause underflow if a>>b, a^2 + b^2 may be equal to…
Ferran Gonzalez
  • 125
  • 1
  • 6
9
votes
6 answers

What are good particle dynamics ODEs for an introductory scientific computing course?

I'm teaching an introductory course on scientific computing (programming in C/C++) and am looking for application problems which the assignments can be centered around. I'm thinking of ODEs for particle dynamics $$x_i'(t) = u(x_i, y_i, t), \quad…
Jesse Chan
  • 3,132
  • 1
  • 13
  • 17
9
votes
2 answers

Is there an algorithm or graph theory that allows me to not need to store an intermediate matrix when calculating AT*Y1*A + BT*Y2*B?

I have a system of conductors for which there are two dense matrices of the (complex) mutual admittances, $Y_A$ and $Y_B$, which are symmetric. Then, an equivalent nodal admittance matrix $Y_N$ is calculated by the following: $$ Y_N = A^T \cdot Y_A…
9
votes
2 answers

Efficiently estimating trace of a product of matrices

I have $d\times d$ real-valued matrices $A_1,\ldots,A_k$, $1000
Yaroslav Bulatov
  • 2,655
  • 11
  • 23
9
votes
1 answer

How to find the smallest ellipse covering a given fraction of a set of points?

I have a set of points $P$ and want to find the ellipse with the smallest area that covers at least a fraction $f$ of these points. How can I do this? These questions ask the same thing, but folks have only provided approximate answers. This…
Richard
  • 3,961
  • 13
  • 34
9
votes
1 answer

Is there a way we can compute my sum involving `subsets` more efficiently?

Suppose we have a countably infinite $A$ and $F_1,F_2,\cdot\cdot\cdot$ are an infinite sequence of finite sets (denoted $\left\{F_n\right\}_{n=1}^{\infty}$) such that $\bigcup\limits_{n=1}^{\infty}F_n=A$, $F_1\subset F_2\subset \cdot\cdot\cdot$ and…
Arbuja
  • 53
  • 7
9
votes
1 answer

How to solve a second order differential equation (diffusion) with boundary conditions using Python

I am having trouble implementing a model from a publication. Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625 scihub link: https://sci-hub.se/10.1021/ie030109q I want to model the diffusion of bisulfate through a…
icantcode
  • 91
  • 3
9
votes
2 answers

How to choose a basis set for ab-initio evaluations ?

How do I pick a basis set for an ab-initio Hartree-Fock evaluation ? In other words, what are the important characteristics of a basis set so that a proper choice can be made ?
Stefano Borini
  • 1,599
  • 3
  • 16
  • 20
9
votes
2 answers

numerical integration with possible division by 'zero'

I am trying to integrate $$\int^1_0 t^{2n+2}\exp\left({\frac{\alpha r_0}{t}}\right)dt$$ which is a simple transformation of $$\int^{\infty}_1 x^{2n}\exp(-\alpha r_0 x)dx$$ using $t = \frac1{x}$ because it is difficult to numerically approximate…
drjrm3
  • 2,139
  • 2
  • 19
  • 22
9
votes
1 answer

Nested dissection on regular grid

When solving sparse linear systems using direct factorization methods, the ordering strategy used significantly impacts the fill-in factor of non-zero elements in the factors. One such ordering strategy is nested dissection. I am wondering if it is…
Victor Liu
  • 4,480
  • 18
  • 28
9
votes
3 answers

Who uses finite elements with higher continuity?

Lagrange elements of any polynomial describe piecewise continuous functions. Typically, those functions are differentiable. Mixed finite element methods use vector fields of even less continuity, such as normal continuity. With some great…
shuhalo
  • 3,660
  • 1
  • 20
  • 31