Eigenfrequency calculation and Q factor calculations for resonances

KumarVinjeetKumarVinjeet Member Posts: 1

I am trying to do eigenfrequencies and Q factor calculations for a particular structure type for EM waves of 1500-1700 nm wavelengths. The structure is periodic in x and y directions so periodic BCs are applied to the unit cell of the structure in x and y directions, and PML boundary conditions are applied to +ve and -ve z-directions. How to do eigenfrequency and Q factor calculations for it?

Answers

  • gsungsun Posts: 1,655Ansys Employee

    Do you have specific definition here for the "eigenfrequency"? does it mean the frequency on the band structure, or the resonant frequency?

    If you just want to find the resonate frequency and the corresponding Q, please refer:

    Quality factor calculations for a resonant cavity it is the same for periodic structure

    Or you can get the transmission/reflection result, and from their peak to get resonate frequency f, and then calculate Q by Q=f/df.


    Please elaborate more if the above replies are not what you want.

  • KumarVinjeetKumarVinjeet Posts: 3Member

    Yes, by eigenfrequency I mean resonant frequency. I want to calculate that over a range of EM wavelengths, say 1500-1600 nm, at what all wavelengths would we get a resonant frequency for that structure? And then would like to calculate the Q-factors.

    Also, apart from Quality factor calculations for a resonant cavity module, is there any tutorial kinda thing or anything more elaborative?

    Hope you would help and thanks for your previous reply.

  • gsungsun Posts: 1,655Ansys Employee

    You may watch this video:My First Simulation - Setting up the Simulation

    and read this

    Quality factor calculations for a resonant cavity

    you can also search "Q analysis" at lumerical.com to find more examples. To better understand how the Q analysis works, I suggest that you read the script inside the group.

  • KumarVinjeetKumarVinjeet Posts: 3Member

    I am using the inbuilt High-Q analysis in Lumerical. The analysis script also comes as inbuilt. But when I am running the analysis, it is showing the error (I am also attaching a screenshot):- "Error: prompt line 33: in getdata, the d-card named t1 did not contain the data t"

    My query is that what is "t", how to access it and what to do so that the analysis runs successfully? The Q analysis plane and DFT monitor are in the same plane. The script is inbuilt in High -Q analysis and no changes were done in the inbuilt analysis script. Please help me so that Q-analysis can be run successfully.


    The script is as follows :-


    ##############################################

    # Q analysis

    # This script calculates the quality factor from

    # the slope of the decaying envelope.

    #

    # Input properties

    # f min, fmax: the frequency range to look for resonances

    # t start: only analyze the time signal after this time.

    # Set to a time after the initial source pulse has decayed

    # make plots: show a few representative plots

    #

    #

    # Output properties

    # Q: Dataset with quality factor of resonances, and associated frequency

    # spectrum: fft of analyzed time signal

    # resonances: raw data from findresonances script command

    #

    # Tags: resonator high q analysis quality factor

    #

    # Copyright 2018 Lumerical Solutions Inc

    ##############################################



    ## simplify input variable names by removing spaces

    f_min = %f min%;

    f_max = %f max%;

    t_sources_finished = %t start%;

    make_plots = %make plots%;


    N=nx*ny*nz;


    # combine time signals from all monitors, so we have a single time vector to analyze

    t=pinch(getdata("t1","t"));

    t_filter = find(t>=t_sources_finished);


    componentList = cell(6);

    componentList{1} = "Ex";

    componentList{2} = "Ey";

    componentList{3} = "Ez";

    componentList{4} = "Hx";

    componentList{5} = "Hy";

    componentList{6} = "Hz";


    combinedSignal = matrix(length(t),1);


    for(i=1:N) {

    for(j=1:6) {

    mname = "t" + num2str(i);

    curSignal = pinch(getresult(mname,componentList{j}));

    combinedSignal = combinedSignal + curSignal;

    }

    }


    ## Truncate the signal (and the time)

    t_cut = t(t_filter);

    signal_cut = combinedSignal(t_filter);




    # use findresonances to analyze time signal

    ?resonances = findresonances(t_cut,signal_cut,[f_min,f_max]);

    f0 = resonances(:,1);

    Q_matrix=resonances(:,3);


    # calculate spectrum by simple fft

    w = fftw(t_cut,2);

    f_spectrum=abs(fft(signal_cut,2));



    # package results into datasets

    Q = matrixdataset("Q");

    Q.addparameter("lambda",c/f0,"f",f0);

    Q.addattribute("Q",Q_matrix);


    spectrum = matrixdataset("spectrum");

    spectrum.addparameter("lambda",c/(w/2/pi),"f",w/2/pi);

    spectrum.addattribute("spectrum",f_spectrum);



    # optionally, mae a few representative plots

    if (make_plots) {

    # plot raw time signal

    plot(t,combinedSignal);

    holdon;

    plot(t_cut,signal_cut);

    holdoff;


    #plot spectrum

    plot(spectrum.f/1e12,spectrum.spectrum,"f (THz)","spectrum");


    # plot Q

    plot(Q.f/1e12,Q.Q,"f (THz)","Q");

    }

  • gsungsun Posts: 1,655Ansys Employee

    This is a different question. Later please write a new post for each question so the post is focused, and convenient for others to refer in case they have the same question.

    This error is mostly due to the time monitor "t1" is out side of the simulation region. This can happen when a symmetry BC is used but originally the time monitor is inside the simulation region. Or it is located to the outside of the simulation volume. Please check.

    I guess it is from this line

    t=pinch(getdata("t1","t"));

    "t1" is the monitor name;

    "t" is the time the monitor records.

    The above script is used to access it.

    Please write a new post if you have questions on the analysis group, and better indicate which example you are referring, or which analysis group you are using from the Object Library.

Sign In or Register to comment.