Computer modelling of photonic devices for optical measurements