A fault detector for detecting a fault of an operation of a synchronous motor including a stator and a rotor separated by an air gap, the fault detector comprising: a processor; and a memory having instructions stored thereon that, when executed by the processor, cause the fault detector to: collect, over a communication channel including one or a combination of a wired and wireless communication link, an electrical input for controlling the operation of the synchronous motor, and measurements associated with the operation of the synchronous motor caused by the electrical input; characterized by further causing the fault detector to determine sequences of points defining a mutual position between the stator and the rotor of the synchronous motor forming interfaces of different materials inside the synchronous motor, namely one sequence of points representing a first interface between the stator and the air in the air gap and another sequence of points representing a second interface between the air in the air gap and the rotor, wherein the mutual position results in magnetostatic generated by the synchronous motor in response to the electrical input and determined as a weighted summation over real-space basis functions that are parameterized on pairs of adjoint points in the determined sequences of points and that are weighted with a surface charge density between corresponding adjoint points, such that the resulted magnetostatic explains the measurements of the operation of the synchronous motor given the electrical input; determine the fault of the operation of the synchronous motor based on the mutual position between the stator and the rotor of the synchronous motor; and transmit, over the communication channel, one or a combination of an indication of the fault of the operation of the synchronous motor and a control command selected based on the fault, wherein, to solve the magnetostatic, the processor is further configured to: - compute a magnetic field strength based on an initial value of the surface charge density and update the surface charge density, based on a relation between the surface charge density and the magnetic field strength, iteratively until a termination condition is met; or - compute a magnetic flux density based on an initial value of a surface current density and update the surface current density, based on a relation between the surface current density and the magnetic flux density, iteratively until a termination condition is met. collect, over a communication channel including one or a combination of a wired and wireless communication link, an electrical input for controlling the operation of the synchronous motor, and measurements associated with the operation of the synchronous motor caused by the electrical input; characterized by further causing the fault detector to determine sequences of points defining a mutual position between the stator and the rotor of the synchronous motor forming interfaces of different materials inside the synchronous motor, namely one sequence of points representing a first interface between the stator and the air in the air gap and another sequence of points representing a second interface between the air in the air gap and the rotor, wherein the mutual position results in magnetostatic generated by the synchronous motor in response to the electrical input and determined as a weighted summation over real-space basis functions that are parameterized on pairs of adjoint points in the determined sequences of points and that are weighted with a surface charge density between corresponding adjoint points, such that the resulted magnetostatic explains the measurements of the operation of the synchronous motor given the electrical input; determine the fault of the operation of the synchronous motor based on the mutual position between the stator and the rotor of the synchronous motor; and transmit, over the communication channel, one or a combination of an indication of the fault of the operation of the synchronous motor and a control command selected based on the fault, - compute a magnetic field strength based on an initial value of the surface charge density and update the surface charge density, based on a relation between the surface charge density and the magnetic field strength, iteratively until a termination condition is met; or - compute a magnetic flux density based on an initial value of a surface current density and update the surface current density, based on a relation between the surface current density and the magnetic flux density, iteratively until a termination condition is met.