Retour vers la page d'acceuil de Sagemaths dans le web


Amibes


1. Amibe d'une droite tropicale

#Amibe de p(u,v)="u+2v+3"

temps=cputime()
u,v=var('u,v')
t=2
umin=-5;umax=7
vmin=-5;vmax=6
print("Amibe de  p(u,v) :");print('\n')
p1=lambda u,v:t^(1+u)+t^(2+v)-t^3>=0
p2=lambda u,v:t^(1+u)-t^(2+v)+t^3>=0
p3=lambda u,v:-t^(1+u)+t^(2+v)+t^3>=0
g=region_plot([p1,p2,p3],(u,umin,umax),(v,vmin,vmax),incol='black',bordercol='black', borderwidth=1,plot_points=1500,
                      frame=True,alpha=0.6,gridlines='minor',axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
g.show()
g.save('amibe1.svg')
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe
#Convergence animée du bord de l'amibe de p(u,v)="u+2v+3"

temps=cputime()
u,v=var('u,v')
umin=-5;umax=7
vmin=-5;vmax=6
print("Convergence animée du bord de l'amibe de p(u,v) :");print('\n')
p1=lambda u,v:t*(t^u)+(t^2)*(t^v)-t^3
p2=lambda u,v:t*(t^u)-(t^2)*(t^v)+t^3
p3=lambda u,v:-t*(t^u)+(t^2)*t^v+t^3
a=animate([implicit_plot(p1,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,gridlines='minor',
                                     axes=True,axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
                 +implicit_plot(p2,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p3,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +text(r"$\mathbf{t\,}$"+" :",(3,5.5),rgbcolor=(0,0,0))+text(str(t),(4.5,5.5),color=(0,0,0))
                  for t in [2,3,5,7,10,20,50,500,5000,50000]])

a.show(delay=100)
a.save('amibe1_bis.gif',delay=100)
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe

2. Amibe à un trou

   
#Amibe de p(u,v)="u^2*v+u*v^2+4*u*v+1"

temps=cputime()
u,v=var('u,v')
t=1.5
umin=-15;umax=15
vmin=-15;vmax=15
print("Amibe de p(u,v)=<> :");print('\n')
p1=lambda u,v:-t^(2*u+v)-t^(u+2*v)-(t^4)*t^(u+v)+t<=0
p2=lambda u,v:-t^(2*u+v)-t^(u+2*v)+(t^4)*t^(u+v)-t<=0
p3=lambda u,v:-t^(2*u+v)+t^(u+2*v)-(t^4)*t^(u+v)-t<=0
p4=lambda u,v:t^(2*u+v)-t^(u+2*v)-(t^4)*t^(u+v)-t<=0
g=region_plot([p1,p2,p3,p4],(u,umin,umax),(v,vmin,vmax),incol='black', bordercol='black', borderwidth=1,plot_points=1500,
                     alpha=0.6,frame=True,gridlines='minor',axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
g.show()
g.save('amibe2.svg')
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe
   
#Convergence animée du bord de l'amibe de p(u,v)="u^2*v+u*v^2+4*u*v+1"

temps=cputime()
u,v=var('u,v')
umin=-15;umax=15
vmin=-15;vmax=15
print("Convergence animée du bord de l'amibe de p(u,v) :");print('\n')
p1=lambda u,v:-t^(1+2*u+v)-t^(1+u+2*v)-t^(4+u+v)+t
p2=lambda u,v:-t^(1+2*u+v)-t^(1+u+2*v)+t^(4+u+v)-t
p3=lambda u,v:-t^(1+2*u+v)+t^(1+u+2*v)-t^(4+u+v)-t
p4=lambda u,v:t^(1+2*u+v)-t^(1+u+2*v)-t^(4+u+v)-t
a=animate([implicit_plot(p1,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,
                                     gridlines='minor',axes=True,axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
                 +implicit_plot(p2,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p3,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p4,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +text(r"$\mathbf{t\,}$"+" :",(3,12),rgbcolor=(0,0,0))+text(str(round(t,1)),(6.5,12),color=(0,0,0))
                  for t in [1.5,2,3,5,7,10,20,50,500,5000,50000]])

a.show(delay=100)
a.save('amibe2_bis.gif',delay=100)
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe

3. Amibe à deux trous

  
#Amibe de p(u,v)="(-0,2)*u^2*v^2+5*u^2*v+(-1)*u^3+v^2+10*u*v+1"

temps=cputime()
u,v=var('u,v')
t=1.75
umin=-15;umax=15
vmin=-15;vmax=15
print("Amibe de p(u,v) :");print('\n')
p1=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)+t<=0
p2=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)+t^(10+u+v)-t<=0
p3=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)+t^(1+2*v)-t^(10+u+v)-t<=0
p4=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)+t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t<=0
p5=lambda u,v:-t^(-0.2+2*u+2*v)+t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t<=0
p6=lambda u,v:t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t<=0
g=region_plot([p1,p2,p3,p4,p5,p6],(u,umin,umax),(v,vmin,vmax),incol='black', bordercol='black', borderwidth=1,
                      plot_points=1500,alpha=0.6,frame=True,gridlines='minor',axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
g.show()
g.save('amibe3.svg')
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe
  
#Convergence animée du bord de l'amibe de p(u,v)="(-0,2)*u^2*v^2+5*u^2*v+(-1)*u^3+v^2+10*u*v+1"

temps=cputime()
u,v=var('u,v')
umin=-15;umax=15
vmin=-15;vmax=15
print("Convergence animée du bord de l'amibe de p(u,v) :");print('\n')
p1=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)+t
p2=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)+t^(10+u+v)-t
p3=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)+t^(1+2*v)-t^(10+u+v)-t
p4=lambda u,v:-t^(-0.2+2*u+2*v)-t^(5+2*u+v)+t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t
p5=lambda u,v:-t^(-0.2+2*u+2*v)+t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t
p6=lambda u,v:t^(-0.2+2*u+2*v)-t^(5+2*u+v)-t^(-1+3*u)-t^(1+2*v)-t^(10+u+v)-t
a=animate([implicit_plot(p1,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,gridlines='minor',
                                     axes=True,axes_labels=([r"$\mathbf{u}$",r"$\mathbf{v}$"]))
                 +implicit_plot(p2,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p3,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p4,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p5,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +implicit_plot(p6,(u,umin,umax),(v,vmin,vmax),plot_points=200,color='black',linewidth=1.5,axes=True)
                 +text(r"$\mathbf{t\,}$"+" :",(6,12),rgbcolor=(0,0,0))+text(str(round(t,1)),(9.5,12),color=(0,0,0))
                  for t in [1.75,2,3,5,7,10,20,50,500,5000]])

a.show(delay=100)
a.save('amibe3_bis.gif',delay=100)
print("Durée d'exécution :"+str(round(cputime(temps),2))+"s")
Amibe

4. Contour de l'amibe 3

t=1,75 t=2 2,5 t=3 t=5 t=10 t=20 t=50 t=500 t=5000

Retour vers la page d'acceuil de Sagemaths dans le web