Gradient of loss function from ODE solution

@ChrisRackauckas Could you please give a look at this whenever you got the chance? It should be really straightforward and I have tried to follow your example here (just a slightly more complicated ODE)

Something is obviously escaping me :slight_smile:
Many thanks!