hi vishal,
I had a quick look at your examples. The second one, as a function of detuning seems to have a couple of issues.. firstly you repeatedly construct H as a function of Delta in a for loop, but that only retains the final H (i.e., @ Delta = 0.5). Secondly, sending the list of Deltas to mesolve(), in place of the t_range, will still just calculate the dynamics using the list of Deltas as time steps instead of changing anything in the model. The mesolve() function doesn't know that what you want to do is change delta in H (unless you are purposefully doing this for some reason I dont quite understand), it just assumes whatever list is sent is a list of timesteps to solve the evolution for.
Perhaps what you want to do there is include both mesolve() and the changes to H in a for loop, and run a separate solution for each value of Delta and for a given time interval? Or, if you just care about the steadystate response, you can use steadystate() instead of mesolve()?
hope this helps
All the best
neill