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

Reorder hints in dsolve #21816

Merged
merged 5 commits into from Aug 4, 2021
Merged

Conversation

Mohitbalwani26
Copy link
Member

References to other Issues or PRs

SEE #18348

Brief description of what is fixed or changed

Ordering of hints is changed in dsolve.

Other comments

Release Notes

NO ENTRY

@sympy-bot
Copy link

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

  • No release notes entry will be added for this pull request.
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://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->
SEE #18348 

#### Brief description of what is fixed or changed
Ordering of hints is changed in dsolve.

#### Other comments


#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

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 -->
NO ENTRY
<!-- END RELEASE NOTES -->

@github-actions
Copy link

github-actions bot commented Aug 3, 2021

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

       before           after         ratio
     [5a5904ed]       [4538c33e]
-         1.26±0s        129±0.2ms     0.10  dsolve.TimeDsolve01.time_dsolve

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [ed9a550f]       [5a5904ed]
     <sympy-1.8^0>                 
-      8.79±0.01s       4.25±0.01s     0.48  integrate.TimeIntegrationRisch02.time_doit(100)
-         8.84±0s          4.23±0s     0.48  integrate.TimeIntegrationRisch02.time_doit_risch(100)
-     14.3±0.01ms      9.49±0.02ms     0.66  logic.LogicSuite.time_load_file
-      74.8±0.2μs      30.2±0.06μs     0.40  matrices.TimeDiagonalEigenvals.time_eigenvals
-      91.7±0.4μs       59.8±0.4μs     0.65  matrices.TimeMatrixGetItem.time_ImmutableDenseMatrix_getitem
-      91.4±0.4μs       59.9±0.3μs     0.66  matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
-      89.8±0.3μs       58.8±0.2μs     0.66  matrices.TimeMatrixGetItem.time_MutableSparseMatrix_getitem
-     84.6±0.09μs       52.1±0.1μs     0.62  solve.TimeMatrixArithmetic.time_dense_add(10, 0)
+     11.6±0.01μs      18.9±0.04μs     1.63  solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+     14.0±0.08μs       30.6±0.1μs     2.18  solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+     20.7±0.06μs      39.3±0.07μs     1.90  solve.TimeMatrixArithmetic.time_dense_add(4, 5)
+      37.4±0.1μs       63.3±0.1μs     1.69  solve.TimeMatrixArithmetic.time_dense_add(6, 5)
-        1.24±0ms        220±0.6μs     0.18  solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
-      48.0±0.1μs      25.1±0.02μs     0.52  solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+      75.3±0.2μs        133±0.3μs     1.76  solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
-       101±0.2μs      31.8±0.04μs     0.31  solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
-         298±1μs      64.3±0.06μs     0.22  solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
-      91.4±0.3μs       43.1±0.2μs     0.47  solve.TimeMatrixOperations.time_det(3, 0)
-       166±0.2μs       98.9±0.2μs     0.59  solve.TimeMatrixOperations.time_det(3, 2)
-       157±0.3μs      90.7±0.06μs     0.58  solve.TimeMatrixOperations.time_det(3, 5)
-      91.8±0.3μs       43.2±0.2μs     0.47  solve.TimeMatrixOperations.time_det_bareiss(3, 0)
-       167±0.4μs       99.2±0.3μs     0.59  solve.TimeMatrixOperations.time_det_bareiss(3, 2)
-       158±0.1μs       90.6±0.1μs     0.57  solve.TimeMatrixOperations.time_det_bareiss(3, 5)
-      92.1±0.3μs       43.3±0.2μs     0.47  solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
-       167±0.3μs       98.9±0.3μs     0.59  solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
-       158±0.4μs      90.7±0.05μs     0.58  solve.TimeMatrixOperations.time_det_berkowitz(3, 5)
+         723±2μs         1.10±0ms     1.52  solve.TimeMatrixOperations.time_det_berkowitz(4, 0)
+         867±1μs         1.60±0ms     1.84  solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+         902±1μs         1.70±0ms     1.89  solve.TimeMatrixOperations.time_det_berkowitz(4, 5)
+       266±0.8μs          426±2μs     1.60  solve.TimeMatrixOperations.time_rank(3, 0)
+         419±3μs        646±0.7μs     1.54  solve.TimeMatrixOperations.time_rank(4, 0)
+       122±0.2μs        183±0.3μs     1.50  solve.TimeMatrixOperations.time_rref(3, 0)
-        5.10±0ms         2.82±0ms     0.55  solve.TimeRationalSystem.time_linsolve(10)
-        1.03±0ms          652±1μs     0.63  solve.TimeRationalSystem.time_linsolve(5)
+     6.25±0.02ms      9.40±0.02ms     1.50  solve.TimeSparseSystem.time_linear_eq_to_matrix(30)
-        1.20±0ms          796±1μs     0.66  solve.TimeSparseSystem.time_linsolve_eqs(10)
-        2.26±0ms         1.44±0ms     0.64  solve.TimeSparseSystem.time_linsolve_eqs(20)
-        3.36±0ms         2.10±0ms     0.63  solve.TimeSparseSystem.time_linsolve_eqs(30)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@@ -1343,7 +1343,7 @@ def _get_examples_ode_sol_nth_order_reducible():

'reducible_10': {
'eq': f(x).diff(x, 5) + 2*f(x).diff(x, 3) + f(x).diff(x),
'sol': [Eq(f(x), C1 + C2*(x*sin(x) + cos(x)) + C3*(-x*cos(x) + sin(x)) + C4*sin(x) + C5*cos(x))],
'sol': [Eq(f(x), C1 + C2*x*sin(x) + C2*cos(x) - C3*x*cos(x) + C3*sin(x) + C4*sin(x) + C5*cos(x))],
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally odesimp or constantsimp would make the output the same here regardless of which hint is used.

@oscarbenjamin
Copy link
Contributor

I see that the dsolve benchmark has improved but there are only limited examples there.

Can you give timings for particular ODEs?

Does the time needed for the test suite change because of this?

With these improvements what takes the most time now if you profile dsolve?

@oscarbenjamin
Copy link
Contributor

Looks good!

@oscarbenjamin oscarbenjamin merged commit 4f50dd7 into sympy:master Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants