7. Working with CreateClones

7.1 Introduction
7.2 Lenticular Array Example
7.3 Solar Array Example
7.4 Cellular Array Example

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

CreateClones -> {{coordinates, rotationmatrix, componentnumber, scale}, ...} specifies the  ... wClones, CloneSortLength, CloneSortMethod, ComponentNumber, TranslationVector, and RotationMatrix.

Go to list of topics

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];

[Graphics:HTMLFiles/index_2.gif]

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]}]

TagBox[RowBox[{Resonate, [, RowBox[{{, RowBox[{RowBox[{Move, [, RowBox[{RowBox[{PinHole, [, Ro ... 54;Trace, EdgeRenderingEmpty, SurfaceRenderingEmpty}}], ]}]}], }}], ]}], HoldForm]

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

[Graphics:HTMLFiles/index_4.gif]

49480

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

[Graphics:HTMLFiles/index_6.gif]

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]]

RowBox[{System traced in , , 53.7833, ,  seconds with , , 3085, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_8.gif]

RowBox[{133.2,  , Second}]

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]]

RowBox[{System traced in , , 27.5167, ,  seconds with , , 499, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_11.gif]

RowBox[{53.55,  , Second}]

Go to list of topics

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];

[Graphics:HTMLFiles/index_13.gif]

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];

[Graphics:HTMLFiles/index_14.gif]

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

[Graphics:HTMLFiles/index_15.gif]

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];

RowBox[{System traced in , , 5.08333, ,  seconds with , , 242, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_17.gif]

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];

RowBox[{System traced in , , 48.2833, ,  seconds with , , 1758, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_19.gif]

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];

RowBox[{System traced in , , 305.95, ,  seconds with , , 3403, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_21.gif]

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];

RowBox[{System traced in , , 350.717, ,  seconds with , , 3381, ,  ray segments getting reported.}]

CalibrateEnergy -> False has been automatically selected by Optica.

This setting saves time, but CalibrateEnergy -> True should be used when calibrated energy measurements are required.

RowBox[{Surface Information : , , RowBox[{{, RowBox[{RowBox[{ComponentNumber,  ... , RowBox[{SmoothKernelSize, , RowBox[{{, RowBox[{0.0795139, ,, 0.0554449}], }}]}]}], }}]}]

[Graphics:HTMLFiles/index_26.gif]

FindIntensity[%,Plot2D->False];

RowBox[{Surface Information : , , RowBox[{{, RowBox[{RowBox[{ComponentNumber,  ... , RowBox[{SmoothKernelSize, , RowBox[{{, RowBox[{0.0795139, ,, 0.0554449}], }}]}]}], }}]}]

[Graphics:HTMLFiles/index_28.gif]

Go to list of topics

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]

442

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

[Graphics:HTMLFiles/index_30.gif]

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

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

[Graphics:HTMLFiles/index_31.gif]

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}]

TagBox[RowBox[{RemoveSurface, [, RowBox[{RowBox[{RodLens, [, RowBox[{1, ,, 1, ,, RowBox[{{, Ro ... um, , 1.48}], ,, FresnelReflectionsTrue}], }}]}], ]}], ,, {1, 5}}], ]}], HoldForm]

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

[Graphics:HTMLFiles/index_33.gif]

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]]

RowBox[{System traced in , , 22.5833, ,  seconds with , , 706, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_35.gif]

RowBox[{64.3667,  , Second}]

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]]

RowBox[{System traced in , , 205.567, ,  seconds with , , 5076, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_38.gif]

RowBox[{266.7,  , Second}]

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]]

RowBox[{System traced in , , 253.833, ,  seconds with , , 5786, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_41.gif]

RowBox[{323.2,  , Second}]

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]]

RowBox[{System traced in , , 336.767, ,  seconds with , , 6783, ,  ray segments getting reported.}]

[Graphics:HTMLFiles/index_44.gif]

RowBox[{376.233,  , Second}]

Go to list of topics


Created by Mathematica  (November 19, 2004)