7. Working with CreateClones

7.1 Introduction

This chapter discusses and demonstrates the use of CreateClones, a powerful mechanism for modelling multiple copies of an optical element in a system. The CreateClones option is limited to TurboTrace calculations and does not exist in PropagateSystem. Next we examine the usage message for CreateClones.

?CreateClones

7.2 Lenticular Array Example

In this present example, we will model an array of lenslets in which each copy is identical in the size and shape to the other copies. This restriction is not necessary, however, and it is in fact possible to assign a scale the size of each copy uniquely.

positions = Flatten[Table[{0.,y,z},{y,-5,5,1},{z,-5,5,1}],1]//N;

ListPlot[Map[Rest,positions],PlotRange->All, AspectRatio->1];

lenslet = Resonate[{
Move[PinHole[{1,1},.75, GraphicDesign->Sketch],.07],
Move[PinHole[{1,1},.75, SurfaceRendering->Fill],.3],
PlanoConvexLens[2,.75,.3, SurfaceRendering->Empty, EdgeRendering->Empty, CrossRendering->Trace]}]

ByteCount[ShowSystem[lenslet,OutputType->StandardGraphics]]

ShowSystem[lenslet, PlotType->FrontView, CreateClones -> positions, ShowLabels->False];

Timing[plot = TurboPlot[
{PointOfRays[{10,10}, NumberOfRays->33, BirthPoint->{-100,10,10}],
lenslet,
Move[Screen[{15,15}],2.3]}, PlotType->Full3D, ReportedSurfaces->All, CreateClones -> positions, RunningCommentary->TurboTrace, CloneSortLength->2, PlotRange->{{-5,3},{-6.5,6.5},{-6.5,6.5}}]][[1]]

Timing[plot = TurboPlot[
{PointOfRays[{10,10}, NumberOfRays->33, BirthPoint->{-100,10,10}],
lenslet,
Move[Screen[{15,15}],2.3]}, CloneSortLength->3, CreateClones -> positions, RunningCommentary->TurboTrace]][[1]]

7.3 Solar Array Example

positions = Flatten[Table[{x,y,0},{x,-5,5,1},{y,-5,5,1}],1]//N;

