Time dependent non linear variational problem

As I said, format your code appropriately, encapsulating it with ``` and make sure indentation is correct. One should be able to do a copy and paste to run the example without any changes, see Read before posting: How do I get my question answered?