panhandlefamily.com

Creating Stunning Visualizations of Interference Patterns

Written on

Chapter 1: Introduction to Interference Patterns

During my recent exploration of photonics for an assignment, I set out to generate a 2D representation of the interference pattern from Young's double-slit experiment. I even attempted a 3D version for fun, but time constraints limited my ability to create an animation. Today, we will complete this endeavor.

The process we will follow includes:

  1. Generating the 2D screen output of the double-slit experiment.
  2. Creating the 3D surface plot of the phenomenon.
  3. Developing the animation.

Section 1.1: Setting Up the Double Slit Parameters

To begin, we need to define the parameters for the double slit and the incident waves:

  • Wavelength (λ) = 500 nm
  • Slit width (a) = 5 µm
  • Distance to screen (d) = 1 cm
  • Initial light intensity (I₀) = 1
  • Screen dimensions = 2 mm x 2 mm

This information is based on "Fundamentals of Photonics" by Saleh & Teich.

For the light intensity screen image, we must utilize the following intensity formula.

Let’s implement this formula in MATLAB:

clear all;

I0 = 1;

lambda = 500 * (10^-9); % 500nm wavelength

a = 5e-06; % 5µm

d = 1e-2; % 1cm

Q = 2 * atand((a/2) / d); % Calculate theta angle

% Screen dimensions

x = 0:2.0000e-05:0.002; % 2mm

y = 0:2.0000e-05:0.002; % 2mm

[X,Y] = meshgrid(x,y);

Next, we implement the intensity function:

f = 2 * I0 * (1 + cos(X * 2 * pi * Q / lambda)); % Light intensity formula

Visualizing the screen output:

imagesc(f);

Section 1.2: Visualizing the 3D Surface Plot

In this step, we adjust some parameters for a clearer 3D surface visualization of the double-slit experiment. We introduce a scaling factor (K) to enhance the surface's appearance:

K = 10^5;

d = K * (10^-5);

d_y = d / 2;

interval = d / 110;

x = 0:interval:d;

y = -d_y:interval:d_y;

lambda = K * 500 * (10^-9);

k = (2 * pi) / lambda;

w = (2 * pi) / lambda;

[X,Y] = meshgrid(x,y);

Defining the circular waves:

R1 = (X.^2 + (Y + (2.5 * K * (10^-6))).^2)^(1/2);

R2 = (X.^2 + (Y - (2.5 * K * (10^-6))).^2)^(1/2);

Defining the propagation waves:

u1 = K * cos(k * R1);

u2 = K * cos(k * R2);

Z = u1 + u2;

Visualizing the 3D plot:

surf(X,Y,Z);

Chapter 2: Creating the Animation

Now for the exciting part—let's create the animation!

K = 10^5;

d = K * (10^-5);

d_y = d / 2;

res = 110; % Adjust resolution by changing the number of points

interval = d / res;

x = 0:interval:d;

y = -d_y:interval:d_y;

lambda = K * 500 * (10^-9);

k = (2 * pi) / lambda;

[X,Y] = meshgrid(x,y);

R1 = (X.^2 + (Y + (2.5 * K * (10^-6))).^2)^(1/2);

R2 = (X.^2 + (Y - (2.5 * K * (10^-6))).^2)^(1/2);

u1 = K * cos(k * R1);

u2 = K * cos(k * R2);

Z = K * cos(k * R1) + K * cos(k * R2);

% Loop for each frame of the animation

for k = 1:res

hold on;

surf(X(:,k:k+1),Y(:,k:k+1),Z(:,k:k+1));

grid on;

whitebg('white'); % Set background color

set(gcf,'Position',[10 50 1000 700]);

view([-2,-1.5,3]); % Set perspective

hold off;

Mov(k) = getframe;

axis([0 0.6 0 inf]);

end

In the movie() function, the first parameter indicates how many times to repeat the animation, while the second parameter specifies the frames per second (fps).

movie(Mov,5,40);

Congratulations! You have successfully created a simple animation of wave interference. I hope you found this guide enjoyable and informative.

For further questions or discussions, feel free to reach out!

[email protected] ✉️

The first video demonstrates how to study the interference pattern using MATLAB, showcasing practical applications and methodologies.

The second video is a tutorial lecture on interference in MATLAB, providing deeper insights into the concepts discussed.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

A Cautionary Tale: Lessons from an Arrogant CEO's Fall

A deep dive into the pitfalls of overconfidence, as illustrated by the rise and fall of a CEO who lost it all.

Achieve Your Writing Goals: 30 Articles in 30 Days Challenge

Join a 30-day writing challenge to boost productivity and overcome perfectionism, creating a solid writing habit.

Why Do Some Poops Float While Others Sink? A Scientific Inquiry

Explore the science behind why some stools float and others sink, revealing the role of gut bacteria and gas production.

# Embracing Forgiveness: The Path to Healing and Growth

Explore how forgiveness can lead to personal healing and growth while letting go of negative emotions.

Essential Insights for Aspiring Investors

Discover key lessons for navigating the stock market, from managing emotions to diversifying investments.

# Transform Your Spending Habits by Selling Old Items for New Toys

Discover how selling unused items can finance new purchases without guilt.

The Global Pursuit for Quantum Computing Supremacy

The international race for quantum computing supremacy is revolutionizing technology, with significant implications across various fields.

Strategies to Overcome Self-Loathing: A Path to Self-Acceptance

Discover effective strategies to combat self-loathing and foster self-acceptance, enhancing your overall well-being.