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

Update SymPy chapter for 2023. #122

Merged
merged 8 commits into from
Feb 9, 2023
Merged

Update SymPy chapter for 2023. #122

merged 8 commits into from
Feb 9, 2023

Conversation

moorepants
Copy link
Owner

@moorepants moorepants commented Feb 6, 2023

  • Improved wording in various places.
  • Added more hyperlinks to connect to mentioned topics.
  • Added an exercise to almost all sections.
  • Expanded some examples.

TODO:

Fixes #121

- Improved wording in various places.
- Added more hyperlinks to connect to mentioned topics.
- Added an exercise to almost all sections.
- Expanded some examples.
sympy.rst Show resolved Hide resolved
sympy.rst Show resolved Hide resolved
sympy.rst Show resolved Hide resolved
sympy.rst Outdated

A.inv() @ b

But it is best to use the ``.LUsolve()`` method to perform Gaussian-Elimination
Copy link
Owner Author

Choose a reason for hiding this comment

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

Could be nice to link to something like this: https://gregorygundersen.com/blog/2020/12/09/matrix-inversion/. Not sure how permanent this explanation is or if there is a better one.

sympy.rst Outdated Show resolved Hide resolved
@Peter230655
Copy link

Peter230655 commented Feb 6, 2023 via email

@Peter230655
Copy link

Peter230655 commented Feb 6, 2023 via email

@moorepants
Copy link
Owner Author

It finds the solution in split seconds, while linsolve(..., .) seems to take forever, say, after 10 minutes still no solution and I abort it.

If you can report a simple example that demonstrates this to SymPy, that would help. linsolve just isn't battle tested and it chokes on steps that it shouldn't.

@moorepants
Copy link
Owner Author

I assume, the theory of Gaussian elimination is in any textbook of linear algebra, unsure whether such an attachment is needed.

I don't want to explain it here, because they should have learned it in prior courses, but linking to a good reference can give them a pointer to refresh their memory.

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@moorepants
Copy link
Owner Author

The homework problem I give them is exactly that: solve nonholonomic constraint for the speeds. I just give them the expressions. So it would be better if the book add a different example, so they can't just copy and paste to solve the homework.

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@moorepants
Copy link
Owner Author

would this example be useful, to start an issue in sympy about linsolve?

Yes, I think this is good to point out to the sympy devs. solve and linsolve should run faster.

@moorepants
Copy link
Owner Author

This one is complete now, ready for review. I added an exercise to see how cse affects lambdify.

@Peter230655
Copy link

Peter230655 commented Feb 7, 2023 via email

@Peter230655
Copy link

Peter230655 commented Feb 8, 2023 via email

sympy.rst Outdated Show resolved Hide resolved
@moorepants
Copy link
Owner Author

Merging. Raise issues if anything is noticed in the published version.

@moorepants moorepants merged commit b5c2c3a into master Feb 9, 2023
@moorepants moorepants deleted the sympy2023 branch February 9, 2023 07:55
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.

Show the value of cse in lambdify now that cse=True is available
2 participants