A mathematical model is developed for a micro-electro-mechanical system (MEMS) instrument that has been designed primarily to measure the viscosity of fluids that are encountered during oil well exploration. It is shown that, in one mode of operation, the displacement of the device satisfies a fractional differential equation (FDE). The theory of FDEs is used to solve the governing equation in closed form and numerical solutions are also determined using a simple but efficient central difference scheme. It is shown how knowledge of the exact and numerical solutions enables the design of the device to be optimised. It is also shown that the numerical scheme may be extended to encompass the case of a nonlinear spring, where the resulting FDE is nonlinear.