In [1]:
%load_ext autoreload
%autoreload 2
import matplotlib
matplotlib.rcParams['figure.max_open_warning'] = 400
%matplotlib inline
%config InlineBackend.figure_format='retina'
#%config InlineBackend.figure_format = 'svg'
import matplotlib.pyplot as plt
import numpy as np
np.set_printoptions(precision=2, suppress=True)
from moviepy.video.io.bindings import mplfig_to_npimage
#mplfig_to_npimage?
In [2]:
import elasticite as el
e = el.EdgeGrid(N_lame=25, grid_type='line', struct_angles=[-15., -65., -102.])
e.sample_structure(N_mirror=2, alpha = .5)
fig, ax = e.plot_structure(scale=28.)
In [3]:
import elasticite as el
e = el.EdgeGrid(N_lame=25, grid_type='line', struct_angles=[-10., -60., -120.])
e.sample_structure(N_mirror=2, alpha = .5)
fig, ax = e.plot_structure(scale=28.)
In [4]:
!rm ../files/expansion*.mp4
In [5]:
duration = el.get_default_args(el.EdgeGrid.render)['duration']
class EdgeGrid(el.EdgeGrid):
def update(self):
e.struct_angles=[-30.*np.cos(2*np.pi*self.t/duration)**2, -60., -120.]
e.add_structure()
e.sample_structure(N_mirror=2, alpha = .5)
e = EdgeGrid(N_lame=25, grid_type='line')
e.animate(fname='../files/expansion_premier_bras.mp4', scale = 32.)
Out[5]:
In [6]:
duration = el.get_default_args(el.EdgeGrid.render)['duration']
class EdgeGrid(el.EdgeGrid):
def update(self):
e.struct_angles=[-42.*np.cos(2*np.pi*self.t/duration)**2, -60., -130.]
e.add_structure()
e.sample_structure(N_mirror=2, alpha = .5)
e = EdgeGrid(N_lame=25, grid_type='line')
e.animate(fname='../files/expansion_deuxieme_bras.mp4', scale = 32.)
Out[6]:
In [7]:
duration = el.get_default_args(el.EdgeGrid.render)['duration']
class EdgeGrid(el.EdgeGrid):
def update(self):
e.struct_angles=[-22., -60. , -120.-49**np.cos(2*np.pi*self.t/duration)]
e.add_structure()
e.sample_structure(N_mirror=2, alpha = .5)
e = EdgeGrid(N_lame=25, grid_type='line')
e.animate(fname='../files/expansion_troisieme_bras.mp4', scale = 32.)
Out[7]:
In [8]:
!git s
#!git add 2015-11-02\ élasticité\ expansion\ en\ miroir.ipynb
In [9]:
!git commit -am' expansion - miroir de la structure - essais avec différents angles'
In [10]:
! git push