Difference between revisions of "Evolving shapes/en"
(4 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
---- | ---- | ||
+ | |||
+ | <h2>Source code</h2> | ||
+ | |||
+ | '''CVS repository RELEASE version''' [http://webcvs.robotika.sk/cgi-bin/cvsweb/evodesign/RELEASE] | ||
+ | |||
<h2>Literature & Links</h2> | <h2>Literature & Links</h2> | ||
Line 150: | Line 155: | ||
0.4 per particle with 0.1m radius => 100kg.m^-3 density of particle<br/> | 0.4 per particle with 0.1m radius => 100kg.m^-3 density of particle<br/> | ||
density of rotor is 10times more than particle, because normally we take density of rotor 1000kg.m^-3 | density of rotor is 10times more than particle, because normally we take density of rotor 1000kg.m^-3 | ||
+ | </p> | ||
+ | |||
+ | <h2>Memory bug - segmentation fault (linux) - stack overflow (windows) - fixed (at least looks like that)</h2> | ||
+ | <pre><nowiki> | ||
+ | // Use the error-checking memory allocation system. Because this system uses heap | ||
+ | // (malloc) instead of stack (alloca), it is slower. However, it allows you to | ||
+ | // simulate larger scenes, as well as handle out-of-memory errors in a somewhat | ||
+ | // graceful manner | ||
+ | |||
+ | #define dUSE_MALLOC_FOR_ALLOCA | ||
+ | #ifdef dUSE_MALLOC_FOR_ALLOCA | ||
+ | enum { | ||
+ | d_MEMORY_OK = 0, /* no memory errors */ | ||
+ | d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */ | ||
+ | }; | ||
+ | #endif | ||
+ | </nowiki></pre> | ||
+ | <h2>Distributed evolution - example</h2> | ||
+ | <strong>Evaluator program</strong><br/> | ||
+ | [[http://www.yames.biz/mt/evaluator-DB-2.zip Windows version]]<br/> | ||
+ | [[http://virtuallab.kar.elf.stuba.sk/~plavcan/evodesign/evaluator-DB-2_task.bash Linux script]]<br/> | ||
+ | [[Image:distr-evolution.JPG]] | ||
<noinclude> | <noinclude> | ||
{{Footer}} | {{Footer}} | ||
</noinclude> | </noinclude> |
Latest revision as of 13:18, 29 February 2008
Contents
Source code
CVS repository RELEASE version [1]
Literature & Links
Mark Ebner - Evolutionary design [2]
Kenny Erleben - Multibody dynamics [3]
BREVE Simulator - Breve Documentation [4]
ParadisEO - ParadisEO Documentation - slides [5]
Funes, Pollack - Computer Evolution of Buildable Objects [6]
Piyush Kumar - Triangle++ - Delaunay triangulation code [7]
wikipedia - Delaunay triangulation [8]
Parallel Computing Section
Introduction to PVM programming
PVM short description - [9]
ParadisEO is using either MPI (LAM-MPI) or PVM.
LAM-MPI is mostly for UNIX platforms - difficult to install on Windows. PVM should run everywhere.
New MPI implementation - OPEN MPI
Evolutionary algorithms
Eiben's Evolutionary Computing
Hitchhiker's guide to Evolutionary Algorithms
Genotype - in slovak lang.: reprezentacia subjektu evolucie (jedinca) vo forme vhodnej na operatory krizenia, mutacie, na evaluaciu fitness a na ine ?
ODE examples and comments
Open Dynamics Engine
Newton Dynamics
Red point = point (1, 0, 0) - along x-axis
Blue point = point (0, 1, 0) - along y-axis
Z-axis goes up
WARNING: use only float (not double) with TriMesh
First version of air particles flying through propeller
Tuned version of particles flying through propeller with source code: source 2
- Friction set to 0, dInfinity value is causing unrealistic and strange behaviour
- Density of particles is just approximatelly 4 times smaller than that of propeller
- Size of particles is big (10 times bigger than thickness of blade of propeller)
To be able to use complex rotation for next TriMesh example, a study of Quaternions is inevitable.
Applications of Quaternions
Same example as above but with Triangular Mesh representation - at the moment very simple - source 3
- For 2 consecutive simple rotation, 2 conversion from simple rotational matrix to quaternion was used, followed by quaternion multiplication and conversion back to complex rotational matrix
- Geom of blades is represented by 0-thin triangle, but with defined mass (based on the volume of blade with 0.001-thickness
- Blades are visible only from the 'front' - from the side of impacting particles
Rotor with complex TriMesh blades - source 4
- Missing lines in Triangular Mesh is just visualization bug
Simulation without graphical output - source 6
- Total number of particles: 1000
- Particle size: 0.000 001
- Tiangle side length (in TriMesh): 0.05
- Density of rotor: 1.0
- Density of particle: 10 000 000.0
- Initial force: 0.000 1
- Time step: 0.01
Running time:
Machine | Debug time | Optimized time |
---|---|---|
1.6GHz Linux | 13.42s | 13.02s |
2x2.16GHz WinXP | 43.68s | 7.77s |
Angular velocity of rotor after last step of simulation: 1.20865
IMPORTANT: Particle size >= TimeStep x Particle Velocity, otherwise particle can fly through TriMesh, as it is "jumping" in steps along its trajectory, it is not continuous flight. Therefore it is not feasible to use too tiny particles, as it would require step size too small or velocity too small, or both, in any case the simulation would be terribly slow.
Code for random generator initialization:
#include <ctime> time_t tim; dRandSetSeet ((unsigned long) time (&tim));
IMPORTANT: MAX_CONTACTS must be more than 1 -> otherwise Floating exception occurs (see juro8-Big.cpp) - so for example MAX_CONTACTS=2 used
CONSTANTS:
#define NUM 2000 // max number of objects #define DENSITY_ROTOR (10.0) // density of rotor #define DENSITY_AIR (1.0) // density of air particle #define MAX_CONTACTS 2 // maximum number of contact points per body #define NEW_PER_STEP 10 // must be less then NUM #define TIMESTEP 0.01 #define MOLECULE_SIZE 0.1 #define INITIAL_VELOCITY_Y 10.0 #define DAMPING_COEF 0.0001 #define THICKNESS_OF_BLADE 0.1 #define PI 3.14159265
Example:
size of blade: 10mx6mx0.1m
surface perpendicular to air flow = cca 50m^2 => in 1 sec (= 100 timesteps) at 10m.s^-1 500kg of air (1kg.m^-3) pushes on surface
average hit rate by air particles in 1 sec (= 100 timesteps) is 1250 => 0.4kg for 1 particle</br>
0.4 per particle with 0.1m radius => 100kg.m^-3 density of particle
density of rotor is 10times more than particle, because normally we take density of rotor 1000kg.m^-3
Memory bug - segmentation fault (linux) - stack overflow (windows) - fixed (at least looks like that)
// Use the error-checking memory allocation system. Because this system uses heap // (malloc) instead of stack (alloca), it is slower. However, it allows you to // simulate larger scenes, as well as handle out-of-memory errors in a somewhat // graceful manner #define dUSE_MALLOC_FOR_ALLOCA #ifdef dUSE_MALLOC_FOR_ALLOCA enum { d_MEMORY_OK = 0, /* no memory errors */ d_MEMORY_OUT_OF_MEMORY /* malloc failed due to out of memory error */ }; #endif
Distributed evolution - example
Evaluator program
[Windows version]
[Linux script]
--- --- --- --- --- RoboWiki: (c) 2006 Robotika.sk --- --- --- --- ---