Created
February 27, 2012 23:57
-
-
Save OlliV/1927991 to your computer and use it in GitHub Desktop.
Skin Depth Calculator on Matlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ------------------------------------------------------------------------- | |
% | Skin Depth Calculator | | |
% | ===================== | | |
% | Olli Vanhoja | | |
% | 2010-08-26 | | |
% | | |
% e_r1 e_r2 | | |
% e_ri1 e_ri2 | | |
% mu_r1 mu_r2 | | |
% | | |
% | | | | |
% E_in -----> | --> x | | | |
% --- | |tau| | | | |
% gamma ) | | | | |
% P_refl <-- | | | | |
% | | | | |
% | | |
% ------------------------------------------------------------------------- | |
clear all | |
close all | |
close all hidden | |
clc | |
% Parameters | |
f = 3*10^9; % Hz | |
E_in = 10; % V/m | |
e_r1 = 1; | |
e_ri1 = 0; | |
mu_r1 = 1; | |
e_r2 = 15; | |
e_ri2 = 1.5; | |
mu_r2 = 1; | |
sigma = 0; | |
x = 0.1; | |
% Constants | |
c_0 = 299792458; | |
mu_0 = 4*pi*10^-7; | |
e_0 = 1/(mu_0*c_0^2); | |
j = sqrt(-1); % Imaginary unit | |
omega = 2*pi*f; | |
eps1 = (e_r1-j*e_ri1)*e_0; | |
eps2 = (e_r2-j*e_ri2)*e_0; | |
if sigma == 0 | |
sigma = 1; | |
end | |
eta_1 = sqrt((mu_0*mu_r1)/(eps1)); | |
eta_2 = sqrt((mu_0*mu_r2)/(eps2)); | |
gamma = abs((eta_1-eta_2)/(eta_1+eta_2)); % Reflection coefficient | |
%tau = (2*eta_2)/(eta_2+eta_1); % Transmission coefficient | |
tau = 1-gamma; | |
alpha = sqrt(omega*mu_0*mu_r2*sigma); | |
E_tau = tau*E_in*exp(-alpha*x); | |
fprintf('E_in = %f V/m\neta_1 = %f+%fj ohm\neta_2 = %f%+fj ohm\n', E_in, eta_1, imag(eta_1), eta_2, imag(eta_2)); | |
fprintf('gamma = %f\ntau = %f\ngamma+tau = %f\n', gamma, tau, gamma+tau); | |
fprintf('E_tau = %e V/m\n', E_tau); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment