correct my integral in line43

please correct line 43 that is about integral function.
tnx a million.
clc;
clear;
close all;
% define sellmier equation to obtain refractive index
T=25; % tempreture in c
F = (T-24.5)*(T+570.5);
A1=4.5820; A2=0.09921; A3=0.21090; A4=0.021940; B1=5.2716E-8; B2=4.9143E-8; B3=2.2971E-7;
lambda_sh=0.775e-6; % SH wavelength
nlithium_sh = (sqrt(A1)+((A2+B1*F)/((lambda_sh^2)-(A3+B2*F)^2))+(B3*F)-(A4*(lambda_sh)^2));
lambda_ff=1.55e-6; % FF wavelength
nlithium_ff = (sqrt(A1)+((A2+B1*F)/((lambda_ff^2)-(A3+B2*F)^2))+(B3*F)-(A4*(lambda_ff)^2));
% parameters
k_sh=(2*pi/lambda_sh)*nlithium_sh;
k_ff=(2*pi/lambda_ff)*nlithium_ff;
capital_lambda = 20e-6;
Delta_kk = k_sh-2*k_ff;
l=pi/Delta_kk; % for first order QPM
Delta_k=(Delta_kk-pi)/l;
lc = pi/Delta_kk; % lc (coherence length);
L = 10e-3; % Length;
N=L/(capital_lambda/2); % number of domains
z=L;
% for d(z) as fourier serie
Km=2*pi/20e-6;
Gm=2/pi;
d33=27; % unit=pm/V
deff=(2/pi)*d33;
d0=(2/pi)*deff; % unit=pm/V
D=lc/capital_lambda;
% for SH field
syms z
GG = symsum(Gm * exp(1i * Km * z), 1, inf);
dz = GG * d0; % periodic modulation
gzz = (pi/2*L)*(dz)/d0;
syms z
f = gzz * exp(1i * Delta_kk * z);
int(f,z,0,L);
y=int(f,z,0,L);
figure(1)
plot(y)
xlabel('Delta_k');
ylabel('SHG efficiency');

10 Commenti

Torsten
Torsten il 18 Apr 2024
GG is computed as Inf.
What needs to be corrected in this context?
  • Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
  • Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
  • Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support so we can investigate.
asma
asma il 18 Apr 2024
this is my alarm.
Error using integral
First input argument must be a function handle.
Error in al (line 43)
integral(f,0,L);
GG value is inf. is it the reason that I achieve this alarm?
Torsten
Torsten il 18 Apr 2024
I don't see that you use "integral" in your code.
asma
asma il 18 Apr 2024
I difine f as a function and then i use int function (lines that I Bold them) that access in matlab.
Torsten
Torsten il 18 Apr 2024
Yes, I see, but "int" is a symbolic integrator while "integral" is a numerical integrator - two different functions.
However: The problem with "int" comes from gzz which is Inf (because GG is Inf).
asma
asma il 18 Apr 2024
tnx a million. as mathmatically Is it possible that we can get a Fourier integral from a Fourier series? i mean our function is a fourier series.
Torsten
Torsten il 18 Apr 2024
A Fourier series with a constant coefficient Gm for all terms ? Usually, the Fourier coefficients converge to 0, don't they ?
asma
asma il 18 Apr 2024
yes and the value of Gm is constant and is 0.63 .
i dont know about coefficients converge.
Torsten
Torsten il 18 Apr 2024
Modificato: Torsten il 18 Apr 2024
It's impossible that GG is the Fourier series of any function.
I really don't understand what you are doing in your code.

Accedi per commentare.

Risposte (0)

Categorie

Richiesto:

il 18 Apr 2024

Modificato:

il 18 Apr 2024

Community Treasure Hunt

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

Start Hunting!

Translated by