FYI: The answer I posted was just the implementation of the formulae in the image you posted, after an infinite amount of time.
The question you originally posted is greatly different from implementing the model described in the pdf! The model is for a dynamic situation, changing over time (between the start and end points,) and, using your original post as an example, would take into consideration contraints and other forces on m2 and m3, possibly from other masses not shown. In your posted example, when m4 is moved, m2 and m3 will oscillate, and continue to oscillate after m4 has come to rest. If they're free to move without other constraint, eventually the damping will "stop" m2 and m3, and they will come to rest as I described. If you're not interested in the behavior of m2 and m3 between the start and end of their movement, the method in the article may not be what you're looking for.
With regard to modeling the system described in the article, you may find someone (other than me) that will work with you on that. I would, however, suggest that you fully understand what you really want to do, and whether implementation of that model is the correct approach.
Whatever you decide, I hope it works for you.