New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
desolve for 2nd order ODE with initial condition gives wrong answer #6479
Comments
comment:1
I'm not sure if this is a duplicate or not but Robert Bradshaw definitely knows about this bug. (I wrote a crappy version of the original solver, Robert wrote the new and improved one. However, Marshall Hampton and I spend several hours at SD15 trying to figure out how to patch this bug and couldn't.) BTW, it is actually documented to behave this way if you read the docstrings carefully. Here is, at Robert Bradshaw's request, a maxima session solving a 2nd order ODE with 2 initial conditions and a 2nd order ODE with 2 boundary conditions:
Hope this helps. An additional problem is that the syntax for desolve and desolve_laplace are different. Perhaps this could be fixed at the same time? |
Attachment: trac_6479_marik.patch.gz |
comment:2
The patch which fixes ic2 and bc2 commands is attached. With this patch, the ode2 runs two times - the first pass is kept to ensure that Maxima is able to solve the system. Test for bc2 has been added. |
Reviewer: hamptonio@gmail.com |
comment:5
Patch hass been posted, but it assumes that the solution of second order ODE is found in the explicit form, i.e. y=f(x) which is not allways true. From this reason the patch does not solve all related issues and needs more work. I hope to post new patch within a week. |
Attachment: trac_6479_marik_revised.patch.gz Apply only this patch |
Attachment: trac_6479_marik_revised_2.patch.gz Apply on the top of the patch trac_6479_marik_revised.patch and on the top pf the patch for Ticket #385 #385 |
Changed reviewer from hamptonio@gmail.com to none |
comment:9
I attached second patch which should be applied after the previous trac_6479_marik_revised.patch and after a patch for Ticket #385. With this new patch
|
comment:10
The improvements are fantastic! However, some of the docstrings do not follow proper format. I hope you can please fix these. A request: in your new functions desolve_rk4 and desolve_system_rk4 |
comment:11
Replying to @wdjoyner:
Thanks. I will try to fix it. Sorry, I am newbie in Python.
what about this: endpoints=a .... integrate from ics[0] to a endpoints=[a] .... integrate from ics[0] to a endpoints=[a,b] .... integrate from ics[0] to b, then integrate back from ics[0] to a, reverse the second list and join both lists together /without repeating the point (ics[0],ics[1])/. If ics[0] is bigger than b or smaller than a, raise error. I think that this is possible and I can try within a week. |
comment:12
Replying to @robert-marik:
...
This sounds excellent - thanks! |
this replaces previous patches and installs on the top of patch for trac #385 |
comment:13
Attachment: trac_6479_marik_revision3.patch.gz |
comment:15
Great patch. Passes sage -testall and is very well-documented. Thanks Robert!! |
Author: Robert Marik |
Reviewer: David Joyner |
Merged: sage-4.3.alpha1 |
comment:18
Thanks for including the patch to Sage. |
Changed author from Robert Marik to Robert Mařík |
It seems desolve instead of using the given initial
value of y at x=0, it literally passes "y(0)" to maxima.
CC: @sagetrac-mhampton
Component: calculus
Author: Robert Mařík
Reviewer: David Joyner
Merged: sage-4.3.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/6479
The text was updated successfully, but these errors were encountered: