Modeling of complex systems and their interaction with light