correct my integral in line43
Show older comments
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 Comments
Torsten
on 18 Apr 2024
GG is computed as Inf.
Steven Lord
on 18 Apr 2024
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
on 18 Apr 2024
Torsten
on 18 Apr 2024
I don't see that you use "integral" in your code.
asma
on 18 Apr 2024
Torsten
on 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
on 18 Apr 2024
Torsten
on 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
on 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.
Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!