16

If you want something open-source, you probably want to try COIN's CBC code (they also have a couple other MILP solvers, like a branch-and-price framework, or SYMPHONY). Gurobi and CPLEX will be considerably faster, and as of the 2011 or 2012 INFORMS meeting, Gurobi was faster than CPLEX (though the performance metrics are of course problem dependent). On ...


11

I would say that there are a number of reasons why there are no computational science contests besides the potentially massive computational resources required. Time limits: Writing scientific computing code is usually not something that you want to rush. A lot of emphasis is on making sure it is correct, and thorough consideration of test/corner cases. ...


11

I maintain (and am the main coder of) a simulation software that has been developed for ~8 years and is used by few hundreds people. It all started as a side project during my PhD, and it clearly outgrew itself. It is both over- and under-engineered: the architecture of some parts is too complicated for their own good, whereas some other parts (whose ...


10

I'll give you my perspective, which is encoded in the deal.II project that you reference. First, there are two kinds of error conditions: Errors that can be recovered from, and errors that can not be recovered from. The former is, for example, if an input file can't be read -- for example if you are reading information from a file such as $HOME/.dealii ...


10

"developers lack the skills". Maybe. I think it's much more likely that the developers lack the incentives. Making solid code is difficult and expensive and, in academia, comes with minimal-to-negative reward. You're asking for a list of things of guidelines, but all of your examples are specific to the technical situation, not the social situation. That'...


9

In general, I'd say the following open source tools tend to be (roughly) best-of-breed, in the following order: PETSc has implemented a number of ODE solvers as part of TS, its time-stepping routines. There are a number of integrators implemented, including ARKIMEX, EIMEX, Rosenbrock-W, Crank-Nicolson, backward Euler, several Runge-Kutta methods (including ...


9

One of the authors of fenics, A. Logg, have written a very good paper on datastructures of storing meshes. The paper is A. Logg (2009). Efficient Representation of Computational Meshes http://arxiv.org/abs/1205.3081 In fact it's always a tradeoff between storing all the topological informations (nodes around nodes, faces around nodes, etc...) OR having to ...


8

Mixed integer linear programming problems are much harder to solve than linear programming problems. In terms of computational complexity, LP's can be solved in polynomial time while solving MILP is an NP-Hard problem. The known algorithms for solving MILP's have exponential worst case complexity. There are other software packages for mixed integer ...


8

I would suggest that a full database may be overkill for your purposes, though it would certainly work. Even $5 \cdot 10^5$ rows should be no more than around 25mb of data. I would strongly recommend doing the analysis/plotting/etc with the same tool that you will use for querying your data. It is my experience that when changing what to analyse only takes ...


8

In deal.II, we basically only use vectors. Maps are too slow and scatter data all around memory, so we typically don't use them if the keys are integers and within a given range. For example, for the connectivity between cells, you can do arrays (STL vectors) in which you store neighbor indices and so that neighbor indices $4i\ldots 4i+3$ correspond to cell $...


8

You can try Geogebra (it is free). With SolveODE command and sliders you can do what yo want. For the usage of SolveODE command see. For example by using following command SolveODE[ <f'(x, y)>, <Start x>, <Start y>, <End x>, <Step> ] with SolveODE[A + B y + C sin(y), l, m, 10, 0.1] I got the solution curve below. You can vary ...


7

Almost everything you can build and install in your own space. With GNU autotools, you can do something like ./configure --prefix=/path/to/your/work/space ... and then follow the usual compilation instructions. Things based on CMake and Scons have similar facilities.


7

Assuming that your kernel is somewhat smooth, use low-rank approximation. Here's a naive example: import numpy as np N=2000 input=np.random.random(N) x=np.linspace(-1,1,N) y=np.linspace(-2,2,N) X,Y=np.meshgrid(x,y,sparse=True) A = np.exp(1j*2*np.pi*X*Y) output = np.dot(A, input) U,S,V = np.linalg.svd(A) # find truncation rank for given tolerance k = ...


7

You can calculate GFLOP rates this way, but the numbers are pretty meaningless on today's hardware: Floating point operations require a variable number of clock cycles. An addition is generally cheaper than a multiplication, but each generally takes more than one clock cycle of the 2.8 billion cycles you quite. When you have hyperthreading, you have two ...


6

If you want to try a bunch of different solvers, give Julia's JuMP modeling framework a try. It lets you write your model as a JuMP model, and then switch out the solvers with one line of code. For example, for MILP problems you can choose from the Bonmin, Cbc, Couenne, CPLEX, GLPK, Gurobi, and MOSEK solvers. Because of this, if you write it in JuMP, you can ...


6

All of the major finite element libraries (such as libMesh; FEniCS; or the project I run, deal.II) provide you with ready access to the system matrix and or any other matrices you need. They typically also have tutorials and examples from a wide variety of areas (e.g., structures, fluids, etc) that you can use to generate examples. Maybe a simpler first ...


6

Why not give GMPY2 a try? From the introduction: gmpy2 is a C-coded Python extension module that supports multiple-precision arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module only supported the GMP multiple-precision library. gmpy2 adds support for the MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly ...


5

For my work, I tend to have programs output a sequence of still images, and I then convert them to an animated format in a post-processing step. To make a video, I use ffmpeg (http://www.ffmpeg.org/); to make a .gif, I use imagemagick (http://www.imagemagick.org/). Both of these tools are easy to script from the command line. There are numerous tutorials ...


5

I highly recommend using a tool such as Sumatra for this. I used to have a similar "pedestrian" approach to yours for keeping track of many simulation runs with varying parameters, but in the end it just becomes a huge mess because it's next to impossible to design such an ad-hoc approach correctly upfront and to anticipate all the use cases and extensions ...


5

This is possible in C++ via expression templates. Section 1.9 of this technical report addresses your question.


5

It depends on how quad precision is implemented. If you want to implement it as "traditional" floating point numbers with sign, mantissa, and exponent (the latter two just having more than the normal 53 and 10 bits of double precision), then doing this on a processor that doesn't natively support it, is going to be pretty expensive because it will involve a ...


5

If you just want the computational results and aren't running benchmarking tests then this isn't a serious problem. If you're trying to benchmark the performance of the code and get repeatable run times for comparisons with a an alternate version of the code, then this can be an issue.


5

Here is a simple (Matlab) Newton method as a first attempt to help get started. It finds 1087 roots with error below $10^{-11}$. f = @(x) ((2*x)./(x.^2-1)) - tan(x); fp = @(x)-tan(x).^2+2.0./(x.^2-1.0)-x.^2.*1.0./(x.^2-1.0).^2.*4.0-1.0; x0 = 0; for jj = 1 : 1200 %number of iterations to find some roots x0 = x0 + (jj-1)*(jj/10^4); %take previous ...


4

The clear answers if you want to keep Fortran speed are to use a language which has proper code generation like Julia or C++. C++ templates have already been mentioned, so I'll mention Julia's tools here. Julia's generated functions let you use its metaprogramming to build functions on demand via type information. So essentially what you can do here is do @...


4

There is a lot of food for thought in this question. I would like to differentiate a bit with respect to the character of the contests. The subject of contests I know is fairly inconsequential. There are spelling bees, when it comes to mathematics, there are contests in symbolic integration, marshmallow eating contests and beauty pageants. You rarely hear ...


4

You could just write an edit, compile, run loop in shell or Python that does it directly in the .h file if you think hard-coding this value is likely to give the compiler an advantage. If the runs are short enough, it ought to be straightforward to iterate over all values of batch_size in a reasonable range.


4

I think the basic ideas behind this question are extremely valuable (the question should be made a bit more precise, though), and it'd be nice to see an answer in a community wiki-style format, with a list of software and a short explanation of each item. Below, however, are my ramblings and personal experiences. 2D animations As you are already aware, ...


4

By Clp, I assume that you're referring to the linear programming code that is part of the COIN-OR project: http://www.coin-or.org/Clp/ Clp's primal and dual simplex codes aren't multithreaded so even if you call Clp from within a multithreaded program in Julia, each LP will be solved by a single thread. It is possible to use the primal-dual interior point ...


4

OK- so you're trying to maximize a concave function which is piecewise linear, and you can evaluate the function and get a subgradient at any desired point. This is equivalent to minimizing a convex non-differentiable function using only function and subgradient evaluations (just minimize minus the objective function.) You should read the papers by Yuri ...


4

You can use DifferentialEquations.jl Online to visualize solutions to differential equations without a hassle. It's built using the Julia suite DifferentialEquations.jl, and the online interface is a subset of features which includes explicit parameters and visualization. Here's an example of your equation, assuming that l was the initial time point and ...


Only top voted, non community-wiki answers of a minimum length are eligible