Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Photonics Error: addfdtd is not a valid function or a variable name Reply To: Error: addfdtd is not a valid function or a variable name

simenew.assefa
Subscriber


# Import the refractive index data for each material
importmaterial(glass, "SiO2.mdf"); # Replace "SiO2.mdf" with the appropriate MDF file for glass
importmaterial(ito, "ITO.mdf"); # Replace "ITO.mdf" with the appropriate MDF file for ITO
importmaterial(zno, "ZnO.mdf"); # Replace "ZnO.mdf" with the appropriate MDF file for ZnO
importmaterial(p3ht_pcbm, "P3HT_PCBM.mdf"); # Replace "P3HT_PCBM.mdf" with the appropriate MDF file for P3HT:PCBM
importmaterial(moo3, "MoO3.mdf"); # Replace "MoO3.mdf" with the appropriate MDF file for MoO3
importmaterial(al, "Al.mdf"); # Replace "Al.mdf" with the appropriate MDF file for Al

# Define the layer thicknesses (nm)
thickness_glass = ...;
thickness_ito = ...;
thickness_zno = ...;
thickness_p3ht_pcbm = ...;
thickness_moo3 = ...;
thickness_al = ...;

# Create the multilayer structure
stack = stack();
addlayer(stack, thickness_glass, glass);
addlayer(stack, thickness_ito, ito);
addlayer(stack, thickness_zno, zno);
addlayer(stack, thickness_p3ht_pcbm, p3ht_pcbm);
addlayer(stack, thickness_moo3, moo3);
addlayer(stack, thickness_al, al);

Calculate the absorption spectrum
spectrum = spectrum(lambda);
addpower();
addanalysis();

active layer.lsf;
Error: C:\Users\Newaye\Desktop\active layer.lsf.lsf line 13: importmaterial is not a valid function or variable name.

CAN ANY ONE HELP ME HOW TO RUN IT?

[bingo_chatbox]