In this talk I will present how to design and analyze optical systems using computer tools in Oasys  with different complexity. The idea is starting from simple analytical calculations by hand, then applying ray-tracing, based on geometrical optics that is well adapted for systems using incoherent light beams. In the case that the coherent fraction of the beams is close to one, models bases on wave optics propagation in 1D or 2D are used. In case of hard X-ray synchrotron beams from new low-emittance storage rings, the coherent fraction may vary (5-50%) and we apply partial coherence methods based on coherent mode decomposition.
I will illustrate this scheme with a number of examples calculated using Oasys: Ray tracing analysis of a mirror designed to suppress aberrations (the “diaboloid” shape) , design an adaptive mirror to correct for wavefront distortions in a fully coherent beamline at the projected ALS-U , match two transfocators in a partially coherent hard X-ray beamline at EBS-ESRF. Finally I will discuss some models for monochromators using non-perfect crystals, such as Graphite.
 L Rebuffi, M Sanchez del Rio (2017) OASYS (OrAnge SYnchrotron Suite) : an open-source graphical environment for x-ray virtual experiments Proc.SPIE 10388: 10388-10388. http://dx.doi.org/10.1117/12.2274232
 V V Yashchuk, I Lacey, M Sanchez del Rio (2020) Analytical expressions of the surface shape of diaboloid mirrors SPIE Proceedings 11493: 128-140. http://dx.doi.org/10.1117/12.2568332
 M Sanchez del Rio, A Wojdyla, K A Goldberg, G D Cutler, D Cocco, H A Padmore (2020) Compensation of heat load deformations using adaptive optics for the ALS upgrade : a wave optics study J. Synchrotron Rad. (2020). 27, 1141-1152 https://doi.org/10.1107/S1600577520009522