-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some questions about the code #3
Comments
Hello Yao,
Apologies for the late answer to your email. I'm afraid my ability to help
you with your code is limited due to no longer having a MATLAB license and
also being out of practice in the field, but I can offer some general
advice about the code I wrote and lessons learned.
All the code used in the thesis can be found at
https://github.com/miceks/kerr_comb_simulator. There should be a file named
'split_step_LLE.m' implementing an LLE solver.
The first thing to keep in mind is that all code (and figures in the
results) uses a form of normalized/scaled variables which is documented in
section 2.3 of the thesis. These were picked to make the problem I was
working on simpler and may not be suitable for your work. In my experience,
there are a lot of different conventions used to express these equations.
The second thing to remember is that critical coupling is assumed, so there
is no corresponding parameter for that.
Finally, a tricky issue in general is to find suitable simulation
parameters to avoid numerical instability and also good initial conditions
to get the field to converge to something interesting (solitons, Turing
patterns, etc.). The only advice I have here is trial and error. The app at
the github repo might be useful if you want to play around with different
values to get a feel for what numerical instability looks like. With
regards to initial values you can either try parameter sweeps or use some
analytical approximation, which I think are available in the app as well
(again, I can't run it myself anymore to check).
Best of luck!
Regards,
Michael Ekström
Den mån 4 nov. 2024 kl 15:47 skrev Yaozengsw ***@***.***>:
… Dear Mr. Michael Ekstrom,
Thank you for taking the time to read my message amidst your busy schedule.
I am a graduate student at Wuhan University, and I have been studying the
Lugiato-Lefever equation (LLE). Fortunately, I recently read your article,
“Modeling of optical microresonator frequency combs,” which helped me
understand how to apply the split-step Fourier method to solve the LLE.
However, I am facing challenges with the equation presented in the paper
“Topological dissipative Kerr soliton combs in a valley photonic crystal
resonator,” particularly with handling the pump term.
I have attached the code I developed, and I would greatly appreciate it if
you could take a moment to review it and help me identify any issues.
Additionally, if you have any insights or code related to the time series
diagram (Fig. 7.2 in your thesis), I would be grateful for your guidance.
Thank you once again for your time and assistance. I apologize for any
inconvenience my inquiry may cause.
Wishing you good health and all the best.
Warm regards,
Yao Zeng
School of Electronic Information
Wuhan University
Wuhan 430072, China
clear all;
clc;
kappa=10000;
Pin=2.2;
dispersion2=0.1e9;
delta_w=30e12;
%%
FSR=450e9;
a=300e-9;
l=180
*a; L=3*l;
omega0=370.67e12;
n2=2.5e-19;
c=3e8;
A_eff=2.1e-14;
gamma=(omega0*n2)/(c*A_eff);
eta=0.5;
hbar=1.05e-34;
Omega=omega0-delta_w;
%%
nt=1000; Tmax=300; % FFT points and window size
step_num=200; % No. of z steps
deltaz=L/step_num; % step size in z
dtau=(2
*Tmax)/nt; % step size in tau tau=(-nt/2:nt/2-1)dtau; % temporal grid
omega=fftshift((2pi/Tmax)*(-nt/2:nt/2-1)); % frequency grid
%% 输入场
psi=sech(tau);
% Plot input time series
figure;
subplot(3,1,1)
plot (tau, abs(psi).
*abs(psi), '-r'); hold on; %% Split Step LLE P_hat=fft(sqrt(Pin)ones(1,
nt)); D1=-kappa/2-1idelta_w-1i*pi*FSR*dispersion2
*omega.omega; D2=exp(D1deltaz); alpha=(kappa*eta)/(hbar
*Omega); % Initial linear half-step
psi=ifft(fft(psi).sqrt(D2)+(sqrt(alpha)P_hat./D1).(sqrt(D2) - 1)); for
q=1:1 % Nonlinear step psi=psi.exp(1ideltazL*FSR*gamma*abs(psi).^2);
% Linear step
psi=ifft(fft(psi).*D2+(sqrt(alpha)*P_hat./D1).*(D2 - 1));
end
% Inverse linear half-step
psi=ifft(fft(psi).*1./sqrt(D2)+(sqrt(alpha)*P_hat./D1).*(1./sqrt(D2)-1));
% Plot output time series
subplot(3,1,2)
plot (tau, abs(psi).*abs(psi), '-b')
%% 频谱
E_t=psi;
P_t=E_t.*conj(E_t);
x_complex=P_t;
dt=dtau;
Nf = length(x_complex);
Fs=1/dt;
df=Fs/Nf;
freq_span = (-floor(Nf/2):floor((Nf-1)/2))
*df; fft_mag_laser_Ax = abs(fftshift(fft(x_complex))); subplot(3,1,3)
plot(freq_span,10*log10(fft_mag_laser_Ax),'k')
xlabel('Frequency (GHz)')
ylabel('Microwave Power (dB)')
—
Reply to this email directly, view it on GitHub
<#3>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR7F3YXVBFYFQCLP6I4OMZ3Z66CI5AVCNFSM6AAAAABRENRYOCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZTGMBSGA3TOMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Mr. Michael Ekstrom,
Thank you for taking the time to read my message amidst your busy schedule.
I am a graduate student at Wuhan University, and I have been studying the Lugiato-Lefever equation (LLE). Fortunately, I recently read your article, “Modeling of optical microresonator frequency combs,” which helped me understand how to apply the split-step Fourier method to solve the LLE. However, I am facing challenges with the equation presented in the paper “Topological dissipative Kerr soliton combs in a valley photonic crystal resonator,” particularly with handling the pump term.
I have attached the code I developed, and I would greatly appreciate it if you could take a moment to review it and help me identify any issues. Additionally, if you have any insights or code related to the time series diagram (Fig. 7.2 in your thesis), I would be grateful for your guidance.
Thank you once again for your time and assistance. I apologize for any inconvenience my inquiry may cause.
Wishing you good health and all the best.
Warm regards,
Yao Zeng
School of Electronic Information
Wuhan University
Wuhan 430072, China
clear all;
clc;
kappa=10000;
Pin=2.2;
dispersion2=0.1e9;
delta_w=30e12;
%%
FSR=450e9;
a=300e-9;
l=180a;
L=3l;
omega0=370.67e12;
n2=2.5e-19;
c=3e8;
A_eff=2.1e-14;
gamma=(omega0n2)/(cA_eff);
eta=0.5;
hbar=1.05e-34;
Omega=omega0-delta_w;
%%
nt=1000; Tmax=300; % FFT points and window size
step_num=200; % No. of z steps
deltaz=L/step_num; % step size in z
dtau=(2Tmax)/nt; % step size in tau
tau=(-nt/2:nt/2-1)dtau; % temporal grid
omega=fftshift((2pi/Tmax)(-nt/2:nt/2-1)); % frequency grid
%% 输入场
psi=sech(tau);
% Plot input time series
figure;
subplot(3,1,1)
plot (tau, abs(psi).abs(psi), '-r'); hold on;
%% Split Step LLE
P_hat=fft(sqrt(Pin)ones(1, nt));
D1=-kappa/2-1idelta_w-1ipiFSRdispersion2omega.omega;
D2=exp(D1deltaz);
alpha=(kappaeta)/(hbarOmega);
% Initial linear half-step
psi=ifft(fft(psi).sqrt(D2)+(sqrt(alpha)P_hat./D1).(sqrt(D2) - 1));
for q=1:1
% Nonlinear step
psi=psi.exp(1ideltazLFSRgammaabs(psi).^2);
% Linear step
psi=ifft(fft(psi).*D2+(sqrt(alpha)P_hat./D1).(D2 - 1));
end
% Inverse linear half-step
psi=ifft(fft(psi).*1./sqrt(D2)+(sqrt(alpha)P_hat./D1).(1./sqrt(D2)-1));
% Plot output time series
subplot(3,1,2)
plot (tau, abs(psi).*abs(psi), '-b')
%% 频谱
E_t=psi;
P_t=E_t.*conj(E_t);
x_complex=P_t;
dt=dtau;
Nf = length(x_complex);
Fs=1/dt;
df=Fs/Nf;
freq_span = (-floor(Nf/2):floor((Nf-1)/2))df;
fft_mag_laser_Ax = abs(fftshift(fft(x_complex)));
subplot(3,1,3)
plot(freq_span,10log10(fft_mag_laser_Ax),'k')
xlabel('Frequency (GHz)')
ylabel('Microwave Power (dB)')
The text was updated successfully, but these errors were encountered: