(*
Modificare "Printing Settings": ;
- Page Setup : Landscape   (non importa l'ingrandimento);
- Printing Options: Top=0.4; Left=1.7; Bottom=0.1;
*)

2 onde piane con angolo variabile

dimimm=400;
gamma=.7;
k=2 Pi;
Manipulate[
Column[{
Plot[Cos[k Sin[teta]x]^2,{x,0,2},PlotRange->{0,1},AspectRatio->1/3,ImageSize->dimimm],
DensityPlot[Re[Cos[k Sin[teta]x]^2]^gamma,{x,0,2},{y,0,1},PlotPoints->{50,2},ColorFunction->GrayLevel,Frame->False, ImageSize->dimimm]
}]
,{teta,0,Pi/2,1/20},ControlPlacement->Left]

2 onde piane con 2 angoli variabili e shift

gamma=.7; (* modifica la curva del contrasto *)
Manipulate[DensityPlot[(Cos[kx x + ky y+ fi/2]^2)^gamma,{x,-1,1},{y,-1,1},PlotPoints->{50,50},ColorFunction->GrayLevel,Frame->False, ImageSize->dimimm]
,{{kx,10},-10,10,.05},{{ky,0},-10,10,.05},{fi,0,2 Pi,.01},ControlPlacement->Left]

3 onde piane (statico)

valori= {alfa->1,dkz->0.5*(2Pi)}
dimimm=400;
gamma=.4; (* modifica la curva del contrasto *)
inte=(1+4 alfa^2 Cos[kx]^2+4 alfa Cos[kx] Cos[dkz]) /.valori;
Plot[inte,{kx,0,8 Pi},PlotRange->All,ImageSize->dimimm]
DensityPlot[(inte)^gamma,{kx,0,8 Pi},{ky,0,8 Pi},PlotPoints->50,ImageSize->dimimm,ColorFunction->GrayLevel,Frame->False,PlotRange->All]

3 onde piane (animato)

gamma=.7; (* modifica la curva del contrasto *)
Manipulate[
Column[{
Plot[1+4 alfa^2 Cos[kx]^2+4 alfa Cos[kx] Cos[dkz],{kx,0,8 Pi},PlotRange->{0,9},AspectRatio->1/3,ImageSize->dimimm],
DensityPlot[Re[1+4 alfa^2 Cos[kx]^2+4 alfa Cos[kx] Cos[dkz]]^gamma,{kx,0,8 Pi},{ky,0,1},PlotPoints->{50,2},ColorFunction->GrayLevel,Frame->False, ImageSize->dimimm]
}],{{alfa,1},0,1,1/20.},{dkz,0,2. Pi,Pi/20},ControlPlacement->Left]

gamma=.3; (* modifica la curva del contrasto *)

Manipulate[
Column[{
Plot[(Sin[(2 enne + 1)kx/2]/Sin[kx/2])^2,{kx,0,8 Pi},PlotRange->{0,(2 enne+1)^2},AspectRatio->1/3,ImageSize->dimimm],
DensityPlot[Re[(Sin[(2 enne + 1)kx/2]/Sin[kx/2])^2]^gamma,{kx,0,8 Pi},{ky,0,1},PlotPoints->{200,2},PlotRange->All,ColorFunction->GrayLevel,Frame->False, ImageSize->dimimm]
}],{{enne,1,"n"},0,10,1},ControlPlacement->Left]

2N+1 onde piane in z>0

gamma=.4; (* modifica la curva del contrasto *)
ennemax=5;
zmax=4 Pi ennemax^2

Manipulate[
Column[{
Plot[Abs[Sum[Exp[n I kx] Exp[I Sqrt[1-(n/ennemax)^2]z],{n,-enne,enne}]]^2,{kx,0,8 Pi},PlotRange->{0,(2 enne+1)^2},AspectRatio->1/3,ImageSize->dimimm,PlotPoints->100],
DensityPlot[Abs[Sum[Exp[n I kx] Exp[I Sqrt[1-(n/ennemax)^2]z],{n,-enne,enne}]]^(2 gamma),{kx,0,8 Pi},{ky,0,1},PlotPoints->{200,2},PlotRange->All,ColorFunction->GrayLevel,Frame->False, ImageSize->dimimm]
}],{{enne,1,"N"},1,ennemax,1},{z,0,zmax,zmax/100.},ControlPlacement->Left]

2N+1 onde piane in z=0

(*
Plot[grafici,{kx,0,15},PlotRange->All,AspectRatio->1/6,ImageSize->2*dimimm]
Plot[somma,{kx,0,15},PlotRange->All,AspectRatio->1/6,ImageSize->2*dimimm]
*)
om0=10;
tmax=4 Pi;
tstep=tmax/200;
Manipulate[
Column[{
Plot[Table[Re[Exp[(om0+n) I( kx-t)]],{n,0,nmax}],{kx,0,15},PlotPoints->100,PlotRange->All,AspectRatio->1/6,ImageSize->2*dimimm],
Plot[{Re[Sum[Exp[(om0+n) I ( kx-t)],{n,0,nmax}]],  Sin[(nmax +1)/2 ( kx-t)]/Sin[( kx-t)/2]},{kx,0,15},PlotPoints->100,PlotRange->All,AspectRatio->1/6,ImageSize->2*dimimm],
Plot[ (Sin[(nmax +1)/2 ( kx-t)]/Sin[( kx-t)/2])^2,{kx,0,15},PlotPoints->100,PlotRange->All,AspectRatio->1/6,ImageSize->2*dimimm]
}]
,{{nmax,0,"N"},0,20,1},{t,0,tmax,tstep},ControlPlacement->Left]

insieme di onde piane con stesso kz (e sfasamento lineare con alfa)

ClearAll[x,y,alfa,enne]
gamma=.6; (* modifica la curva del contrasto *)

enne=31;
carica=1;
deltaalfa=2 Pi/enne;
teta=Pi/10;
kperp=2 Pi Sin[teta];
alfa0=0;
alfan=Table[alfa0+deltaalfa(n-1),{n,1,enne}];
intefascio=Abs[Sum[Exp[I carica  alfan[[n]]]Exp[kperp I (x Cos[alfan[[n]]]+y Sin[alfan[[n]]])],{n,1,enne}]]^2;

xmax=20;

DensityPlot[intefascio^gamma,{x,-xmax,xmax},{y,-xmax,xmax},PlotPoints->50,ColorFunction->GrayLevel, ImageSize->500,Frame->False,PlotRange->All]

funzioni di Bessel

xmax=40;
Manipulate[
Plot[(BesselJ[indice, x]),{x,-xmax,xmax},PlotRange->{-0.6,1}, ImageSize->500]
,{{indice,0,"n"},0,20,1},ControlPlacement->Left]

fasci di Bessel (generale, animato)

indicemax=10
Manipulate[
Column[{
Plot[(BesselJ[indice,2 Pi Sin[teta] x])^2,{x,-2,2},PlotRange->{0,1}, ImageSize->350],
DensityPlot[Abs[BesselJ[indice,2 Pi Sin[teta]Sqrt[x^2+y^2]]]^(2gamma),{x,-2,2},{y,-2,2},PlotPoints->50,ColorFunction->GrayLevel, ImageSize->350,Frame->False,PlotRange->All]
}]
,{{indice,0,"n"},0,indicemax,1},{{teta,0,"ϑ"},0,3.14/2,3.14/20},ControlPlacement->Left]

Profilo di fase a spirale

Manipulate[
Row[{
DensityPlot[Mod[n ArcTan[x,y],2 Pi],{x,-2,2},{y,-2.,2.},BoxRatios->{1,1,1},PlotPoints->100,ColorFunction->GrayLevel, ImageSize->350],
Plot3D[Mod[n ArcTan[x,y],2 Pi],{x,-2,2},{y,-2.,2.},BoxRatios->{1,1,1/2},PlotPoints->100,ColorFunction->"Rainbow", ImageSize->350]}]
,{{n,1},0,10,1},ControlPlacement->Left]

Combinazioni dei primi 4 fasci di Bessel (n=0,1,2,3)

gamma=.8; (* modifica la curva del contrasto *)

enne=4;
alfa={1,1,0,0};
intefascio=Abs[
Sum[
I^(i-1)*alfa[[i]]*BesselJ[i-1,Sqrt[x^2+y^2]]*Exp[(i-1) I ArcTan[x,y]],
{i,1,enne}]
]^2;

DensityPlot[intefascio^gamma,{x,-10,10},{y,-10,10},PlotPoints->50,ColorFunction->GrayLevel, ImageSize->350,Frame->False,PlotRange->All]

2.4/2/Pi