Soak the beans and cook until soft - this will take 2 hours unless you have a pressure cooker. Drain and set aside.
Put some olive oil in a deep pan, fry the chopped onion, carrot and celery for a minute then add the crushed garlic. Mash the contents of the tin of tomatoes and add to pan.
Take half the beans and push through a sieve, or pulp in a blender. Add the whole beans and the mashed beans to the pan along with about half a litre of water. The mashed beans thicken this dish and it brings out their flavour.
Add salt and pepper. Now make sure you are happy with the taste of your mixture. You can add a bit of a stock cube, or a dash of chilli, or some herbs like basil or parsley.
Bring to the boil so that you can add the pasta. If using remnants from different packets, break up larger shapes into small pieces of a similar size. Cook for another ten minutes to soften the pasta. Leave to rest for a while before serving.