We derive a new 3D model for magnetic particle imaging (MPI) that is able to incorporate realistic magnetic fields in the reconstruction process. In real MPI scanners, the generated magnetic fields have distortions that lead to deformed magnetic low-field volumes (LFV) with the shapes of ellipsoids or bananas instead of ideal field-free points (FFP) or lines (FFL), respectively. Most of the common model-based reconstruction schemes in MPI use however the idealized assumption of an ideal FFP or FFL topology and, thus, generate artifacts in the reconstruction. Our model-based approach is able to deal with these distortions and can generally be applied to dynamic magnetic fields that are approximately parallel to their velocity field. We show how this new 3D model can be discretized and inverted algebraically in order to recover the magnetic particle concentration. To model and describe the magnetic fields, we use decompositions of the fields in spherical harmonics. We complement the description of the new model with several simulations and experiments.