The prediction of coronal and interplanetary magnetic fields