I am solving a time derivative equation in Matlab. atan is part of the solution. It seems to behave strangely when atan(tan) is around. Although, I am not sure. I have attached the script with my problem. This represents a simple circuit in real life.
In the first part of the script, I represented 10e-9 as rational representation, sym(10e-9, 'r'). This seems to give me discontinuity when tan -> inf, at t=0.5 in this case. To my surprise, representing 10e-9 as a floating point in the second part, solves this problem and give me very close results compared to the real world data! Moreover (maybe unrelated), analysing vSol in the second part show parts that go to 0 but isn't simplified!
I would like to get more idea of what is going on before solving a more complicated problem.