2015-11-17 élasticité expansion en miroir - dynamique d'un point focal

L'installation Elasticité dynamique agit comme un filtre et génère de nouveaux espaces démultipliés, comme un empilement quasi infini d'horizons. Par principe de réflexion, la pièce absorbe l'image de l'environnement et accumule les points de vue ; le mouvement permanent requalifie continuellement ce qui est regardé et entendu.

Ce post implémente une dynamique sur le point focal.

In [1]:
%load_ext autoreload
%autoreload 2
In [2]:
import matplotlib
matplotlib.rcParams['figure.max_open_warning'] = 400
#%matplotlib inline
#%config InlineBackend.figure_format='retina'
#%config InlineBackend.figure_format = 'svg'
In [3]:
import elasticite as el
import numpy as np
duration = el.get_default_args(el.EdgeGrid.render)['duration']
In [4]:
import sys
sys.path.append('..')
from scenario_line_fresnel import EdgeGrid
e = EdgeGrid(N_lame=25, grid_type='line')
In [5]:
e.lames.shape
Out[5]:
(4, 31)
In [6]:
e = el.EdgeGrid(N_lame=25, grid_type='line')
e.sample_structure(N_mirror=2, alpha = .5)
fig, ax = e.plot_structure()
In [7]:
e.particles.shape, e.N_particles, e.N_particles_per_lame
Out[7]:
((3, 2352), 48, 8)

Greedy :

In [8]:
duration = el.get_default_args(el.EdgeGrid.render)['duration']
class EdgeGrid(el.EdgeGrid):
    def update(self, tau=.5):
        for i in range(14):
            ind_max = np.argmax(self.particles[2, :])
            self.particles[2, ind_max] = 0 # np.random.randn(self.particles.shape[1])
        #print (self.particles[2, :].min(), self.particles[2, :].max())
        self.particles[2, :] += self.dt/tau * (self.particles[2, :] - self.particles_ref)

e = EdgeGrid(N_lame=25, grid_type='line')
e.sample_structure(N_mirror=2, alpha = .5)
e.particles_ref = e.particles[2, :].copy()
e.animate(scale = 32.)
#e.animate(fname='../files/expansion_foyers_greedy_12.mp4', scale = 32.)
WARNING:py.warnings:/usr/local/lib/python3.5/site-packages/skimage/filter/__init__.py:6: skimage_deprecation: The `skimage.filter` module has been renamed to `skimage.filters`.  This placeholder module will be removed in v0.13.
  warn(skimage_deprecation('The `skimage.filter` module has been renamed '

[MoviePy] >>>> Building video /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp906j36ts.webm
[MoviePy] Writing video /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp906j36ts.webm
                                                 
[MoviePy] Done.
[MoviePy] >>>> Video ready: /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp906j36ts.webm 


Out[8]:
In [9]:
duration = el.get_default_args(el.EdgeGrid.render)['duration']
class EdgeGrid(el.EdgeGrid):
    def update(self, tau=.5):
        ind_max = np.argmax(self.particles[2, :])
        # TODO akin to pursuit
        #for i in range(14):
        #   
        #   self.particles[2, ind_max] = 0 # np.random.randn(self.particles.shape[1])
        #print (self.particles[2, :].min(), self.particles[2, :].max())
        self.particles[2, :] += self.dt/tau * (self.particles[2, :] - self.particles_ref)

e = EdgeGrid(N_lame=25, grid_type='line')
e.sample_structure(N_mirror=2, alpha = .5)
e.particles_ref = e.particles[2, :].copy()
e.animate(scale = 32.)
#e.animate(fname='../files/expansion_foyers_greedy_12.mp4', scale = 32.)
[MoviePy] >>>> Building video /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp_9qkk1if.webm
[MoviePy] Writing video /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp_9qkk1if.webm
                                                 
[MoviePy] Done.
[MoviePy] >>>> Video ready: /var/folders/3p/m0g52j9j69z3gj8ktpgg1dm00000gn/T/tmp_9qkk1if.webm 


Out[9]:

git

In [10]:
!git s
 M "2015-09-30 \303\251lasticit\303\251, vapory and reflections.ipynb"
 M "2015-11-17 \303\251lasticit\303\251 expansion en miroir - dynamique d'un point focal.ipynb"
 M "2015-11-29 \303\251lasticit\303\251 - sc\303\251nario onde.ipynb"
?? __temp_ipython__.png
?? anim.gif
In [11]:
!git commit -am' expansion - miroir de la structure - focus'
[master 838fad8]  expansion - miroir de la structure - focus
 3 files changed, 348 insertions(+), 426 deletions(-)
 rewrite "posts/2015-11-17 \303\251lasticit\303\251 expansion en miroir - dynamique d'un point focal.ipynb" (97%)
In [12]:
!git commit -m' nb_pas ' ../src/elasticite.py
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
Untracked files:
	__temp_ipython__.png
	anim.gif

nothing added to commit but untracked files present
In [13]:
! git push
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 2.49 MiB | 0 bytes/s, done.
Total 10 (delta 8), reused 0 (delta 0)
To git@git.framasoft.org:laurentperrinet/elasticte.git
   b377395..838fad8  master -> master

Comments

Comments powered by Disqus