Optimization of magnet configuration for the magneplane model