Hard Spheres
Hard Spheres
In[]:=
Table[Graphics[{Style[Disk[#[[1]],1],Orange],Arrow[{#[[1]],#[[1]]+4#[[2]]}]}&/@Transpose[With[{num=50,steps=2000,boxSize=15,rad=1,stepSize=0.1},With[{initialPos=Catenate@Table[{-14+2.5i,14-2.5j},{i,4},{j,4}],initialVel=Table[.5{1,0},16]},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]][[1,t]]],PlotRange->15,Frame->True,FrameTicks->None,ImageSize->100],{t,1,2000,100}]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
Sphere Collisions
Sphere Collisions
In[]:=
Table[Graphics[{Style[Disk[#[[1]],1],Orange],Arrow[{#[[1]],#[[1]]+4#[[2]]}]}&/@Transpose[With[{steps=500,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,0.1},{5,-.1}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]][[1,t]]],PlotRange->15,Frame->True,FrameTicks->None,ImageSize->100],{t,1,200,20}]
Out[]=
,
,
,
,
,
,
,
,
,
In[]:=
Graphics3D[Style[Tube[#,1],Orange,Opacity[.5]]&/@MapIndexed[Append[#,-.06#2[[2]]]&,#,{2}],ViewPoint->{0,-Infinity,0},Method{"ShrinkWrap"True}]&/@Transpose/@Partition[First/@First[With[{steps=100,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,0.1},{5,-.1}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]]],100]
Out[]=
In[]:=
Graphics3D[Style[Tube[#,1],Orange,Opacity[.5]]&/@MapIndexed[Append[#,-.06#2[[2]]]&,#,{2}],ViewPoint->{0,-Infinity,0},Method{"ShrinkWrap"True}]&/@Transpose/@Partition[First/@First[With[{steps=100,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,0},{5,0}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]]],100]
Out[]=
In[]:=
Graphics3D[Style[Tube[#,1],Orange,Opacity[.5]]&/@MapIndexed[Append[#,-.06#2[[2]]]&,#,{2}],Method{"ShrinkWrap"True}]&/@Transpose/@Partition[First/@First[With[{steps=100,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,0.1},{5,-.1}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]]],100]
Out[]=
In[]:=
Table[Graphics3D[Style[Tube[#,1],Orange,Opacity[.5]]&/@MapIndexed[Append[#,-.06#2[[2]]]&,#,{2}],Method{"ShrinkWrap"True}]&/@Transpose/@Partition[First/@First[With[{steps=100,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,o},{5,-o}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]]],100],{o,0,.2,.02}]
Out[]=
,,,,,,,,,,
In[]:=
Show[Flatten[%]]
Out[]=
In[]:=
Table[Graphics3D[Style[Tube[#,1],Orange,Opacity[.5]]&/@MapIndexed[Append[#,-.06#2[[2]]]&,#,{2}],Method{"ShrinkWrap"True}]&/@Transpose/@Partition[First/@First[With[{steps=100,boxSize=10,rad=1,stepSize=0.1},With[{initialPos={{-5,o},{5,-o}},initialVel={{1,0},{-1,0}}},ResourceFunction["HardSphereSimulation"][initialPos,initialVel,boxSize,stepSize,rad,steps]]]],100],{o,0,1,.1}]
Out[]=
,,,,,,,