How to fix the code for the derivative of the Hankel function asymtotic expansion? [I added my code here]

조회 수: 2 (최근 30일)
I want to write the prime of this hankel function expansion, where , zeta, B0, ka are given, nu is complex which is also given in the question, How can I write the derivatiove of this Hankel function first kind equation 21? I am providing here the equations in attached file also I am providing the code I wrote, I am not sure this is the exact way to write the prime or not. Can anybody help me to fix this derivative part of this ciode?
%% Constants
mu0 = 4 * pi * 1e-7; % Permeability of free space
eps0 = 8.854e-12; % Permittivity of free space
c = 3e8; % Speed of light
freq = [1e9]; % Frequency (1 GHz)
lambda0 = c / (freq); % Free-space wavelength
k0 = 2 * pi ./ (lambda0); % Free-space wavenumber
b = 20 ./ (k0); % Outer radius of the dielectric coating (~0.955 meters)
eps_r = 4;
%mu_r= mu/mu0% Relative permittivity
eps1 = eps_r * eps0; % Permittivity of dielectric
k1 = k0 * sqrt(eps_r);
xl = -(2.33810741);
omega= 2*pi*freq;
d = 0.30*lambda0;% thickness of the dielectric material in cylider
a = b - d; % Compute inner radius of the cylinder
%% Compute k1*a and k1*b
k1a = k1 * (a);
k1b = k1 * (b);
%
%disp (k1a)
% %k1= omega* sqrt (eps1); %% if Naishadham's paper
%%
%% nu_equation for k1a case
term1 = k1 * a;
term2 = - exp(1i * pi/3) * xl * (k1*a)^(1/3);
% Term 3
term3 = (1/60) ...
* exp(1i * (2*pi/3)) ...
* (xl^2) ...
* ((1/2)*k1*a)^(-1/3);
% Term 4:
term4 = - ((xl^3 + 10) / 1400) ...
* ((1/2)*k1*a)^(-1);
% Term 5:
term5 = - exp(1i * pi/3) ...
* (281*xl^4 + 10440*xl) / 4536000 ...
* ((1/2)*k1*a)^(-5/3);
% Term 6:
term6 = - exp(1i * 2*pi/3) ...
* (73769*xl^5 + 6624900*xl^2) / 10478160000 ...
* ((1/2)*k1*a)^(-7/3);
% Term 7:
term7 = ( (93617*xl^6 + 16495400*xl^3 - 1744600) / 100900800000 ) ...
* ((1/2)*k1*a)^(-3);
% Term 8 (Big-O term):
term8 = (k1*a)^(-11/3);
nu_k1a = term1 + term2 + term3+term4+term5+term6+term7+term8;
disp(nu_k1a);
40.0812 + 6.7302i
%% write expression for zeta_k1a using equation 16
bracketTerm = ...
log( ( nu_k1a + sqrt(nu_k1a^2 - k1a^2 ) ) / k1a ) ...
- sqrt( (nu_k1a^2 - k1a^2) / (nu_k1a^2) );
zeta_k1a = ( (3/2)^(2/3) ) * ( bracketTerm )^(2/3);
disp('zeta_k1a =');
zeta_k1a =
disp(zeta_k1a);
0.1480 + 0.2001i
%% write beta0 zeta_k1a case
B0_zeta_k1a = -5/(48 * zeta_k1a^2) ...
+ (1 / (24 * sqrt(zeta_k1a))) * ...
( (5 * nu_k1a^3) / ((nu_k1a^2 - (k1*a)^2)^(3/2)) ...
- (3 * nu_k1a) / ((nu_k1a^2 - (k1*a)^2)^(1/2)) );
disp('B0_zeta_k1a');
B0_zeta_k1a
disp(B0_zeta_k1a);
0.0193 + 0.0019i
%% Hankel function first kind expansion k1a case
% 2) Airy argument
% Now we have nu_k1a in place of nu, and zeta_k1a in place of zeta.
zArg = exp(1i * (2*pi/3)) * (nu_k1a^(2/3)) * zeta_k1a;
% 3) Compute Airy function and derivative
% airy(0,z) = Ai(z)
% airy(1,z) = Ai'(z)
AiVal = airy(0, zArg); % Ai(zArg)
AiPrimeVal = airy(1, zArg); % Ai'(zArg)
% prefactor = 2*sqrt(2) * [ (nu_k1a^2 * zeta_k1a) / (nu_k1a^2 - (k1a)^2 ) ]^(1/4)
prefactor = 2*sqrt(2) * ...
( (nu_k1a^2 * zeta_k1a) / (nu_k1a^2 - (k1a)^2 ) )^(1/4);
% bracket = e^(-i*pi/3)*AiVal*nu_k1a^(-1/3)
% + e^( i*pi/3)*AiPrimeVal*nu_k1a^(-5/3)*B0_zeta_k1a
term1 = exp(-1i * pi/3) ...
* AiVal ...
* (nu_k1a^(-1/3));
term2 = exp(1i * pi/3) ...
* AiPrimeVal ...
* (nu_k1a^(-5/3)) ...
* B0_zeta_k1a;
bracket = term1 + term2;
Term3 = 1 + 1/(nu_k1a^2);
% ========================================
H_nu_k1a_approx = prefactor * bracket * Term3;
% ======================
% 8) Display the result
% ======================
disp('Asymptotic Hankel H_nu^(1)(k1*a) = ');
Asymptotic Hankel H_nu^(1)(k1*a) =
disp(H_nu_k1a_approx);
-0.1275 + 0.2372i
%% write the derivative of Hankel function first kind k1a case
%%%% [derivative of equation 21]
%2) Define the Hankel function (first kind) as a function handle
%Hfun(a)
%2) Define the big-O replacement factor:
Term3 = 1 + 1/(nu_k1a^2);
% 3) Build a function handle for H_nu^(1)(k1*a)
% We implement the prefactor, bracket, and Term3 as described above.
Hfun = @(a) ...
( 2*sqrt(2) ...
* ( (nu_k1a^2 * zeta_k1a) ./ (nu_k1a^2 - (k1.*a).^2 ) ).^(1/4) ) ...
.* ( ...
exp(-1i*pi/3)*AiVal * nu_k1a^(-1/3) ...
+ exp( 1i*pi/3)*AiPrimeVal * nu_k1a^(-5/3) * B0_zeta_k1a ...
) ...
.* Term3;
% Explanation of the main pieces:
% - The prefactor = 2*sqrt(2)* [ (nu_k1a^2*zeta_k1a)/(nu_k1a^2 - (k1*a)^2 ) ]^(1/4).
% - The bracket = e^(-i*pi/3)*AiVal*nu_k1a^(-1/3)
% + e^( i*pi/3)*AiPrimeVal*nu_k1a^(-5/3)*Beta0_k1a.
% - We multiply by (1 + 1/nu_k1a^2) for the big-O term.
% 4) Finite-difference derivative at a
da = 1e-6; % small step
H_plus = Hfun(a + da);
H_minus = Hfun(a - da);
H_prime_approx = (H_plus - H_minus) / (2*da);
disp('Approx derivative d/da [H_nu^(1)(k1*a)] at a :');
Approx derivative d/da [H_nu^(1)(k1*a)] at a :
disp(H_prime_approx)
0.2070 + 0.2747i
  댓글 수: 27
Torsten
Torsten 2025년 3월 19일
Why ? Differentiate J and Y you receive from the code I gave you the link for by a finite difference quotient and compute the Hankel derivative of first and second kind as dJ + 1i*dY resp. dJ - 1i*dY.
SSWH2
SSWH2 2025년 3월 19일
@Torstenmanuel derivative I already did, so I thought is there any buit in function in MATLAB which can does it randomly. I did already manually this way taking small difference at a and b. Thanks
% Central difference
% 1) Save your original b, k1b
b_orig = b;
k1b_orig = k1b; % presumably k1*b
% 2) Choose a small finite-difference step
db = 1e-6;
% ==========================
b_minus = b_orig - db;
dH_db = (H_plus_k1b - H_minus_k1b) / (2 * db);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Eigenvalue Problems에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by