numerical

Code to solve determinant using Python without using scipy.linalg.det

Description(this is a hwk question): I am not sure where to start here. I plan to use Laplace's Expansion but I am not sure how to implement it for nxn matrices. Any help would be appreciated. Note: I already have a function to generate random matrices for a nxn matrix. Also the timing the calculation isn't a problem. The only thing I...

test if a decimal is sufficiently close to a rational number

Given a decimal x, I want to test if x is within 10^-12 of a rational number with denominator 9999 or less. Obviously I could do it by looking at x, 2x, 3x, and so on, and seeing if any of these is sufficiently close to an integer. But is there a more efficient algorithm? ...

Numerically Solving a Second Order Nonlinear ODE

Okay, I have this not so pretty 2nd order non-linear ODE I should be able to solve numerically. f''(R)+(2/R)f'(R)=(.7/R)((1/sqrt(f))-((0.3)/sqrt(1-f))), f'(0)=1, f(1)=1 I was thinking of breaking this guy up into a system of two first order ODE's and then solve, but I have no idea how to set this up. What method should I use to set up ...

UMFPACK and BOOST's uBLAS Sparse Matrix

I am using Boost's uBLAS in a numerical code and have a 'heavy' solver in place: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?LU_Matrix_Inversion The code works excellently, however, it is painfully slow. After some research, I found UMFPACK, which is a sparse matrix solver (among other things). My code generates la...

Emulating numerial operations in software

Hi, The numerical operations we do in our programs are limited by the number of bytes that a language specifies for a given datatype (or maybe hardware supports). Say I can use integer to do calculations on my paycheck (even "short" is more than enough for a year's earning!!! ;) ) but can't do the same with Bill Gates wealth. So, we go ...