A method to calculate element misalignments in optical systems is presented. The method uses the wavefront information in the exit pupil in the form of Zernike coefficients and a function that relates them to the misalignment values. Three different functions with its calculation procedures have been studied: in the first one, a nonlinear equations system is used by the authors to show the complexity around misalignments computing; in the next two, a single artificial neural network (ANN) and a procedure with two ANNs overcome the limitations of the equations systems. It is shown that for misalignments being small perturbations of position around the nominal value, the Zernike coefficients’ behavior in front of misalignments can be approximated with a polynomial expression. But for combinations of both decenter and tilt the problem becomes too complex to be solved analytically, therefore, we have used ANNs to solve it. The method is validated by simulation for each of the functions, using a triplet where the second lens is misaligned, and the results are compared.