All Questions

Filter by
Sorted by
Tagged with
17
votes
1answer
3k views

Drawbacks of Newton-Raphson approximation with approximate numerical derivative

Suppose I have some function $f$ and I want to find $x$ such that $f(x)\approx 0$. I might use the Newton-Raphson method. But this requires that I know the derivative function $f'(x)$. An analytic ...
6
votes
3answers
256 views

efficiently solving a low rank linear parametric systems?

I have a large number of systems of the form: $Ax=b_i$ To solve for a large numbers of such $b_i\;1\leq i \leq k$ but where $A$ is fixed (A is a rank $p$ general --i.e. non sparse, non PSD-- ...
3
votes
1answer
212 views

Different kinds of Integral Equation Methods

I am relatively new to integral equations for solving time-harmonic EM scattering problems. I have read a decent number of papers on the subject, and it seems that for formulations that can support 3D ...
3
votes
2answers
386 views

Get equation for a curve which intersects x at seemingly randomly distributed points?

Is there any type of function that when graphed would show a curve which intersects the x axis multiple times, with each point being an arbitrary distance from the last? I mean, not like a trig ...
7
votes
5answers
9k views

Interpolate 2D data

I generated a cartesian grid in Python using NumPy's linspace and meshgrid, and I obtained some data over this 2D grid from an ...
8
votes
4answers
8k views

Is there an in practice limit on the number of constraints on a linear programming problem?

I am new to linear programming and have formulated a linear program (LP) with order of $10^{13}$ variables and $10^{13}$ constraints, although the constraint matrix is extremely sparse. I wanted to ...
15
votes
1answer
1k views

How to numerically calculate residues?

I need to calculate the following integral: $$ {1\over 2\pi i} \int_C f(E) \, d E $$ $$ f(E) = {\rm Tr}\,\left(({\bf h} + E)\,{\bf G}(E) \right) $$ Where $\bf h$ is a matrix (one particle kinetic and ...
7
votes
3answers
783 views

How to handle large numbers of output data sets from a simulation/sensitivity analysis?

Somewhat related, but I think the question is distinct enough to justify a separate question. As a bit of background, I come from a observational/statistical Epidemiology background, working with ...
34
votes
8answers
854 views

How do I make sure that the results of my simulations and the results in my paper are always in sync?

In one of my papers, I list some numerical results in addition to some figures. What I'd like to do is make sure that the numerical results in my paper always agree with the code. Right now, I just ...
5
votes
2answers
4k views

Specifying boundary conditions for imported mesh in OpenFOAM

I have a mesh produced from scanning a real 3D object (I don't have a geometry). What is the most convenient way to specify inlets, outlets, etc. for CFD in OpenFOAM? The mesh consists of thousands of ...
9
votes
3answers
3k views

How do I know if my code is being vectorized by the compiler?

As exemplified by Jed Brown's answer to Costs of lookups versus calculations, using vectorized vs non-vectorized floating point operations results in much faster code. Many modern compilers claim ...
3
votes
1answer
791 views

Where can I find coded examples of stochastic collocation applied to an elliptical PDE using smolyak sampling?

I'm having some troubles implementing a collocation method to solve a stochastic partial differential equation of the form: $\nabla (a(x,w)\nabla u(x,w))=f(x,w)$ in $D$, $u=g$ in $\partial D$ where $...
2
votes
1answer
77 views

Computing a sequence of row interchanges that realizes a given permutation matrix?

This question is aimed at cleaning up an implementation detail of an in-house sparse direct solver. It uses METIS to reorder $A$ into $PAP^{T}$ for reduced fill-in. Inside the $Lx=b$ and $L^{T}x=b$ ...
16
votes
2answers
7k views

Null-space of a rectangular dense matrix

Given a dense matrix $$A \in R^{m \times n}, m >> n; max(m) \approx 100000 $$ what is the best way to find its null-space basis within some tolerance $\epsilon$? Based on that basis can I then ...
4
votes
1answer
287 views

Should I include integral constraints in a integer linear program with a totally unimodular constaint matrix?

I have formulated an integer linear program (ILP). The constraint matrix for the ILP is totally unimodular. Should I solve it as an LP without the integral constraints, or should I keep the integral ...
3
votes
2answers
894 views

How to detect key turning points on a driven road?

I am looking for a description of algorithm which allows me to detect key turning points on the road amongs a set of all given points. I've ilustrated my problem on the below image: Green spots: ...
4
votes
1answer
251 views

Defining electric current source excitations for surface integral equation formulations

In a finite difference (FD) based electromagnetic formulation based on a Yee cell grid, one can define electric current source excitations ($J$) on the $E$ field grid points. At a distance, the fields ...
9
votes
2answers
158 views

Predict runtimes for dense linear algebra

I would like to predict runtimes for dense linear algebra operations on a specific architecture using a specific library. I would like to learn a model that approximates the function $F_{op} \;::\; $...
3
votes
1answer
561 views

Quality open source AMR libraries [duplicate]

Possible Duplicate: Is there a general-purpose library for structured grid adaptive mesh refinement? I'm looking for a quality, open source, maintained, scalable automated mesh refinement library ...
29
votes
4answers
2k views

What tools or approaches are available to speed up code written in Python?

Background: I think I might want to port some code that calculates matrix exponential-vector products using a Krylov subspace method from MATLAB to Python. (Specifically, Jitse Niesen's expmvp ...
4
votes
2answers
1k views

Line search for Newton method

If we want to solve nonlinear minimization problem $$\min_{x} f(x),$$ making least-squares assumption and using Gauss-Newton method so that at k$th$ iteration we have: $$J_k^T J_k p_k = - J_k^T ...
18
votes
5answers
2k views

Parallel Scientific Computation Software Development Language?

I want to develop a parallel scientific computation software from scratch. I want some thoughts on which language to start. The program involves reading/writing data to txt files and doing heavy ...
4
votes
1answer
346 views

Memory footprint for DMDA objects in PETSc

Why does DMDA objects require so much memory on PETSc 3.2-p7. When running the code: ...
5
votes
1answer
375 views

Intersection of hyperplanes

A very basic question but i couldn't find another post about it: Given $p$ non parallel hyper-plane in $\mathbb{R}^p$: $\left(\begin{array}{cccc} c_{11} & a_{11} & .... & a_{1p} \\ ... &...
2
votes
2answers
325 views

I don't understand how to correctly calculate truncation error

I am looking at the finite difference methods to solve simple $u_t=a(x,t)u_{xx}$. There are explicit, implicit, Crank Nicolson. The latter is said to be more accurate since the local truncation ...
3
votes
2answers
469 views

When fitting a Gaussian-like function, how does the amount of baseline datapoints affect the fit?

I am fitting a curve to some instrument data. The data is a pulse with a particular functional form, which starts from and returns to a constant (with noise) baseline level before and after the pulse. ...
25
votes
3answers
49k views

How should I install a Fortran compiler on a Mac? (OS X 10.x, x >= 4)

Related question: State of the Mac OS in Scientific Computing and HPC A significant number of software packages in computational science are written in Fortran, and Fortran isn't going away. A ...
12
votes
1answer
375 views

Costs of lookups versus calculations

I am interested in setting up calculations to check if a distance criterion is satisfied: that is, the distance between a vector ${\bf x}_i$ and anther vector ${\bf x}_j$ should be less than some ...
13
votes
3answers
4k views

Single versus double floating-point precision

Single precision floating point numbers take up half the memory and on modern machines (even on GPUs it seems) operations can be done with them at almost twice the speed compared to double precision. ...
10
votes
3answers
3k views

How to build a recursive spline function in C++

At the moment I am working on a differential equation solving method called basis-spline collocation. What I am having trouble with is building a method to build an arbitrary order spline, with the ...
7
votes
3answers
245 views

Wanting to learn about matrix solvers

Edit: I was advised to replace the question with a more specific one. Coming from a very theoretical background, I'm pretty ignorant about what practical matrix solvers exist. (I have been, and will ...
8
votes
1answer
816 views

How to calculate the maximal ellipsoid in a given polyhedron

I am faced with the problem of finding the ellipsoid $B$ ($B$ is a symmetric positive definite matrix) of maximal volume within a convex set $C$ given as a set of linear inequalities $C=\{x| a_i^T x \...
11
votes
1answer
4k views

Algorithms for community detection for bipartite graphs?

Are there any algorithms for community detection for bipartite graphs (2-mode networks) implemented in igraph, networkX, R or Python etc.? In particular, is there such an implementation in which one ...
3
votes
1answer
1k views

Can gsl be compiled with the intel C compiler?

The library itself compiles just fine with icc, but when I try to link to it (using icc for both the driver code and the linker), I get the same error that this question on stackoverflow is asking ...
8
votes
1answer
338 views

Is the sparsity pattern of a linear system important for iterative (KSP) solvers?

Pretty much the question. Given a general sparse, non-symmetric (both numerically and structurally) matrix, how important is the sparsity pattern (i.e. row/column permutation of matrix/vector) for ...
4
votes
1answer
73 views

Migdal Recursion and Mathematica

I am studying $SU(2)$ lattice field theory, and I am attempting to use migdal recursion for renormalization. The main equation for Migdal recursion for my case is $$e^{-S_p(U,\lambda a)}=\left[ \...
12
votes
2answers
2k views

Newton-based methods in optimization vs. solving systems of nonlinear equations

I asked for clarification about a recent question about minpack, and got the following comment: Any system of equations is equivalent to an optimization problem, which is why Newton-based methods ...
2
votes
3answers
388 views

How to add back integral constraints to linear program solution

I am implementing a machine learning algorithm for which I need to solve an integer linear program. To get the solution in polynomial time, the authors of the algorithm have dropped the integral ...
0
votes
1answer
2k views

1d shock tube problem, and the solution [closed]

I have solved 1d shock tube problem. (Euler's equations). Using following steps: 1) Define Riemann problem over the domain 2) Carry out local linearisation 3) Based on linearisation, write eigen ...
8
votes
2answers
4k views

structured grid and unstructured grid

I am new to the field of CFD. When should one go for structured grid and when should one go for unstructured? (Yes, it depends a lot on the geometry of the problem) More specifically, I want to know ...
15
votes
2answers
1k views

(how to) write simulations that run faster?

I have started using python as the programming language for doing all my assignments in CFD. I have a very little experience in programming. I am from mechanical engineering background and am pursuing ...
7
votes
1answer
351 views

Numerical solution of hyperbolic PDEs with nonconvex flux

In some hyperbolic PDEs the flux is nonconvex. One example is equations in magnetohydrodynamics. What are the complications in the wave structures of such problems? What general precautions one should ...
1
vote
0answers
99 views

Anisotropic cover with n-cuboids

I'm working on an algorithm for which I would like to cover an $n$-dimensional unit cube by a set of $n$-cuboids (i.e., $n$-dimensional rectangles). The size and orientation of these cuboids is ...
8
votes
2answers
6k views

Solving non-linear singular ODE with SciPy odeint / ODEPACK

I want to solve the Lane-Emden isothermal equation [PDF, eq. 15.2.9] $$\frac{d^2 \!\psi}{d \xi^2} + \frac{2}{\xi} \frac{d \psi}{d \xi} = e^{-\psi}$$ with the initial conditions $$\psi(\xi = 0) = 0 \...
10
votes
2answers
2k views

Euler equations in 2d

As an assignment in college, I did a 1d simulation. The problem statement was to solve 1d shock tube problem involving compressible ideal gas as working fluid. For this problem, I solved system of ...
3
votes
2answers
624 views

Entropy fix for godunov scheme

For non linear system of hyperbolic PDE, The finite volume methods work well (because of inherent conservation). Godunov scheme is a very elegant solution philosophy. For linear system, it is nothing ...
6
votes
1answer
807 views

The speed and memory requirement of minpack

I am considering minpack software package to solve my optimization problem ( this is the kind of question that I am facing), but I don't quite know what is the memory requirement and the speed of this ...
9
votes
1answer
324 views

Solving a system with a small rank diagonal update

Suppose I have the original large, sparse linear system: $A\textbf{x}_0=\textbf{b}_0$. Now, I do not have $A^{-1}$ as A is too large to factor or any sort of decomposition of $A$, but assume that I ...
2
votes
0answers
89 views

Estimating the maximum absolute value (magnitude) of the Laplacian for a given function?

As motivation, consider a function which is smooth and continuous but for some reason it is very expensive to perform routine calculations of finding the Laplacian on it (maybe because it is over a ...
7
votes
3answers
664 views

Solving shifted linear systems with LU factorization

I am interested in solving a sequence of shifted linear systems $(A+\sigma I)x = b$ for various values of $\sigma$. The matrix $A$ is sparse and not too large, so I have its LU factorization available....

15 30 50 per page