I have and you can see it in my layout build thread here:
http://www.modelrailroadforums.com/forum/showthread.php?t=27884
This is two inch thick and is cookie cut to match the 1/4" ply sub-roadbed. Then glued down with latex caulk. The 'scenery' part of the foam is temporarily removed to shape the grades for the track. To shape the grades I used a steak knife to remove larger thicknesses and a SurForm tool
http://www.toolbank.com/p/C10130/STA521399
to smooth out the grade. At one place I cut too deep so I just glued on another piece of foam then re-cut, a fairly easy fix of a goof..
On one section a second layer of two inch foam is added for an elevation of 4 inches above the lowest grade.
I can add more pictures to my thread if you have addition questions that need pictures for the answer. Just ask.