Can I define chi3 as a function of electric field in x,y direction (FDTD)?


I have a big problem.
I wana use chi3(3rd order nonlinearity) as a function of electric field in x,y direction(E(x,y)), how can I do this?
for example: chi3= 5.6*(10^-11)*E(2,3)
E(2,3) is not constant and changing during the simulation.

how can I implement a material plugin in FDTD Solutions?

This is one line from the current chi3.cpp

return V/(U+chi1[axis]+chi2[axis]*E+chi3[axis]EE);

I think it is possible to make it

return V/(U+chi1[axis]+chi2[axis]E+chi3[axis]EEE);

Do you think it can simulate the effect you have in mind?

By the way, what kind of application you are trying to simulate? If you can find a reference how this effect can be simulated using an FDTD method, it will make things a lot easier.


thank you so much
but I have a question, how can I do after change this code?


I have a big problem, I wana change the chi3 code (chi3.cpp) and use it, how can I use it? should I write this code in the script? or save this code in the windows’s drives?
help me
thank you


It looks like your new question is related to this post and therefore I moved it to here for a smoother conversation.

To make a new plugin (or modify), you will need C++ to compile the new plugin material, for more information please refer to this page and watch a practical demo video how this can be done.

A bigger questions to me is that what application you are trying to simulate. By making the modification I suggested, I think chi3 will effectively become chi4. So I am still not 100% convinced that why you would want to do that, unless you really want to simulate the effect due to chi4.


I wana use chi4 effects.
I went to that page but I didn’t find any thing about C++.


There should be a link named “Material Plugins: A Practical Implementation Demo”, that will take you to watch a demo video how to generate the new .dll file.

What kind of application you are trying to simulate? I can try to suggest something we might already have for you to get used to the software before trying on your new chi4 model.