Pipe dreams eh?
Need to be good with a calculator, comfortable with numbers and have a good supply of headache tablets.
When you understand the basics of how a pipe works, fork out for TSR Software's NEWPIPE program. Saves a bunch of time and the tablets last longer.
The tail pipe has to be small enough diameter and long enough to generate the right pressure and heat in the pipe to get good torque. Too small or long and you'll over heat. Too big or short and you'll lose power.
The header controls bottom to mid torque.
The final cone controls the power spread and over rev mostly after peak torque.
The length of the pipe from piston face to the start of the tail pipe controls peak power rpm.
And so it goes on.
Read up on it. It's fascinating......or very boring, depending on your perversion.