5 ms·
Tools for solving differential equations in SageMath: http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html http://doc.sagemath.org/
by bloaf 11y ago
Tools for solving differential equations in SageMath:
http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html http://doc.sagemath.org/html/en/reference/calculus/sage/calc...
Differential equation solving in Mathematica:
https://reference.wolfram.com/language/ref/DSolve.html https://reference.wolfram.com/language/ref/DSolve.html
I feel that the difference between the two tools when it comes to this problem really illustrates their core differences.
- sunnyps 11y agoTo be fair to Sage they have a more beginner friendly tutorial for solving differential equations: http://doc.sagemath.org/html/en/tutorial/tour_algebra.html#solving-differential-equations http://doc.sagemath.org/html/en/tutorial/tour_algebra.html#s...
- pbhjpbhj 11y agoNot being a user of either program (but having an interest in maths) the most immediate difference looks like Sage's insistence on declaring variables, wouldn't allowing use without declaration be more appropriate ... what's the rationale for that choice that I'm missing?
- williamstein 11y agoInstead of creating a new programming language, SageMath uses the extremely popular programming language Python (with some optional minimal preparsing). Thus the language design decisions were mostly made by software engineers, rather than mathematicians. That said, the only sense in which you have to declare variables is that you can't just write x + y without any further thought (you have to write "y=something" first). This avoids some mistakes due to typos, which are common in Mathematica. It also makes it easier to endow variables with more precise structure (e.g., make y a polynomial over a finite field).
- pbhjpbhj 11y agoSounds like it would be relatively easy to then optionally pre-parse and automate the variable declaration cutting input considerably (for those who wished it) ... I'm sure that's been done already in such a long lived and popular project. Thanks for you response and insight. Must give sage a try again.
- williamstein 11y agoYes, I did implement that once. It's in the Sage Notebook (see here http://doc.sagemath.org/html/en/reference/notebook/sagenb/misc/support.html http://doc.sagemath.org/html/en/reference/notebook/sagenb/mi...), but nobody implemented it for the command line, and I haven't reimplemented in SageMathCloud worksheets yet. I've opened a ticket: https://github.com/sagemathinc/smc/issues/419 https://github.com/sagemathinc/smc/issues/419
- bloaf 11y agoSo does Mathematica: https://reference.wolfram.com/language/tutorial/DifferentialEquations.html https://reference.wolfram.com/language/tutorial/Differential...
- ajross 11y agoCan you elaborate on the difference? Those APIs look very comparable to me, except that Sage documents lots of minutiae on the same page where it appears Mathematica must have it hidden somewhere else. Are you making a point about the documentation or the software?
- kccqzy 11y agoI don't think those APIs are comparable at all. Mathematics exposes two functions for solving differential equations, DSolve and NDSolve, for symbolic and numeric solutions. In contrast, sage exposes a melange of different functions based on what methods they use internally. This is hugely different in terms of usability. A high school kid doing a physics project might come up with a differential equation without knowing how to solve it manually, but she can expect to simply use the correct syntax to invoke DSolve/NDSolve to get what she wants. You can't do that in sage without learning a lot about differential equations themselves. By the way, Mathematica's documentation contains lots of detailed examples hidden beneath those little disclosure triangles.
- rch 11y agoSo, one could read your comment as being in favor of Sage for education then. Specifically in cases where an instructor is available to augment the documentation.
- bloaf 11y agoThis is precisely the core difference I was talking about. If you want someone to learn about the details of their differential equation solving, then you could probably construct an argument for Sage. But that is not always the educational goal. Indeed, for everyone but college level STEM people in a "Diffeq solution methods" class, it will most likely not be the goal. Mathematica says: You shouldn't have to know the minutiae about differential equations in order to solve them; we'll figure out the details for you! SageMath says: We'll give you a buffet of solvers with different internals so you can pick the one that's right for your problem! Both approaches have merit, and drawbacks. But if you asked me which approach I support, I'd have to go with Mathematica. Theirs is more ambitious, and far more powerful if they are able to "get it right."