Opened 17 months ago
Last modified 12 months ago
#27076 new defect
Incorrect choice of roots in solving ODEs with initial conditions.
Reported by: | charpent | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | symbolics | Keywords: | desolve differential_equations boundary_values |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Not yet reported upstream; Will do shortly. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Sources : initial constatation, formal question, formal report in sage-devel
.
y=function('y')(x) desolve(diff(y)==4*y/x+x*sqrt(y),y,ics=[1,1]).factor()
returns
1/4*x^4*(log(x) - 2)^2
instead of
1/4*x^4*(log(x) + 2)^2
A bit of exploration (see sources) shows that:
sympy
and {{{giac}} both can find the correct solution
Mathematica
returns both the "righr" and the "wrong" solution
- The bug is an infortunate choice of roots :
y=function('y')(x) Sol=desolve(diff(y)==4*y/x+x*sqrt(y),y).factor() print Sol var("_C") (Sol.subs(x==1)==1).solve(_C)
returns :
1/4*(2*_C + log(x))^2*x^4 [_C == -1, _C == 1]
It turns out that the same problem occurs in maxima
:
eq:'diff(y,x)=4*y/x+x*sqrt(y); SG:factor(ode2(eq,y,x)); print(eq); print(SG); SP:factor(ic1(SG,x=1,y=1)); print(SP); D1:subst([x=1],diff(rhs(SP),x)); print(D1); D2:subst([x=1,y=1],rhs(eq)); print(D2);
returns :
dy 4 y -- = --- + x sqrt(y) dx x 4 2 x (log(x) + 2 %c) y = ------------------- 4 4 2 x (log(x) - 2) y = ---------------- 4 3 5
Therefore, I'm inclined to attribute this bug to maxima
's one. I intend to report it upstream ASAP (more precisely, as soon I'll have recovered a way to log onto the damn sourceforge
site. Grrrr...).
Change History (3)
comment:1 Changed 17 months ago by
- Keywords desolve added
comment:2 Changed 14 months ago by
- Milestone changed from sage-8.7 to sage-8.8
comment:3 Changed 12 months ago by
- Milestone sage-8.8 deleted
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)