Pressure Sensitive Lens

This notebook demonstrates the flexibility of Rayica. A lens made of a polymer membrane is modeled. The membrane seals a chamber with a pressure higher than the environment and is therefore deformed.
A ray traversing the flexible lens passes a window, the pressure fluid and the membrane.
The theory applied for calculation of the deformation is the plate theory that assumes a two dimensional stress. Normally, the limits of this theory are reached, if the membrane is no longer thin in thickness compared to its other dimensions. We use here the term plate rather than membrane.
Short names for symbols are used to reduce the overall size of the formulas.

(*this avoids a lot of warning messages for similar names*)
Off[General::"spell"];

(*these symbols are used only symbolically*)
Clear[x, y, F0];

The values are typical values also usable in experiments. Usually t0 is smaller in practice.

Clear[t0,EM,ny,K,R0];
R0 = 10*10^(-3); (*plate radius*)
t0 = 0.5*1.5 10^(-3); (*half plate thickness*)
EM = 5.1*10^9; (*Pa, Youngs modulus, measured value for PET*)
ny = 0.5; (*Poisson number, incompressible*)
K = EM*t0^3 / (12*(1-ny^2)); (*plate stiffness*)

The plate is assumed to be fixed at its boundary, the translation and its first derivative is zero at the boundary. The force on the plate is the pressure in the chamber.

Clear[w];
w[F0_,r_] := 
If[r<R0,
	1/64 * F0/(Pi*K) * R0^2 * 
		( (1-(r/R0)^2)^2 + 16/5*1/(1-ny)*(t0/R0)^2*(1-(r/R0)^2)^2 )
,0];

Deformation of the plate also causes a change in the plate thickness.

Clear[Deltat];
Deltat[F0_,r_] := 
If[r<R0,
	t0/2 * t0^2/10/(1-ny) * F0/Pi/K * r/R0^2
,0];

These are the boundary surfaces forming the optical meniscus lens made of the polymer plate.

Clear[S1,S2];
S1[Deltax_,Deltay_,F0_,x_,y_] :=
	{w[F0,Sqrt[(x-Deltax)^2+(y-Deltay)^2]] -
	Deltat[F0,Sqrt[(x-Deltax)^2+(y-Deltay)^2]],x,y};
S2[Deltax_,Deltay_,F0_,x_,y_] := 
	{w[F0,Sqrt[(x-Deltax)^2+(y-Deltay)^2]] +
	Deltat[F0,Sqrt[(x-Deltax)^2+(y-Deltay)^2]]+t0,x,y};

The Window forms the one side of the flexible plano convex lens. It is bigger than the plate to place the deformed plate off-axis.

Clear[LensWindow];
LensWindow = Window[R0 * 4, t0 * 10];

For simplicity, constant refractive indices are assumed for the plate and the pressure fluid.

Clear[PlateMaterial,FluidMaterial];
Unprotect[ModelRefractiveIndex];
ModelRefractiveIndex[PlateMaterial] = IndexFunction[1.6^2, 0, 0, 0, 0, 0];
ModelRefractiveIndex[FluidMaterial] = IndexFunction[1.61^2, 0, 0, 0, 0, 0];
Protect[ModelRefractiveIndex];

These translations place the plate in an off-axis position.

Clear[Deltax,Deltay];
Deltax = 0.5 * R0; (*m, Translation of plate center in x direction*)
Deltay = 1.0 * R0; (*m, Translation of plate center in y direction*)

The surfaces O1 and O2 are in the coordinate system that already include the translation.