ListPlot[Map[Drop[#,-1]&,positions],PlotRange->All, AspectRatio->1];

clonedplaces = Map[{#,(#/Sqrt[#.#])&[incomingVector = (#/Sqrt[#.#])&[{-50,0,50}-#];
outgoingVector = (#/Sqrt[#.#])&[{10,0,10}-#];
bisectingVector = incomingVector-outgoingVector;
-(incomingVector-
Dot[incomingVector,bisectingVector]/Dot[bisectingVector,bisectingVector]*
bisectingVector)]}&,positions];

ShowSystem[Mirror[{.9,.9}],CreateClones->clonedplaces, PlotType->TopView, ShowLabels->False];

ShowSystem[Mirror[{.9,.9}], CreateClones->clonedplaces];

TurboPlot[{
Rotate[PointOfRays[{10,10},BirthPoint->{-50,0,-50},NumberOfRays->11],90,{0,1,0}],
Mirror[{.9,.9}],
MoveDirected3D[Screen[{2,2}],{10,0,10},{0,0,0}]}, ReportedSurfaces->All, CreateClones->clonedplaces,
PlotRange->{{-8,12.5},{-6.5,6.5},{-1,13.5}}, PlotType->Full3D, RunningCommentary->TurboTrace, CloneSortLength-> 3];

TurboPlot[{
Rotate[PointOfRays[{10,10},BirthPoint->{-50,0,-50},NumberOfRays->33],90,{0,1,0}],
Mirror[{.9,.9}],
MoveDirected3D[Screen[{2,2}],{10,0,10},{0,0,0}]}, ReportedSurfaces->All, CreateClones->clonedplaces,
PlotRange->{{-8,12.5},{-6.5,6.5},{-1,13.5}}, PlotType->Full3D, RunningCommentary->TurboTrace, CloneSortLength-> 3];

TurboPlot[{
Rotate[PointOfRays[{11,11},BirthPoint->{-50,0,-50},NumberOfRays->66,
MonteCarlo->Stratified],90,{0,1,0}],
Mirror[{.9,.9}],
MoveDirected3D[Screen[{2,2}],{10,0,10},{0,0,0}]}, CreateClones->clonedplaces, RunningCommentary->TurboTrace, CloneSortLength-> 3];

FindIntensity[{
Rotate[PointOfRays[{11,11},BirthPoint->{-50,0,-50},NumberOfRays->66,
MonteCarlo->Stratified],90,{0,1,0}],
Mirror[{.9,.9}],
MoveDirected3D[Screen[{2,2}],{10,0,10},{0,0,0}]}, CreateClones->clonedplaces, RunningCommentary->TurboTrace, CloneSortLength-> 3];

FindIntensity[%,Plot2D->False];

7.4 Cellular Array Example

positions = Flatten[Table[{x,y},{x,2,4*2,.5},{y,-2*2-1/2,2*2-1/2,.5}],1]//N;

gridpositions = Sort[Join[positions,Map[(#+{.25,.25})&,positions]]];

Length[gridpositions]

ListPlot[gridpositions,PlotRange->{{0,9},{-5,5}}, AspectRatio->1];

randomgridpositions = Map[(#+{Random[Real,{-.05,.05}],Random[Real,{-.05,.05}]})&,gridpositions];

ListPlot[randomgridpositions,PlotRange->{{0,9},{-5,5}}, AspectRatio->1];

randomclonedata =
Map[
Function[{pos},
{pos,1,Sort[Map[(Sqrt[Dot[#,#]]&[#-pos])&,randomgridpositions]][[2]]}
]
,
randomgridpositions
];

rodlens =
RemoveSurface[RodLens[1,1,FresnelReflections->True,ComponentMedium->1.48],
{1,5}]

ShowSystem[
{rodlens,
Move[ClearBoundary[9,10],{.75,-.4}]},
PlotType->TopView, ShowLabels->False,
CreateClones -> randomclonedata];

Timing[TurboPlot[
{Move[SingleRay[IntrinsicMedium->1.34],{0,-3}, 50],
rodlens,
Move[ClearBoundary[9,10],{.75,-.4}]},
PlotType->TopView, ThresholdIntensity->.1, ColorView->Log[Intensity],
CreateClones -> randomclonedata, ShowClones->False,
RunningCommentary->TurboTrace, ShowArrows->True]][[1]]

Timing[AnalyzeSystem[
{Move[SingleRay[IntrinsicMedium->1.34],-2],
rodlens,
Move[ClearBoundary[9,10],{.75,-.4}]},
PlotType->TopView, ThresholdIntensity->.008, ShowLabels->False,
CreateClones -> randomclonedata, ShowClones->False, ColorView->Log[Intensity],
RunningCommentary->TurboTrace]][[1]]

Timing[TurboPlot[
{Move[LineOfRays[.5, IntrinsicMedium->1.3, NumberOfRays->5],-4],
rodlens,
Move[ClearBoundary[9,10],{.75,-.4}]},
PlotType->TopView, ThresholdIntensity->.1, ReportedSurfaces->All, ColorView->Log[Intensity],
CreateClones -> randomclonedata, RunningCommentary->TurboTrace]][[1]]

Timing[TurboPlot[
{Move[LineOfRays[.5, IntrinsicMedium->1.3, NumberOfRays->7],{0,-4}, 55],
rodlens,
Move[ClearBoundary[9,10],{.75,-.4}]},
PlotType->TopView, ThresholdIntensity->.1, ReportedSurfaces->All, ColorView->Log[Intensity],
CreateClones -> randomclonedata, ShowClones->False, RunningCommentary->TurboTrace]][[1]]

Created by Mathematica  (November 19, 2004)