    

 ## On this page

  

 

 # Example 25: Source Spectrum Diffraction Grating

 Last update: 09.03.2026 

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

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#)

```

[C#](example_25_cs.md)

[C++](example_25_cpp.md)

[Matlab](example_25_m.md)

[Python](example_25_py.md)