Code Monkey home page Code Monkey logo

Comments (8)

JinZhi-Escape avatar JinZhi-Escape commented on June 2, 2024 1

thanks for your response. Actually I did changed the 'Omega' parameters both in the 'simulation' function and 'insert_mode' function. I look the codes again and think this might be the problem: In the 'modes.py' file, you write a function called 'get_modes' which can return both 'array of effective indeces of the modes' and 'array containing the corresponding mode profiles'. Then you use it in the 'insert_modes' function, but in the later function, you only return the mode array(screen shoot is shown below).

image

So I think maybe the 'array of effective indeces of the modes' thing can be used to help my work, but I do not know how to modify the code.

many thanks, looking forward to your reply. :)

from workshop-invdesign.

momchilmm avatar momchilmm commented on June 2, 2024

All the examples in the notebooks use the frequency-domain solver, which means that the simulation itself is computed at a single frequency. Note that the omega parameter goes into the simulation too, not just the source and probe. So if you try changing omega in the source and probe but not in simulation, that would indeed produce strange results - you are injecting a source at the "wrong" frequency compared to the simulation. So try changing omega everywhere. If that also produces strange results, please make a minimal working example for us to have a look at!

from workshop-invdesign.

momchilmm avatar momchilmm commented on June 2, 2024

So let me clarify what the mode solver does - it finds the eigenmodes at a fixed frequency, where the eigenvalues are the effective indexes (i.e. k-vector, or propagation constant) in the propagation direction. These are ordered in decreasing order. We don't really need the values of these indexes, we only need the associated eigenvector - the eigenmode - in order to launch the modal source, which is why we don't store the indexes. The way you can choose between different modes is by setting the m argument in the mode source. In fact as you can see in notebook 2, there's an example of sending m = 1 and m = 2.

from workshop-invdesign.

JinZhi-Escape avatar JinZhi-Escape commented on June 2, 2024

Thanks for your reply which helps me to understand more about the codes. It seems that I did not clarify my question(my fault, sorry).

Simply speaking, I want to use ceviche to simulate a frequency doubler, but some problems occured when I using the codes in the notebook2. At first I thought the codes could change the frequencies between input and output. After the simulation with modified codes, it seems that the codes only result in mode converting. (the simulation result is plotted below)

1

As you can see, the simulation result did not change between input frequency and the output. In my simulation, I set source at omega1 and probe at omega2(omega2 = 2* omega1 and they both had m=1). I did not change the mode_overlap function. I arbitrarily changed the return value of the objective function, but I do not know the meanings of their return values. :(

Here are my new questions(hope I make it clear this time):
Can ceviche simulate a frequency doubler? If it can, what should I do to have a proper objective function to optimize?
I guess I need to do some modification on objective and mode_overlap functions but don't know how.

Many thanks for your help, looking forward to your reply. :)

from workshop-invdesign.

ianwilliamson avatar ianwilliamson commented on June 2, 2024

Can ceviche simulate a frequency doubler?

No. I assume you're referring to a device that uses a material with chi2 nonlinearity. These notebooks are demonstrating optimizations of linear devices.

from workshop-invdesign.

JinZhi-Escape avatar JinZhi-Escape commented on June 2, 2024

emmmmm...... that sounds not good.

May I ask you what software you use in this paperAdjoint method and inverse design for nonlinear nanophotonic devices which written by you and your teammates?

It seems that some nonlinearity can be simulated in the experient in the paper. Also, can I use this software and simulate the chi2 nonliearity?

Many thanks to your help. :)

from workshop-invdesign.

momchilmm avatar momchilmm commented on June 2, 2024

We used angler for that https://github.com/fancompute/angler. ceviche kinda grew out of there, but is mostly focused on inverse design of linear structures. However, even in angler, we only include chi-3 (Kerr) nonlinearity and there is no frequency mixing.

Even without talking about inverse design, It is very hard to do accurate simulations of nonlinear phenomena. That is why most of the times, people come up with a way to compute the expected nonlinear properties from the linear response of the systems at the frequencies of interest. For example, to enhance chi-2 effects, you may optimize a resonator to have strongly confined, high-Q modes with high nonlinear overlap at omega and 2*omega, just by solving for the linear fields at the two frequencies. If you would like to do nonlinear optimizations, my advise would be to try and frame your figure of merit as a function of the linear fields at different frequencies.

from workshop-invdesign.

Prettzz avatar Prettzz commented on June 2, 2024

while running ceviche, I am getting the error
ceviche error

from workshop-invdesign.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.