Skip to content
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

Make checkodesol work for series solutions #17588

Merged
merged 2 commits into from Oct 4, 2019

Conversation

oscarbenjamin
Copy link
Contributor

References to other Issues or PRs

Fixes #16000

Brief description of what is fixed or changed

Makes checkodesol work for series solutions of ODEs as returned by dsolve. I'm not sure this works for series solutions around non-zero points because dsolve doesn't yet return correct series solution around nonzero points.

Other comments

I'm still working on this...

Release Notes

  • solvers
    • checkodesol now works for series solutions of ODEs.

@sympy-bot
Copy link

sympy-bot commented Sep 8, 2019

Hi, I am the SymPy bot (v149). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->

Fixes #16000 

#### Brief description of what is fixed or changed

Makes checkodesol work for series solutions of ODEs as returned by dsolve. I'm not sure this works for series solutions around non-zero points because dsolve doesn't yet return correct series solution around nonzero points.

#### Other comments

I'm still working on this...

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* solvers
    * checkodesol now works for series solutions of ODEs.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@codecov
Copy link

codecov bot commented Sep 8, 2019

Codecov Report

Merging #17588 into master will decrease coverage by 0.005%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##           master    #17588       +/-   ##
============================================
- Coverage   74.76%   74.754%   -0.006%     
============================================
  Files         634       634               
  Lines      165333    165347       +14     
  Branches    38857     38858        +1     
============================================
+ Hits       123604    123605        +1     
- Misses      36309     36319       +10     
- Partials     5420      5423        +3

+ C1*(x + (x + 2)**4/12 - (x + 2)**3/3 + S(2))
+ O(x**6))
assert dsolve(eq, n=2) == Eq(f(x), C2*x + C1 + O(x**2))
assert dsolve(eq, x0=-2) == sol
# FIXME: Solution should be O((x+2)**6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O((x+2)**6) has a different meaning. So we can't get from the solution and also O(x**6) is the correct way of representing the solution.

In [9]: Order((x+2)**6)
Out[9]: O(1)

For the checkodesol We can pass the argument x0 and then we can use it for your work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is:

In [1]: O((x+2)**6, (x, -2))                                                                                                      
Out[1]:6        ⎞
O⎝(x + 2) ; x  -2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making dsolve return that fails because constantsimp calls cse which absorbs all the terms #17587

@oscarbenjamin
Copy link
Contributor Author

I'll merge this soon if no one objects

@oscarbenjamin oscarbenjamin merged commit 701423f into sympy:master Oct 4, 2019
@oscarbenjamin oscarbenjamin deleted the checkodesol_series branch January 9, 2020 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No equivalent of checkodesol for series solutions of ODEs
4 participants