Phil Lucht Math & Physics Archive
Home / Math and Physics Files / Physics / Mechanics / new frames doc / Appendix F Dumbbell Sat

debug the Maple dsolve problem

DOCX · 287.6 KB
Open DOCX file

Phil's working notes (dated 1.10.17) on the Maple dsolve error that appeared in his dumbbell satellite equations. He simplifies the system step by step in Maple worksheets, finding that a constraint equation like x^2+y^2+z^2=r^2 causes the failure, and that eliminating z fixes it. He collects four rules, including that every equation and every unknown function needs a derivative. Equations are partly dropped in the extraction and the Maple code appears as images.

AI-written summary; may contain errors. This description is approximate.

Extracted text (machine-read; may contain errors)
Debugging Maple's Numeric Dsolve problem PhL 1.10.17 I have two sample files and they both show the same problem. One is a second order system, the other is a corresponding first order system. They both make the "cannot convert to first order" error. I did a web scan and various people get the same error, but none of their hints fixed my problem. Here is the second order system showing the error: y - x = - ω2yx - 2ωx b - x = +ω2bx + 2ωx x2+y2+z2 = r12 I will work in mws file called debug1.mws. I will start with the above mess and keep simplifying it. I suspect the last equation is the problem but want to confirm this feeling. Step 1: Let's try this instead y - x = yx 1000 - x = 2x x2+y2+z2 = 100 Here is my equation entry And I continue on to generate the error message Step 2. Simplify to - = yx 1000 - = 2x x2+y2+z2 = 100 Same error. Step 3. Simplify to = y + = x x2+y2+z2 = 100 Same error. Step 4. Simplify to = y x2+y2 = 100 Same error Here is the code for the above: Maybe all equations have to be ODE's with at least a first derivative? Step 5. Try this = y 2+y2 = 100 Same error Step 6. Try this = y +y = 100 Same error Step 6. Try this = x +2 +y = 100 The error goes away. This is already a first order system: Step 7. Try this = x +2 +y^2 = 100 no error Step 8: Try this = x +2 x+y = 100 yes error I think this confirms that each equation must have at least one derivative! I can reformulate the above Step 8 problem this way: = (100-y) +2 RULE #1: Every equation must have at least one derivative! Step 9: Go back now to the original problem y - x = - ω2yx - 2ωx b - x = +ω2bx + 2ωx x2+y2+z2 = r12 How can I restate this so all equations have derivatives? Let's quickly jump to a simple case which I think shows the same problem: - = x+2 = +y x2+y2 =25 Same error Make it even simpler - = x+2 = +y x2+y2 =25 Same error RULE #2: Even if you system seems obviously first order, you can still get this error! One reason here for failure is that in effect I have 2 equations for just one function x(t). Now try to eliminate y from these three equations. Do this system - = x+2 y = Here is a path to success: It is not complaining about the ambiguity of the square root! It just takes it positive I presume. RULE #3: Elementary square roots are not a problem. Step 10: Let's back up to Step 3 and try a subs with x,y,z, mimicking the above = y + = x x2+y2+z2 = 100 I will eliminate z z = Success! Here it is. First part, and now the second part Once again, it does not mind the square roots. Step 11: Now back to the original problem! y - x = - ω2yx - 2ωx b - x = +ω2bx + 2ωx x2+y2+z2 = r12 I will try to eliminate z, mimicking the Step 10 case. I will do this in "satellite in Cartesians v2a.mws". It works! Here is the code: First, here is the stuff used to eliminate z Then here are the two equations in x(t) and y(t) only, And now we try to solve: Step 13: Question: can you have a function appear in your equation set which has no derivatives? Here is a simple test : = x = y-3 and here is what it says: Just to make sure, here is a fancier case : = x + y = y-3 So we now have : RULE #4 : All unknown functions to be solved for must have at least one derivative somewhere in the system of equations. Step 14: Let's try to fix up the last example above = x + y = -3 Still makes the error! So I am still not done with understanding this error! What is wrong with this last case? There is an analytic solution Let's make sure this equation works: x = -3t + a y = -3 +3t - a x(0) = a y(0) = -3-a = -3 = 3 = 0 Eq1: = x + y ? -3= -3t + a -3 +3t - a ? -3= -3 ? yes Eq2: = -3 ? 0 = 3 - 3 ? yes So the analytic solution is valid. But notice that you cannot set x(0) and y(0) independently!! Why is this? Those equations again are: = x + y = -3 Rewrite as = + 3 y = - x or = + 3 = - which implies that + 3 = - 3 = - So the pair of equations is really this 3 = - y = - x You solve the first one for x(t) and then y(t) is forced, they are not independent functions! But how do you know this in general from the equation system? This may involve some matrix thing that I don't know about. I can fix things by doing this instead = x + y = -3 Then the error goes away. So if you just make up a random system of equations, it is not obvious that it has a general solution where you can set initial conditions in the usual manner. I will now gather up the rules I learned during this debug: RULE #1: Every equation must have at least one derivative! RULE #2: Even if you system seems obviously first order, you can still get this error! RULE #3: Elementary square roots are not a problem. RULE #4 : All unknown functions to be solved for must have at least one derivative somewhere in the system of equations.