데이터 분석

Multi slit 구조에서 빛의 회절을 시뮤레이션 해 보기

r-code-for-data-analysis 2023. 5. 29. 08:45

반도체, 디스플레이에서 노광 공정을 하다 보면 마스크 폭 사이즈가 작아 회절 효과를 자주 보게 된다.

 

역시 빛은 파동이라는 진리를 마주 하게 된다. 

 

이걸 GPT를 통해 R로 시뮬레이션 해 보았다. 

 

1. GPT : 365nm UV 빛이 있고, Open/Space size가 마이크로미터로 변하면서 빛의 회절 효과를 보는 r 코드

 

# Define variables
d <- 15e-6 # slit separation in meters
N <- 5 # number of slits
lambda <- 365e-9 # wavelength in meters
I0 <- 1 # central intensity

# Define function for intensity
intensity <- function(x, a) {
  theta <- atan(x / L) # calculate angle from distance and screen distance L
  I0 * (sin(pi * a * sin(theta) / lambda) / (pi * a * sin(theta) / lambda))^2 *
    (sin(N * pi * d * sin(theta) / lambda) / sin(pi * d * sin(theta) / lambda))^2
}

# Load ggplot2 package for plotting
library(ggplot2)

# Define screen distance L in meters
L <- 1

# Create a sequence of distances from -0.01 to 0.01 meters
x <- seq(-0.01, 0.01, by = 1e-4)

# Create an empty list to store data frames for each value of a
data_list <- list()

# Loop over different values of a from 3e-6 to 18e-6 with step size of 3e-6
for (a in seq(3e-6, 18e-6, by = 3e-6)) {
  d <- 19e-6-a # slit separation in meters
  # Calculate the intensity for each distance using the function defined above
  I <- intensity(x, a)
  
  # Create a data frame with x, I and a columns
  data <- data.frame(x = x, I = I, a = paste("a =", format(a)))
  
  # Append the data frame to the list
  data_list[[length(data_list) + 1]] <- data
  
}

# Combine all data frames in the list into one big data frame using rbind()
data_all <- do.call(rbind, data_list)

# Plot the data using ggplot2 with x-axis as x and y-axis as I and color as a 
ggplot(data = data_all, aes(x = x, y = I, color = a)) +
  geom_line() +
  labs(x = "Distance (m)", y = "Intensity") +
  theme_bw()

 

 

2. 결과 : slit의 open 간격이 넓어질 수록 빛의 회절 효과는 줄어든다. 파동이 아닌 입자처럼 행동함

 

728x90
반응형