@Dhruva2 , One of the threads that @ChrisRackauckas is talking about is this one:
I had a much more minimal working example there, and I ask the same question. (I do not even recollect what I was trying to do. May be I was just curious.) Chris gives a very comprehensive answer there. Do check it out.