Question: Two Piecewise Function Fails Using Rosenbrock or RKF45 in Dsolve

SimpleMarsBlyProcedure.mw

Hello Orbital Mechanics and astrodynamics designers of Maple Primes! I am trying to fly to Mars and enter into orbit around it! I know there are a few of you out there that have thought about doing that! Think of all the great mathematicians who have "dabbled" with orbits and astrodynamics! Anyway, here is my problem: I have a simple keplerian model for doing a flyby around Mars and I have a simple model for Reaction Control Thrusters (RCS) to help put the spacecraft into orbit around Mars.  The first thruster burn happens as the spacecraft enters Mars' Sphere Of Influence (SOI) when it is less than 577000 km away and that burn is needed.  I do that with a piecewise continous function with the conditions set up to fire the thrusters.  But in that same piecewise continous function, I have a 2nd thruster firing with the times called out to fire again.  But this time I want to fire the thruster at periapse (P) in order to go into orbit around Mars.  I believe that the Rosenbrock and/or RKF45 are not responding to the 2nd conditions in the piecewise function I have set up for the thruster firing times.  I have to fire the thruster at periapse and I know that time I reach the periapse point.  Also, in my Maple file you will see that I can "cant" the spacecraft to better control the direction of my burns.  

The problem I am encountering seems to be more about the piecewise functions with multiple conditions and expressions.  Please take a look at my Maple file and see if any of you Orbital Mechanics and/or astrodynamicsts familar with Maple can see what I am doing wrong here.  You don't have to be a astrodyamicist per se, just perhaps you have run across this problem of piecewise functions in dsolve with method = rosenbrock or RKF45. 

Thank you. 

Please Wait...