Magnetic field optimization of a novel hybrid permanent undulator