How to implement a frequency dependent analysis?

7 views (last 30 days)
How can I correctly implement this function (attenuation dependent on the frequency)
in Matlab, where and.
I expect a plot with one graph like this
My code so far is:
%Schirmdämpfung bei longitudinalen magnetischem Feld
clear *;
clc;
r_0 = 6.2E-4; % [m] Innenradius Schirm
d = 2E-5; % [m] Dicke des Schirms
% Frequenz und Winkelgeschwindigkeit
f1 = 100E6; % [Hz] Frequenz zum Starten
df = 100E6; % [Hz] Schrittweite der Frequenz
fmax = 10E9; % [Hz] letzte Frequenz
f = f1:df:fmax; % [Hz] Frequenz als Vektor ausgeben
omega = 2*pi*f; % [rad/s] Winkelgeschwindigkeit
mu0 = 1.256637061E-6; % [N/A^2] mag. Feldkonstante
mu_r = 1; % realtive mag. Permeabilität
mu = mu0*mu_r; % [N/A^2] effektive mag. Permeabilität
% elektrische Leitfähigkeit
sigma_Al = 37E6; % [S/m] Leitfähigkeit von Aluminium
sigma_Co = 58E6; % [S/m] Leitfähigkeit von Kupfer
% Wirbelstromkonstante
k_w_Al = sqrt(1i*omega*mu*sigma_Al); % Wirbelstromkonstante für Aluminium (3.24)
k_w_Co = sqrt(1i*omega*mu*sigma_Co); % Wirbelstromkonstante für Kupfer (3.24)
% Eindringtiefe
delta_Al = sqrt(1./(pi*f*mu*sigma_Al)); % Eindringtiefe Aluminium
delta_Co = sqrt(1./(pi*f*mu*sigma_Co)); % Eindringtiefe Kupfer
% Abkürzung K
K_Al = k_w_Al*r_0/mu_r; % Abkürzung nach (3.68) für Aluminium
K_Co = k_w_Co*r_0/mu_r; % Abkürzung nach (3.68) für Kupfer
% Dämpfung
a_m_Al = 20.*log10(cosh(k_w_Al.*d)+0.5.*K_Al.*sinh(k_w_Al.*d)); % logarithmische Dämpfung für Aluminium
%a_m_Al_O = cosh(k_w_Al.*d)+0.5.*K_Al.*sinh(k_w_Al.*d);
%a_m_Co = 20*log10(cosh(k_w_Co*d)+0.5*K_Co*sinh(k_w_Co*d)); % logarithmische Dämpfung für Kupfer
%plot(f,a_m_Al)

Accepted Answer

Jon
Jon on 14 Aug 2019
Edited: Jon on 14 Aug 2019
You are quite close with your code. I think you just need to use the semilogx with a few annotations as shown below
%Schirmdämpfung bei longitudinalen magnetischem Feld
clear *;
clc;
r_0 = 6.2E-4; % [m] Innenradius Schirm
d = 2E-5; % [m] Dicke des Schirms
% Frequenz und Winkelgeschwindigkeit
f1 = 100E6; % [Hz] Frequenz zum Starten
df = 100E6; % [Hz] Schrittweite der Frequenz
fmax = 10E9; % [Hz] letzte Frequenz
f = f1:df:fmax; % [Hz] Frequenz als Vektor ausgeben
omega = 2*pi*f; % [rad/s] Winkelgeschwindigkeit
mu0 = 1.256637061E-6; % [N/A^2] mag. Feldkonstante
mu_r = 1; % realtive mag. Permeabilität
mu = mu0*mu_r; % [N/A^2] effektive mag. Permeabilität
% elektrische Leitfähigkeit
sigma_Al = 37E6; % [S/m] Leitfähigkeit von Aluminium
sigma_Co = 58E6; % [S/m] Leitfähigkeit von Kupfer
% Wirbelstromkonstante
k_w_Al = sqrt(1i*omega*mu*sigma_Al); % Wirbelstromkonstante für Aluminium (3.24)
k_w_Co = sqrt(1i*omega*mu*sigma_Co); % Wirbelstromkonstante für Kupfer (3.24)
% Eindringtiefe
delta_Al = sqrt(1./(pi*f*mu*sigma_Al)); % Eindringtiefe Aluminium
delta_Co = sqrt(1./(pi*f*mu*sigma_Co)); % Eindringtiefe Kupfer
% Abkürzung K
K_Al = k_w_Al*r_0/mu_r; % Abkürzung nach (3.68) für Aluminium
K_Co = k_w_Co*r_0/mu_r; % Abkürzung nach (3.68) für Kupfer
% Dämpfung
a_m_Al = 20.*log10(cosh(k_w_Al.*d)+0.5.*K_Al.*sinh(k_w_Al.*d)); % logarithmische Dämpfung für Aluminium
%a_m_Al_O = cosh(k_w_Al.*d)+0.5.*K_Al.*sinh(k_w_Al.*d);
%a_m_Co = 20*log10(cosh(k_w_Co*d)+0.5*K_Co*sinh(k_w_Co*d)); % logarithmische Dämpfung für Kupfer
a_m_Co = 20.*log10(cosh(k_w_Co.*d)+0.5.*K_Co.*sinh(k_w_Co.*d)); % logarithmische Dämpfung für Kupfer
% plot results
semilogx(f,a_m_Al,f,a_m_Co)
xlabel('f [Hz]')
ylabel('a_m [dB]')
legend({'Aluminum','Kupfer'})
By the way, you seem to be in a higher frequency range than for your example plot. Was that intentional?
Also, I see a warning that we are only plotting the real part of a_m_Al and a_m_Co, is that OK or do you need to get the magnitude of these before plotting them?
If you do more of this type of work, I would recommend further improving your code by putting everything into matrices, for example with one row for aluminum, the next for copper, etc., and then do all of your calculations in a loop over the number of material that you are considering. In your case just two. That way you don't have all of this cut and paste, with possible errors/inconsistencies in the formulas.
  2 Comments
Matthias Tiek
Matthias Tiek on 14 Aug 2019
Edited: Matthias Tiek on 14 Aug 2019
That seems to work out! Thank you! For my calculation I need the higher frequencies.
As I have just seen, the magnitude would be important as well.
Jon
Jon on 14 Aug 2019
Glad to hear that this worked for you.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!