Most Popular

1500 questions
12
votes
2 answers

Computation of Cholesky factor

So the Cholesky decomposition theorem states that that any real symmetric positive-definite matrix $M$ has a Cholesky decomposition $M= LL^\top$ where $L$ is a lower triangular matrix. Given $M$, we already know there are fast algorithms to…
smilingbuddha
  • 645
  • 5
  • 10
12
votes
2 answers

Numerical Integration - handling NaNs (C / Fortran)

I am dealing with a tricky integral that exhibits NaNs at certain values near zero and at the moment I am dealing with them quite crudely using an ISNAN statement which sets the integrand to zero when this occurs. I have tried this with the NMS…
Josh
  • 253
  • 1
  • 6
12
votes
2 answers

Is there an open source set of ODE solvers for C that use the native C99 complex type?

I've been using GSL as the foundation of many of my simulations, but it's a little bit overkill for my purposes and it defines its own complex type for legacy reasons. Rather than code my own Runge-Kutta ODE solver, which would probably not be very…
qubyte
  • 491
  • 4
  • 15
12
votes
2 answers

Why are systems with clustered eigenvalues easy to solve?

I came across the following slide by Theo Diamandis & Zachary Frangella on what makes the linear system $Ax=b$ easy to solve using the conjugate gradient method. Transcription: CG converges quickly when The condition number of $A$ is small The…
Yaroslav Bulatov
  • 2,655
  • 11
  • 23
12
votes
2 answers

Faster Logistic Function

I've noticed that a fairly significant number of cycles in one of my programs are being consumed by the logistic function: $$f(x)=\frac{1}{1+e^{-x}}$$ Is there a good approximation I can use to reduce the cost of this function?
Richard
  • 3,961
  • 13
  • 34
12
votes
1 answer

What are the usual steps and checks involved in upgrading a Scientific Computing code, if there is any?

I'm soon going to start a job as a Scientific Computing software developer. My responsibilities as discussed with the manager are as follows: Analyzing/understanding the existing functionalities (numerical algorithms and physical models) in the 2nd…
Dude
  • 580
  • 3
  • 14
12
votes
6 answers

How do compression algorithms compress data so fast?

I've come across compression algorithms, I tried creating a simple run-length encoding algorithm but I notice that when I searched other algorithms I was shocked to know that some algorithms can process thousands of megabits per second how is this…
gushkash
  • 153
  • 1
  • 4
12
votes
6 answers

What open source tools are available to visualize molecular vibrations?

I would like to visualize a molecular vibration that is not a normal mode. I'd like to present a static, vectorial representation of the motion, and I would like some flexibility in the vector style (size, color etc). I'm also interested in…
Yann
  • 852
  • 6
  • 17
12
votes
4 answers

Arbitrary Accuracy Scalable Rope Simulation

I am trying to simulate a rope object. The formulation I understand is an array of particles, connected by springs. These springs have very large k-values, so that the line deforms, but stretches very little. I have concluded that solving this as…
geometrian
  • 223
  • 1
  • 6
12
votes
1 answer

Algorithms for Large Sparse Integer Matrices

I'm looking for a library that performs matrix operations on large sparse matrices w/o sacrificing numerical stability. Matrices will be 1000+ by 1000+ and values of the matrix will be between 0 and 1000. I will be performing the index calculus…
jgonagle
  • 123
  • 4
12
votes
8 answers

What programming language should I choose and why?

I am a mechanical engineer, intermediated/advanced level in MATLAB and MATHEMATICA, and beginner in Python. I intend to get a PhD in aeroelasticity (FEM + CFD) and coding my own program. I intend to do that because I really like to code and it is a…
12
votes
1 answer

How to integrate polynomial expression over 3D 4-node element?

I want to integrate a polynomial expression over a 4-node element in 3D. Several books on FEA cover the case where integrating is performed over an arbitrary flat 4-noned element. The usual procedure in this case is to find Jacobi matrix and use…
danny_23
  • 501
  • 2
  • 7
12
votes
2 answers

Efficient preconditioner for Augmented Lagrangian

I want to solve a non-linear problem with non-linear equality constrains and I'm using a augmented Lagrangian with a penalty regularization term that, as well known, spoils the condition number of my linearized systems (at each Newton iteration I…
Tom
  • 465
  • 4
  • 14
12
votes
4 answers

Should benchmarkings be done at all? What is the point?

I am reading a paper which compares algorithm A versus algorithm B. It shows that algorithm A is faster than algorithm B via benchmarking that shows the CPU time. What is the point of this? Any benchmarking is going to be dependent on the particular…
efwpf
  • 121
  • 2
12
votes
2 answers

What is the most efficient way to write 'for' loops in Matlab?

I have read that if, for example, I have a double for loop that runs over the indexes of a matrix, then putting the column running index in the outer loop is more efficient. For example: a=zeros(1000); for j=1:1000 for i=1:1000 a(i,j)=1; …
TensoR
  • 163
  • 1
  • 8