elastic-force

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.

On va maintenant utiliser des forces elastiques pour coordonner la dynamique des lames dans la trame.

In [2]:
%load_ext autoreload
%autoreload 2
In [3]:
from elasticite import EdgeGrid
e = EdgeGrid(N_lame = 72, grid_type = 'hex', verb=False, structure=False)
fps = 20
loop = 1
autoplay = 0
In [4]:
name = 'test_grid2'
import numpy as np

e = EdgeGrid(N_lame = 72, grid_type = 'hex', verb=False, structure=False)
duration = 3.
def make_lames(lames, t):
    return lames[0, :] * np.pi +  t*np.pi/duration

duration = 3.
e.make_anim(name, make_lames, duration=duration)
e.ipython_display(name)
[MoviePy] >>>> Building video ../files/2015-10-14_elasticite/test_grid2.mp4
[MoviePy] Writing video ../files/2015-10-14_elasticite/test_grid2.mp4
                                               
[MoviePy] Done.
[MoviePy] >>>> Video ready: ../files/2015-10-14_elasticite/test_grid2.mp4 


In [5]:
name = 'parallel_force'
import numpy as np
# re-init
e.lames[2, :] = np.pi*np.random.randn(e.N_lame)

# distance
dx = e.lames[0, :, np.newaxis]-e.lames[0, np.newaxis, :]
dy = e.lames[1, :, np.newaxis]-e.lames[1, np.newaxis, :]

distance = np.sqrt(dx **2 + dy **2)

def make_lames(lames, t):
    angle_relatif = lames[2, :, np.newaxis]-lames[2, np.newaxis, :]
    lames[2, :] += -.0001 * np.sum(np.sin(2*angle_relatif)/(distance+.1), axis=1)
    lames[2, :] += .01*np.pi*np.random.randn(e.N_lame)
    return lames[2, :]

duration = 10.
e.make_anim(name, make_lames, duration=duration, redo=False)
e.ipython_display(name)
In [6]:
name = 'cocircular_force'
# re-init
e.lames[2, :] = np.pi*np.random.randn(e.N_lame)

# distance
dx = e.lames[0, :, np.newaxis]-e.lames[0, np.newaxis, :]
dy = e.lames[1, :, np.newaxis]-e.lames[1, np.newaxis, :]

distance = np.sqrt(dx **2 + dy **2)

def make_lames(lames, t):
    theta = lames[2, :, np.newaxis]-lames[2, np.newaxis, :]
    psi = np.arctan2(dy, dx) - np.pi/2 - theta
    psi -= theta/2
    lames[2, :] += .000125 * np.sum(np.sin(2**psi)/(distance+.1), axis=1)
    lames[2, :] += .00*np.pi*np.random.randn(e.N_lame)
    return lames[2, :]

duration = 10.
e.make_anim(name, make_lames, duration=duration)#, redo=True)
e.ipython_display(name)
[MoviePy] >>>> Building video ../files/2015-10-14_elasticite/cocircular_force.mp4
[MoviePy] Writing video ../files/2015-10-14_elasticite/cocircular_force.mp4
                                                 
[MoviePy] Done.
[MoviePy] >>>> Video ready: ../files/2015-10-14_elasticite/cocircular_force.mp4 


In [7]:
name = 'cocircular_antiparallel_force'
import numpy as np
# re-init
e.lames[2, :] = np.pi*np.random.randn(e.N_lame)

# distance
dx = e.lames[0, :, np.newaxis]-e.lames[0, np.newaxis, :]
dy = e.lames[1, :, np.newaxis]-e.lames[1, np.newaxis, :]

distance = np.sqrt(dx **2 + dy **2)

def make_lames(lames, t):
    theta = lames[2, :, np.newaxis]-lames[2, np.newaxis, :]
    psi = np.arctan2(dy, dx) - np.pi/2 - theta
    psi -= theta/2
    lames[2, :] += .00125 * np.sum(np.sin(theta)/(distance+.1), axis=1)
    lames[2, :] += -.00125 * np.sum(np.sin(psi)/(distance+.1), axis=1)
    lames[2, :] += .001*np.pi*np.random.randn(e.N_lame)
    return lames[2, :]

duration = 10.
e.make_anim(name, make_lames, duration=duration)#, redo=True)
e.ipython_display(name)
[MoviePy] >>>> Building video ../files/2015-10-14_elasticite/cocircular_antiparallel_force.mp4
[MoviePy] Writing video ../files/2015-10-14_elasticite/cocircular_antiparallel_force.mp4
                                                 
[MoviePy] Done.
[MoviePy] >>>> Video ready: ../files/2015-10-14_elasticite/cocircular_antiparallel_force.mp4