Skip to content

timursafiullin/optical-tweezer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Optical Tweezer 2D Demo

Interactive 2D visualization of an optical tweezer for a transparent dielectric particle.

The project combines two complementary views of the same optical-tweezer system:

  • geometric ray tracing through a circular particle, used to show how rays bend at the particle boundary;
  • a normalized Rayleigh-style force model, used to display the gradient force, radiation-pressure force, and their vector sum.

The goal is educational rather than metrological: the application is designed to show the direction, balance, and qualitative scaling of the main optical forces in a focused-beam tweezer.

Features

  • Interactive Matplotlib GUI with sliders for particle position, beam width, particle radius, refractive indices, lens position, lens width, and focal distance.
  • Optional Gaussian beam profile.
  • Optional focusing lens.
  • Ray tracing through a circular dielectric particle using Snell's law.
  • Total internal reflection markers.
  • Separate force arrows for:
    • gradient force, F_grad;
    • radiation-pressure force, displayed as F_рас;
    • total force, F_Σ.
  • Numeric force readout in normalized units.

Quick Start

Requirements:

  • Python 3.10 or newer;
  • NumPy;
  • Matplotlib.

Install dependencies:

pip install numpy matplotlib

Run the demo:

python optical_tweezer_demo.py

Repository Structure

.
├── optical_tweezer_demo.py    # Entry point and compatibility exports
└── optical_tweezer
    ├── __init__.py
    ├── app.py                 # Matplotlib UI and scene rendering
    ├── config.py              # Simulation and visualization constants
    ├── geometry.py            # Vector geometry, reflection, refraction
    ├── optics.py              # Ray tracing through the particle
    └── physics.py             # Rayleigh-style force model

Physical Background

An optical tweezer confines microscopic particles with a strongly focused laser beam. Light carries momentum. When a particle refracts, reflects, scatters, or absorbs light, the momentum of the electromagnetic field changes; the particle receives the opposite momentum change.

The modern single-beam optical tweezer was developed from the radiation-pressure experiments of Arthur Ashkin. The central idea is that a tightly focused beam can create a restoring force near the focus. For a dielectric particle with refractive index higher than that of the surrounding medium, the particle is pulled toward the region of higher optical intensity.

Optical tweezers are used for:

  • manipulation of dielectric microspheres;
  • single-cell and organelle manipulation;
  • force spectroscopy in biophysics;
  • DNA, RNA, and protein mechanics;
  • colloidal physics;
  • calibration of microscopic forces in the pico-newton range.

Forces in an Optical Tweezer

Gradient Force

The gradient force appears because a polarizable particle in a non-uniform optical field is pulled toward higher intensity. For a dielectric particle with n_particle > n_medium, this force points approximately toward the beam focus or the beam axis.

In the Rayleigh limit, where the particle radius is much smaller than the wavelength, the induced dipole approximation gives:

F_grad ∝ alpha * grad(|E|^2)

Since optical intensity is proportional to the squared electric-field amplitude,

I ∝ |E|^2

the model can be written qualitatively as:

F_grad ∝ alpha * grad(I)

For a small dielectric sphere, the polarizability scales as:

alpha ∝ R^3 * (m^2 - 1) / (m^2 + 2)
m = n_particle / n_medium

The implementation therefore uses the normalized form:

F_grad = C_grad * n_medium * R^3 * K * grad(I)
K = (m^2 - 1) / (m^2 + 2)

where C_grad is a visualization gain.

Radiation-Pressure Force

The radiation-pressure force is the forward push from the optical momentum flux. In a simple picture, photons carry momentum along the direction of beam propagation. Scattering and momentum transfer produce a force in that direction.

In the Rayleigh regime, the scattering contribution scales strongly with particle size and refractive-index contrast:

F_rad ∝ I * sigma_scat * k_hat
sigma_scat ∝ R^6 * K^2
K = (m^2 - 1) / (m^2 + 2)

The implementation uses:

F_rad = C_rad * n_medium * R^6 * K^2 * I * k_hat

where:

  • C_rad is a visualization gain;
  • I is the local normalized intensity;
  • k_hat is the local propagation direction, currently downward in the plotted coordinate system.

In the UI this component is displayed as F_рас.

Total Optical Force

The displayed total force is:

F_total = F_grad + F_rad

This is the green F_Σ arrow in the visualization.

Horizontal and Vertical Force Components

The horizontal component mainly comes from the transverse intensity gradient. If the particle is shifted sideways from the beam axis, the intensity is different across the particle. For n_particle > n_medium, the gradient force tends to pull the particle back toward the optical axis.

The vertical component is the competition between:

  • axial gradient force, which can pull the particle toward the focus;
  • radiation pressure, which pushes the particle along the beam propagation direction.

In a stable single-beam tweezer, the beam must be focused strongly enough for the axial gradient force to overcome radiation pressure near the focus. This is why optical tweezers typically use high numerical-aperture objectives.

In real experiments, vertical force balance may also include gravity and buoyancy:

F_g,eff = (rho_particle - rho_medium) * V * g

Those terms are not included in the current code.

Beam Model

Without the lens, the code supports two transverse profiles:

Uniform beam:   I = 1
Gaussian beam:  I(x) = exp(-2x^2 / d^2)

For the focused mode, the code uses a simplified Gaussian-focus model around the focal point. The waist is estimated from an effective numerical aperture:

NA_eff = aperture / sqrt(aperture^2 + focal_distance^2)

and the beam waist is estimated as:

w0 ≈ wavelength / (pi * NA_eff)

The local intensity is then approximated by the paraxial Gaussian-beam form:

I(x, z) = 1 / q * exp(-2x^2 / (w0^2 q))
q = 1 + (z / z_R)^2
z_R = pi * w0^2 / wavelength

The gradient force is computed from the spatial gradient of this normalized intensity.

Ray-Tracing Model

The ray-tracing part of the application is independent from the force formula. It is used to visualize how rays bend through the particle.

The particle is represented as a 2D circle. Each ray:

  1. intersects the circle boundary;
  2. refracts into the particle using Snell's law;
  3. propagates inside the particle;
  4. refracts back into the medium;
  5. reflects internally if total internal reflection occurs.

The vector form of Snell's law is implemented in optical_tweezer/geometry.py. Total internal reflection is detected when the transmitted direction is not physically real.

Assumptions and Limitations

This is a compact educational model. It intentionally omits several effects needed for quantitative optical-tweezer simulation:

  • no full Maxwell-equation solution;
  • no Mie scattering;
  • no Fresnel reflection/transmission coefficients in the force model;
  • no absorption or heating;
  • no Brownian motion;
  • no viscous drag;
  • no gravity or buoyancy in the displayed force;
  • no hydrodynamic wall corrections;
  • no calibration to SI units;
  • 2D geometry instead of a full 3D optical field.

The force values are normalized. They should be interpreted as relative visualization values, not pico-newton predictions.

Interpreting the Sliders

  • x0: horizontal particle displacement.
  • d: beam half-width parameter.
  • R: particle radius.
  • n_ч: particle refractive index.
  • n_ср: surrounding medium refractive index.
  • L до линзы: distance from particle plane to lens.
  • w линзы: lens half-width.
  • f фокус: focal distance.

The checkboxes enable:

  • Gaussian intensity profile;
  • focusing lens.

Notes on Refractive-Index Contrast

The gradient force does not scale with the raw difference n_particle - n_medium. In this model it scales with:

n_medium * (m^2 - 1) / (m^2 + 2)
m = n_particle / n_medium

The radiation-pressure force scales with the square of the contrast factor:

n_medium * ((m^2 - 1) / (m^2 + 2))^2

Therefore radiation pressure can grow faster than the gradient component as refractive-index contrast increases.

About

Interactive optical tweezer simulation with ray tracing and force visualization. Demonstrates how focused laser beams trap dielectric particles through the interplay of gradient and radiation-pressure forces.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages