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()
/usr/local/lib/python3.6/site-packages/matplotlib/cbook.py:136: MatplotlibDeprecationWarning: The axisbg attribute was deprecated in version 2.0. Use facecolor instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)
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.)
[MoviePy] >>>> Building video /var/folders/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpd5zrj401.mp4
[MoviePy] Writing video /var/folders/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpd5zrj401.mp4
100%|█████████▉| 200/201 [00:39<00:00,  7.07it/s]
[MoviePy] Done.
[MoviePy] >>>> Video ready: /var/folders/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpd5zrj401.mp4 

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/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpvh441u_2.mp4
[MoviePy] Writing video /var/folders/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpvh441u_2.mp4
100%|█████████▉| 200/201 [00:35<00:00,  7.38it/s]
[MoviePy] Done.
[MoviePy] >>>> Video ready: /var/folders/px/n031whw95_39ccwg0wqwt5jw0000gn/T/tmpvh441u_2.mp4 

Out[9]:

git

In [10]:
!git s
 M 2015-11-17-elasticite-expansion-en-miroir-dynamique-dun-point-focal.ipynb
 M ../state_data.json
 D ../state_data_conflict-20170302-084750.json
In [11]:
!git commit -am' expansion - miroir de la structure - focus'
[master 5fc2a03]  expansion - miroir de la structure - focus
 3 files changed, 354 insertions(+), 444 deletions(-)
 rewrite posts/2015-11-17-elasticite-expansion-en-miroir-dynamique-dun-point-focal.ipynb (92%)
 delete mode 100644 state_data_conflict-20170302-084750.json
In [12]:
!git commit -m' nb_pas ' ../src/elasticite.py
error: pathspec '../src/elasticite.py' did not match any file(s) known to git.
In [13]:
! git push
Password for 'https://laurentperrinet@bitbucket.org':