    

 ## On this page

  

 

 # Example 25: Source Spectrum Diffraction Grating 

 Last update: 17.07.2025 

Ex 25: A non-sequential system with two black body sources of different temperatures and a diffraction grating is built. The system is setup with multi-configuration to control the number of analysis rays traced for each source. Only a single source has analysis rays during a ray trace. The true color results are plotted for each configuration.

```
Input:      None
<p>Output:     Graph (Matlab, Python)
API\e25_source_spectrum_diffraction_grating.zos
API\e25_source_spectrum_diffraction_grating_1.txt (C++, C#)
API\e25_source_spectrum_diffraction_grating_2.txt (C++, C#)
</p>
```

[C#](page_ex25_cs.xhtml)

[C++](page_ex25_cpp.xhtml)

[Matlab](page_ex25_m.xhtml)

[Python](page_ex25_py.xhtml)