I found a project on GitHub that might be helpful. The project is called ElectroMagnetic-Shielding-with-Matlab [1]. In this project, a shielded room was designed such that high frequency waves cannot penetrate into the room. The nonmagnetic, non-conducting shield is coated with a conducting material that should reduce the electromagnetic wave by a factor of 10^6 compared to the field outside. The conducting layer may be made of copper, aluminum, mu-metal, or a conducting polymer (Inconel-Alloy 625) based on different priorities. The electromagnetic properties for each of these four materials were found in order to calculate the thickness required for each of them depending on the angle of incidence and polarization of the wave. Then the corresponding cost and density for each of these materials was found. Based on these characteristics (mass, volume, and cost), the materials are compared and the optimal material was selected. The mathematical modeling for this project was done using MATLAB [1].
I also found a MATLAB code on MathWorks File Exchange that can calculate shielding effectiveness for given frequency, distance, maximum allowable and measured magnetic field value. It can also calculate absorption loss AdB, reflection loss RdB, skin depth and required width for screening t-width. Users can choose from five elements that will affect conductivity: Aluminum, Copper, Gold, Lead, Silver [2].
I can provide you with a simplified example that demonstrates the concept of electromagnetic shielding using a basic 2D model. This example uses the Finite-Difference Time-Domain (FDTD) method, which is a common numerical technique for solving Maxwell's equations. MATLAB Code:
% Parameters
c = 3e8; % Speed of light (m/s)
f = 1e9; % Frequency (Hz)
lambda = c / f; % Wavelength (m)
dx = lambda / 10;
dy = lambda / 10;
dt = dx / (2 * c);
% Grid size
Nx = 100; % Number of spatial grid points in x
Ny = 100; % Number of spatial grid points in y
Nt = 200; % Number of time steps
% Constants
mu0 = 4 * pi * 1e-7; % Permeability of free space (H/m)
epsilon0 = 8.854e-12; % Permittivity of free space (F/m)
epsilonr = 4; % Relative permittivity of the shielding material