Rayleigh scattering explains why the sky appears blue; it's the scattering of light or other electromagnetic radiation by particles much smaller than the wavelength of the radiation. The scattering intensity is inversely proportional to the fourth power of the wavelength, meaning shorter wavelengths scatter more strongly than longer ones.
Here's how you can approach Rayleigh scattering simulations in MATLAB:
Define Wavelength Range: Choose the range of wavelengths to simulate (e.g., from 400 nm to 700 nm, which covers the visible spectrum).
Calculate Scattering Intensity: Use the formula:
$$ I(\lambda) \propto \frac{1}{\lambda^4} $$
where ( $I(\lambda)$ ) is the intensity and ( $\lambda$ ) is the wavelength.
Normalize Intensity: Normalize the calculated intensities for visualization.
Plot the Results: Plot the wavelength on the x-axis and the normalized intensity on the y-axis.
Here's a simple MATLAB script to visualize Rayleigh scattering:
% Define the range of wavelengths (in nm)
wavelengths = 400:1:700; % Visible spectrum from violet to red
% Calculate Rayleigh scattering intensity (proportional to 1/lambda^4)
intensity = 1 ./ (wavelengths.^4);
% Normalize the intensity for plotting
normalized_intensity = intensity / max(intensity);
% Plotting
figure;
plot(wavelengths, normalized_intensity, 'b-', 'LineWidth', 2);
xlabel('Wavelength (nm)');
ylabel('Normalized Scattering Intensity');
title('Rayleigh Scattering Intensity across the Visible Spectrum');
grid on;
Color Map: To visualize the actual perceived color, use a color map that corresponds to the wavelengths.
Logarithmic Scale: Use a logarithmic y-axis to better show differences across the spectrum:
set(gca, 'YScale', 'log');
Try running the code and modifying parameters to explore how the scattering changes across different wavelength ranges.