Clear[O1,O2,PlateThickness];
O1 = Map[Function[{x,y},#]&,S1[Deltax,Deltay,F0,x,y]];
O2 = Map[Function[{x,y},#]&,S2[Deltax,Deltay,F0,x,y]];
PlateThickness = t0;

Now, Rayica is informed about the new shapes.

Clear[PlateFrontSurface,PlateBackSurface];
Unprotect[ModelSurfaceShape];
ModelSurfaceShape[PlateFrontSurface,{F0_}] = {SurfaceFunction->O1};
ModelSurfaceShape[PlateBackSurface,{F0_}] = {SurfaceFunction->O2};
Protect[ModelSurfaceShape];

The force on the plate is the pressure times the area of the plate. It is perpendicular to the plate and measured in Newton. Its value is choosen to yield graphics that show clearly the function of the lens. The lens thickness is arbitrarily choosen to be 80% of the plate radius.

Clear[Force,LensThickness];
Force = -1200;
LensThickness = 0.8 * R0;

We now form the Rayica objects representing the flexible lens in terms of surfaces. The whole lens is wrapped by Resonate to allow any path through the flexible lens.

Clear[
	OuterPlateSurface, InnerPlateSurface,
	InnerWindowSurface, OuterWindowSurface,
	LensSurfaces];
OuterPlateSurface = CustomLensSurface[
	{Force}, R0 4,
	SurfaceLabel -> PlateFrontSurface,
	ComponentMedium -> PlateMaterial,
	GraphicDesign -> Wire, CrossRendering -> Mesh,
	SurfaceRayIntersections -> Numeric];
InnerPlateSurface = CustomLensSurface[
	{Force}, R0 4,
	SurfaceLabel -> PlateBackSurface,
	ComponentMedium -> {PlateMaterial, FluidMaterial},
	GraphicDesign -> Wire, CrossRendering -> Mesh,
	SurfaceRayIntersections -> Numeric];
InnerWindowSurface = LensSurface[
	R0 4,
	ComponentMedium -> {FluidMaterial, BK7},
	GraphicDesign -> Wire, CrossRendering -> Mesh];
OuterWindowSurface = LensSurface[
	R0 4,
	ComponentMedium -> BK7,
	GraphicDesign -> Wire, CrossRendering -> Mesh];
LensSurfaces = Resonate[{
	OuterPlateSurface,
	InnerPlateSurface,
	Move[InnerWindowSurface, LensThickness],
	Move[OuterWindowSurface, LensThickness+t0 10]
}];

We now form the Rayica objects representing the flexible lens in terms of bulk lenses to test an alternative way of definig the same object. The whole lens is wrapped by Resonate to allow any path through the flexible lens.

Clear[Plate];
Plate = CustomLens[{Force}, {Force}, R0 4, PlateThickness,
	SurfaceLabel -> {PlateFrontSurface, PlateBackSurface},
	ComponentMedium -> PlateMaterial,
	GraphicDesign -> Wire,
	SurfaceRayIntersections -> Numeric];
Clear[Fluid];
Fluid=CustomLens[{Force}, {Force}, R0 4, LensThickness,
	SurfaceLabel -> {PlateBackSurface, PlanarShape},
	ComponentMedium -> FluidMaterial,
	GraphicDesign -> Wire,
	CrossRendering -> Mesh,
	SurfaceRayIntersections -> Numeric];
Clear[FlexibleLens];
FlexibleLens = Resonate[{
	Plate,
	Move[Fluid, t0],
	Move[LensWindow, LensThickness+t0]
}];

ShowSystem[Plate, Axes->True, BoxRatios -> {1/4, 1, 1}];

ComparasionLens=PlanoConvexLens[
	5*R0,2*R0,Abs[S2[Deltax,Deltay,Force,Deltax,Deltay][[1]]],
	ComponentMedium->BK7,GraphicDesign->Wire,CrossRendering->Mesh];
ShowSystem[{
	Fluid,
	Move3D[ComparasionLens,
		{t0-Abs[S2[Deltax,Deltay,Force,Deltax,Deltay][[1]]],0,-Deltay},
		{1,0,0},0]
}, 
Frame->True, PlotType->SideView, AspectRatio -> 1/2,
ShowLabels -> False, PlotRange -> {{-0.01, 0.01}, {-0.02, 0.02}}];

ShowSystem[FlexibleLens, Axes->True];

ShowSystem[LensSurfaces, Axes->True];

This is the orientation and position of the light source.

Clear[TwistAngleSource,PositionSource,
	AngleXYSource,AngleYZSource,WavelengthSource,TiltVectorSource];
TwistAngleSource = 0;
PositionSource = {0,Deltax,Deltay};
AngleXYSource = 0 40.;
AngleYZSource = 0 20.;
WavelengthSource = 0.450;
TiltVectorSource={
	Sqrt[1-(Sin[AngleXYSource Pi/180.])^2-(Sin[AngleYZSource Pi/180.])^2],
	Sin[AngleXYSource Pi/180.],
	Sin[AngleYZSource Pi/180.]};

The lens is oriented as follows.

Clear[TwistAngleLens,PositionLens,AngleXYLens,AngleYZLens,TiltVectorLens];
TwistAngleLens=0;
PositionLens={25,0,0} R0;
AngleXYLens=0 10.;
AngleYZLens=0 30.;
TiltVectorLens={
	Sqrt[1-(Sin[AngleXYLens Pi/180.])^2-(Sin[AngleYZLens Pi/180.])^2],
	Sin[AngleXYLens Pi/180.],
	Sin[AngleYZLens Pi/180.]};

Clear[PressureLensSystem,PressureLensSurfacesSystem];
PressureLensSystem := 
{
	Boundary[{-2,-4,-3} R0,{35,9,12} R0, GraphicDesign -> Off],
	Move3D[PointOfRays[3,
		WaveLength->WavelengthSource,
		NumberOfRays->3
	],PositionSource,TiltVectorSource,TwistAngleSource],
	Move3D[FlexibleLens,PositionLens,TiltVectorLens,TwistAngleLens],
	Boundary[{-2,-4,-3} R0,{35,9,12} R0, GraphicDesign -> Off]
};
PressureLensSurfacesSystem := 
{
	Boundary[{-2,-4,-3} R0,{35,9,12} R0, GraphicDesign -> Off],
	Move3D[PointOfRays[3,
		WaveLength->WavelengthSource,
		NumberOfRays->3
	],PositionSource,TiltVectorSource,TwistAngleSource],
	Move3D[LensSurfaces,PositionLens,TiltVectorLens,TwistAngleLens],
	Boundary[{-2,-4,-3} R0,{35,9,12} R0, GraphicDesign -> Off]
};

Clear[PressureLensTraced,PressureLensSurfacesTraced];
PressureLensTraced = PropagateSystem[PressureLensSystem];
PressureLensSurfacesTraced = PropagateSystem[PressureLensSurfacesSystem];

ShowSystem[PressureLensTraced, Axes->True];

ShowSystem[PressureLensSurfacesTraced, Axes->True];

ShowSystem[PressureLensSurfacesTraced, PlotType -> TopView, 
	ShowLabels -> False, PlotRange -> {{0.24, 0.3}, {-0.025, 0.025}},
	RayPointSize -> 6];

ShowSystem[PressureLensTraced, PlotType -> TopView, 
	ShowLabels -> False, PlotRange -> {{0.24, 0.3}, {-0.025, 0.025}},
	RayPointSize -> 6];