Electromagnetic nonlinearities in a Roebel-cable-based accelerator magnet prototype: variational approach. (23rd December 2016)