|
From: Dmitrey <dmi...@uk...> - 2012-07-30 16:12:09
|
Hi all, recently I have implemented some new functionality for the free geometric software SpaceFuncs <http://openopt.org/SpaceFuncs> and would like to introduce a couple of optimization examples with Olympic rings, devoted to the Olympic games - 2012, that are going on now. They are valid for upcoming <http://openopt.org/coming> version of SpaceFuncs <http://openopt.org/SpaceFuncs> only (already available in subversion repository). In similar way you can solve systems of linear/nonlinear geometrical (in any space dimension) equations (see OpenOpt SLE <http://openopt.org/SLE> and SNLE <http://openopt.org/SNLE>). Graphical output is powered by matplotlib <http://matplotlib.sourceforge.net/>. 1. Let's search 5 points (1 from each ring) that form polygon with maximum area. Code is here <http://openopt.org/SpaceFuncsDoc#An_example_with_olympic_circles> (or here <http://trac.openopt.org/openopt/browser/PythonPackages/SpaceFuncs/examples/maxArea.py>). max area 2. Well, (1) was quite easy problem that could be done by many ways with many different software. Let's consider more difficult example. Suppose we have several points with different positive or negative weights and would like to place them in the olympic circles so that their centroid (barycenter) would be as close to a target as possible; let's also demand distance between any 2 points has to be no less than 0.15. It is difficult combinatorial optimization problem - each point may belong to one of 5 circles, so number of possibilities is 5^m, where m is number of points; moreover, we have m * (m-1) / 2 difficult nonlinear nonconvex equality constraints (requirements on distances). Fortunately, OpenOpt has awesome solver interalg <http://openopt.org/interalg>, that easily solves this problem (for quite small m, although), moreover, with specifiable accuracy fTol: abs(f-f*) <= fTol; we will consider 3 points of weights [15, -0.15, 3]. Code is here <http://openopt.org/SpaceFuncsDoc#Another_example_with_olympic_circles> (or here <http://trac.openopt.org/openopt/browser/PythonPackages/SpaceFuncs/examples/centroid.py>) centroid Best wishes for you country in the Olympic games, D. ------------------------------------ http://openopt.org/Dmitrey |