<commit_before>#PyPeTractors


Physics modeling of pendulum with three magnetic attractors in a gravity field in Python(mostly).

Denomination: Py[thon]Pe[ndulum][@]Tractors; read 'pie p ~~at~~ tractors'.

##NEWS
It looks like the odeint libraries for python are not the most efficent ones to solve a large number of differential equations (for a big set of initial conditions), moreover they are not develped to be vectorialized (and we would love to impoement GPU computing to create better-resolution pictures in a shorter time). This is why we have decided to use python with SciPy libraries to do the plots of the trajectories etc. while using C++ to create the map of the asintotic values given different initial condition, and we will probably script also a vectorialized CUDA script C++ script.

In a future we might wrap this whole package in a GUI software with related precompiled bins and/or exes.

####Wanna know how much is it faster?
We have computed the mean value of over 100 times measure of the same integration with the same resolution, the same pendulum model and the same  initial conditions using the same laptop CPU forcing the max speed to 80% so that the performance was the same. Obtaining a very little variance we measured that python took about 3 sec per integration, while C++ with the odeint library (still with no CUDA) took about 350 ms, which is almost 10 times faster. Without printing to screen it's right under 10 ms per integration (300x faster)!
![cpp looks faster](/plots/cpp_looks_faster.png)


##Plots

Up to now have plotted some trajecories:

![trajectory side view](/plots/magnetic_pendulum_1a.png)

x,y on the floor, time on the z, 3 attractors -> (r,g,b) dots, pendulum pin -> black dot
![trajectory top view](/plots/magnetic_pendulum_1b.png)


... and some maps:

to each initial position (x,y) of the picture is associated the color of the attractor reached by the pendulum

![160x160 map](/plots/magnetic_pendulum_map_160x160.bmp)
![40x40 map](/plots/magnetic_pendulum_RGB_map_40x40.bmp)


... using Python.

We will hopefully achive better results in the maps using C++, CUDA and more processing time.

##Sources

######Look at that crazy attractor:

http://en.wikipedia.org/wiki/Attractor<commit_msg>linked plots<commit_after>#PyPeTractors


Physics modeling of pendulum with three magnetic attractors in a gravity field in Python(mostly).

Denomination: Py[thon]Pe[ndulum][@]Tractors; read 'pie p ~~at~~ tractors'.

##NEWS
It looks like the odeint libraries for python are not the most efficent ones to solve a large number of differential equations (for a big set of initial conditions), moreover they are not develped to be vectorialized (and we would love to impoement GPU computing to create better-resolution pictures in a shorter time). This is why we have decided to use python with SciPy libraries to do the plots of the trajectories etc. while using C++ to create the map of the asintotic values given different initial condition, and we will probably script also a vectorialized CUDA script C++ script.

In a future we might wrap this whole package in a GUI software with related precompiled bins and/or exes.

####Wanna know how much is it faster?
We have computed the mean value of over 100 times measure of the same integration with the same resolution, the same pendulum model and the same  initial conditions using the same laptop CPU forcing the max speed to 80% so that the performance was the same. Obtaining a very little variance we measured that python took about 3 sec per integration, while C++ with the odeint library (still with no CUDA) took about 350 ms, which is almost 10 times faster. Without printing to screen it's right under 10 ms per integration (300x faster)!
![cpp looks faster](/plots/cpp_looks_faster.png)


##Plots

Up to now have plotted some trajecories:

![trajectory side view](/plots/magnetic_pendulum_1a.png)

x,y on the floor, time on the z, 3 attractors -> (r,g,b) dots, pendulum pin -> black dot
![trajectory top view](/plots/magnetic_pendulum_1b.png)


... and some maps:

to each initial position (x,y) of the picture is associated the color of the attractor reached by the pendulum

![160x160 map](/plots/magnetic_pendulum_map_160x160.bmp)
![40x40 map](/plots/magnetic_pendulum_RGB_map_40x40.bmp)
![40x40 map](/plots/m_p_240x240_euler_significance.png)
![40x40 map](/plots/150.png)
![40x40 map](/plots/240.png)


... using Python.

We will hopefully achive better results in the maps using C++, CUDA and more processing time.

##Sources

######Look at that crazy attractor:

http://en.wikipedia.org/wiki/Attractor
{'fraction_non_alphanumeric': 0.06841307642346828, 'fraction_numerical': 0.022082701883524573, 'mean_word_length': 4.7534246575342465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4903622', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1265, 'n_words': 662}