I have previously questioned that Wolfram have a == b -> a/c == b/c transformation in conditional expression format
https://reference.wolfram.com/language/ref/DivideSides.html and why you were not attempting to implement same like this,
But now I'd may agree on that if we treat such examples as polynomial algebra, those transformation can make mathematical sense without connection to the assumptions behind.
And I believe that in this sense, differentiation and integration can similarly avoid such hoax without treatment of assumptions.
But now I have an another question if the manipulation works in algebraically robust way,
For example, we have lots of pitfalls of expression tree manipulation that some simple examples like "x / x" work,
but we soon end up with some more complicated examples like " exp(x+1)/exp(1)" doesn't work robustly,
and the only way to cope with them are appending .expand().cancel().together().simplify(), ... to the tail which is pretty much black-boxed and not robust at all.
So this is one of the problem that I'm skeptical about how they can be used as a backend for automatic symbolic manipulations, rather than some convenience tools for end users.
And for such purposes I believe that we rather have to make object like PolyEquation.
I suppose I think the problem is that many users DO use SymPy as a tool to do calculations - not as something to build into something else. As you acknowledge, such convenience functions are almost essential to make good use of an equation class interactively, even though they can produce mistakes when wrongly used (as can subs).
One possibility might be to place 'dangerous' functions, such as DivideSides, in a submodule of SymPy so that they are only loaded if the user, or the system builder, deems it appropriate - very much as users can choose to import the symbols from sympy.abc at their discretion.
Obviously such functions would not be used by default by simplify
if it were applied to equation objects.
David
But now I have an another question if the manipulation works in algebraically robust way,
For example, we have lots of pitfalls of expression tree manipulation that some simple examples like "x / x" work,
but we soon end up with some more complicated examples like " exp(x+1)/exp(1)" doesn't work robustly,
and the only way to cope with them are appending .expand().cancel().together().simplify(), ... to the tail which is pretty much black-boxed and not robust at all.
Hi Group,
I know this isn't strictly a SymPy question, but I suspect someone here will be able to point me in the right direction.
When I first acquired SymPy on my 64-bit Windows 10 machine, I
downloaded what was then the official version of Python - 3.7.3,
and installed SymPy and some other things upon it. Recently I
wanted to install Tkinter, and I got the following diagnostic:
pip install tkinter
Collecting tkinter
ERROR: Could not find a version that satisfies the requirement
tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
I really don't want to start from scratch installing Python, does anyone know what this problem is all about?
I've seen suggestions that tkinter is built into Python, but it seems not:
import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter'
David
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4aaf17c9-88dd-33c9-d1c0-6b733b0d29e3%40dbailey.co.uk.
I think David is using Windows so that apt-get command which is for Debian Linux can not be used. David I thought that the standard Python installers for Windows would mean that you had tkinter installed. I don't think you can install it with pip because it's basically part of Python (so not really a "separate" package). There are many different ways of installing Python though so it might depend on exactly which installer you used. I would generally use the installer files from here: https://www.python.org/downloads/
Yes that contains tkinter, but I have discovered that matplotlib won't install on 3.9.1!
There is probably nothing you can suggest, so I suppose I am just venting my frustration!
David
As the number of different people responding to this discussion has been small I have put together the following simple 2 question survey about expectations/preferences for differentiation of equations to try to broaden the input. This is a simple google form. It collects google addresses only to avoid multiple responses from the same google account. I expect it to take people about 1 minute. The link is: https://docs.google.com/forms/d/e/1FAIpQLSd-VCuOuNQtEo8VAuDA42SgNPYhMhr4Z5nEsGdwYoG9SCI5Nw/viewform?usp=sf_link.
I am sorry to be awkward, but I found this tricky to explain on the one line provided for 'Other'.
The definition of an equation seems so important (and remarkably
tricky!), would it be better to implement something that seems
reasonable and put it out as experimental code?
Another possibility might be to simply fault any attempt to take
the derivative of an equation (and no doubt some other awkward
operations) until people had had time to experiment with equations
for a bit.
For example, if I chose option 5, I'd want to figure out how easy it would be to set all the unwanted derivatives to zero, or stop them appearing.
David
Dear Group,
While thinking about Jonathon's question, I came across this oddity:
x=symbols('x')
f=symbols('f',cls=Function)
diff(f,x)
1
Why 1? I think I would have expected it to generate a TypeError, just like f+x does.
David
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/724a9342-6794-a600-7d8c-c41c331f20d5%40dbailey.co.uk.
Might it be an idea to introduce functions such as AddSides, SubtractSides, etc that Mathematica has? Not only would these avoid any confusion with the normal arithmetic operations, but I think using these functions would clarify what is going on. After all, when people do such operations by hand, they don't write (a=b)*k,or whatever, they typically write "Multiplying equation 4 by k we get..."
David
David
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/8ae678d4-86cf-82eb-1037-1356e18b88f6%40dbailey.co.uk.
Oscar
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxTAAA%3DHDaNA4-HU%2BqFV34nF7GfA7GbHn_HzVWgu0Epr6w%40mail.gmail.com.
On Wed, Feb 10, 2021 at 1:44 PM Oscar Benjamin <oscar.j....@gmail.com> wrote:Yes, DivideSides would make sense for unevaluated division of inequalities etc.
That is not inconsistent with using + though: We can use eq1+eq2 as a
shorthand for the evaluated form of AddSides(eq1, eq2). For equations
that would always be able to evaluate. In Mathematica this is all
organised around making Boolean expressions that can evaluate after
substitution.We can generalize this to applying any function to equations or inequalities. For equations, it matters where the function either isn't defined (like y=0 for f(x, y) = x/y), or isn't well-defined (for example, square roots are multivalued). For inequalities it matters on what parts of the domain the function is (strictly) monotonic. Except I don't know if SymPy can really answer either of these questions right now. So this might have to remain only a theoretical idea for the time being.Aaron Meurer
Oscar
Jonathan
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/a9cd201d-91b2-4bc1-b2fc-4cb0da3801b2n%40googlegroups.com.
How would you handle dividing both sides of an equation by something? I don't know if a piecewise makes sense. (a = b)/x would be "a/x = b/x if x != 0, ??? otherwise". What meaningful thing could the ??? be? You can easily manipulate an equation into nonsense if you aren't careful about this (just Google "proof that 1 = 2"). But I don't know if SymPy should try to take responsibility to prevent it.
cos(x).subs(cos,sin)
sin(x)
SymPy does not guarantee that this is valid!
Also there is absolutely no sense in which eqn(a,b) is twice as
big as eqn(a,b)/2, so is it desirable that the notation should
suggest that it is?
David