Optical fiber layers interference

Issue #22 new
Jose Romero created an issue

Hi guys!

Thanks for this excellent package!

I want to simulate interference signal in optical fiber with some excenctricity in layers.

I define the mask here below.

#-------------------------------------------------------------------
# Fibre

# Le masque est la fibre optique, on crée un masque scalar
t = Scalar_mask_XZ(x=x0, z=z0, wavelength=wavelength, n_background=1.0)

# On défini les couches avec ces index respectifs
t.sphere( (0,100), 85 * um, 1.483, angle = 0)
t.sphere( (0,100), 75 * um, 1.443, angle = 0)
t.sphere( (0,100), 62.5 * um, 1.461, angle = 0)
t.sphere( (0,100), 2.5 * um, 1.462, angle = 0)

# On affiche le bazar
t.draw_refraction_index(draw_borders=False, scale='equal');

Now in my real test bench the fiber is before a lense (f = 40mm) and the sensor (2048 pixels, 10µm pitch) is after lense at z = 50mm.

My linspace became very big, and i don’t know the impact of linspace resolution in the simulation.

Maybe I can get the field and replace the lens transformation with FFT?

Could you please advise the better way to do this simulation?

Best regards

José

Comments (1)

  1. Jose Romero reporter

    I begin my problem with small linspace, having good results:

    I put aspherical lense very near from the fiber:

    Now if we assume

    • the fiber position at z = 0.
    • f40 lense located at z=40mm
    • sensor located at f=80mm (2*f)

    the idea is to get the final field of small linespace and perform RS propagation until the lense. Get the x field and perform antoher RS propagation including the lense, But it not works at expected, maybe I make some mistake:

    # -*- coding: utf-8 -*-
    """
    Created on Tue Sep  6 16:13:54 2022
    
    @author: j.romero
    """
    
    #-------------------------------------------------------------------
    # Import des modules
    
    
    from diffractio import degrees, eps, mm, np, num_max_processors, plt,sp, um
    from diffractio.scalar_fields_XZ import Scalar_field_XZ
    from diffractio.scalar_masks_X import Scalar_mask_X
    from diffractio.scalar_fields_X import Scalar_field_X
    from diffractio.scalar_masks_XZ import Scalar_mask_XZ
    from diffractio.scalar_sources_X import Scalar_source_X
    from matplotlib import rcParams
    
    
    # Tamaño de las imagenes
    rcParams['figure.figsize']=[8,6]
    rcParams['figure.dpi']=125
    
    
    #-------------------------------------------------------------------
    # Simulacion alrededor de la fibra
    
    
    # Definicion del espacio de simulacion en x et z
    x0 = np.linspace(-200 * um, 200 * um, 2048*4)
    z0 = np.linspace(-200 * um, 200 * um, 2048*4)
    
    # Largo de onda del laser
    wavelength = 0.660 * um
    
    # Inicializacion del campo u1
    u1 = Scalar_field_XZ(x=x0, z=z0, wavelength=wavelength)
    
    # Fuente plana
    u0 = Scalar_source_X(x=x0, wavelength=wavelength)
    u0.gauss_beam(A=1, x0=0 * um, z0=0 * um, w0=10 * um, theta=0. * degrees)
    u0.plane_wave(A=1, theta=0 * degrees)
    
    
    # Definicion de la fibra
    u1 = Scalar_mask_XZ(x=x0, z=z0, wavelength=wavelength, n_background=1.0)
    
    # 4 capas de fibra para analyzar
    u1.sphere( (0,0), 85 * um, 1.483, angle = 0)
    u1.sphere( (0,0), 75 * um, 1.443, angle = 0)
    u1.sphere( (0,0), 62.5 * um, 1.461, angle = 0)
    u1.sphere( (0,0), 2.5 * um, 1.462, angle = 0)
    
    # Afectacion del campo incidente
    u1.incident_field(u0)
    
    # Simulacion BMP en 2D
    u1.BPM(verbose=False)
    u1.draw(logarithm=True, normalize='maximum', draw_borders=True, scale='scaled');
    
    # Campo resultante
    u2 = u1.final_field()
    u2.draw();
    
    
    #-------------------------------------------------------------------
    # Simulacion desde la fibra hasta antes del lente en RS
    
    # Dejamos divergir el campo hasta antes del lente y amplifacamos el espacio
    f = 40*mm
    amp = 50
    u3=u2.RS(z=f, amplification=amp, verbose=False)
    
    # Sub muestreo del campo
    N = 4096
    u3.normalize()
    u4 = u3.cut_resample(x_limits=(-10*mm,10*mm), num_points = N, new_field=True)
    u4.draw(cut_value=0.02,logarithm=True, normalize='maximum')
    
    #-------------------------------------------------------------------
    # Definimos otro espacio donde multiplicamos el lente por el campo resulante anterior
    
    x1 = np.linspace(-10 * mm, 10 * mm,  N)
    
    # On defini la lentille
    t1 = Scalar_mask_X(x=x1, wavelength=wavelength)
    t1.lens(x0=0 * mm, radius=26.4 * mm, focal=f)
    
    t2 = t1 * u4
    
    t3 = t2.RS(z = f, new_field=True)
    t4 = t3.cut_resample(x_limits=(0,10*mm), new_field=True)
    t3.draw(cut_value=0.01,logarithm=True, normalize='maximum')
    

    BMP simulation (OK)

    Before lense (OK)

    RS after lense (KO)

    ….

    Thanks for your reply

  2. Log in to comment