add the variational example
Merge pull request #2154 from yorkerlin/develop

add the variaitonal example program with document