Periodic function doesn't work with ODEsolve?
- May 5, 2014
- 6 replies
- 3549 views
Hello, everyone!
I've noticed that there is a friendly and helpful community here, so maybe you can help me out with my issue. 
I'm solving a differential equation with odesolve command, and everything works no problem.
Now I'm trying to add a periodic square wave function with variable duty cycle into the equation, and everything gets more complicated. I've used two similar methods to define the periodic function and they both work almost the same.
The trouble is - with bigger values of duty cycle it works flawlessly, but as soon as I try to lower it, it seems that odesolve misses some values and the solution looks obviously wrong. My first guess is that it is a numerical problem, as the equation also contains some relatively small and big numbers, changing some of which also helps a bit, but that's unfortunately not an option. Maybe there is an option to use some other method besides odesolve, or any other trick to fix this behaviour?
All other comments and graphs are in the attached file.
Any help is highly appriciated!
BR, Maxim.

