Change material properties from script


#1

I’m trying to fully script the tutorial example “p-n Junction Diode” found here:
https://kb.lumerical.com/en/other_application_gs_pn_diode.html

I get to the point where I want to simplify the silicon material properties to get the “ideal” diode characteristics. However, I can’t figure out how to programmatically change the material properties.

I tried using the setmaterial() command from here: https://kb.lumerical.com/en/ref_scripts_setmaterial.html
but it doesn’t seem to work:

?setmaterial("Si (Silicon)"); color

I expected ?setmaterial("Si (Silicon)"); to return all of the modifiable properties of silicon as I see them when I click Materials -> Si (Silicon) in the GUI. What am I doing wrong?

Thanks,
M


#2

Hi. Unfortunately the DEVICE material database does not provide access to the material properties through scripting. The “setmaterial” command is only available in the optical solvers. If you would like to use script for the “pn junction diode” example, the only workaround would be to create the three materials (‘si-ideal’, ‘si-bulk’, and ‘si-bulk-surface’) beforehand and save them in the defaults file of DEVICE. You can then use the script to simply assign the different materials to the silicon geometry one at a time. While not perfect, this is probably the best solution right now.