sympy / sympy_gamma Goto Github PK
View Code? Open in Web Editor NEWA SymPy version of WolframAlpha.
Home Page: https://sympygamma.com
License: Other
A SymPy version of WolframAlpha.
Home Page: https://sympygamma.com
License: Other
Hi,
for example for the input: "diff(sin(cos(x^3)^2 + log(e^x)) / (3x^2 + x), x)"
the result contains a log(e) term.
I suspect this could easily be canceled to a 1.
Anecdotally, for the same input, Maxima is also giving a log(e) term, but when I spell it as "%e", it happily cancels it down.
It's a detail, but then I guess fixing this would make the software ever-so-slightly better than it was before. My feelings about software development is that this the most that can be done on any given day.
Anyway, best regards and congrats on having what seems at a quick glance like a pretty readable and well-organized codebase :)
Implementing http://www.cs.uic.edu/~wilkinson/Publications/plotfunc.pdf either in Gamma or SymPy would be nice. The paper is "Algorithms for Choosing the Domain and Range when Plotting a Function", Wilkinson.
In here:
http://www.sympygamma.com/input/?i=erf%28r%29%2Fr
it says:
diff(erf(r)/r, r)
None
But SymPy can do it easily:
In [8]: diff(erf(r)/r, r)
Out[8]:
2
-r
2⋅ℯ erf(r)
─────── - ──────
___ 2
╲╱ π ⋅r r
Any ideas what's going on?
It seems that when I multiply an integral by a constant, it only calculates the integral part and ignores the constant. If I put the constant in the integral, it works fine.
It shows the the proper calculation at the top of the first ("SymPy") box, but the formatted version below does not show the constant. The answer it shows in the "Antiderivative forms" section does not account for the constant and the full answer is not shown anywhere.
SymPy Live does not seem to have this issue.
works:
http://www.sympygamma.com/input/?i=integral%281%2F2*x%29
doesn't work:
http://www.sympygamma.com/input/?i=1%2F2*integral%28x%29
When asking for the integration steps for an integral where multiple substitutions are needed, the variable "u" is always used. For example,
integrate(1/(x_log(x)_log(log(x))))
integrates to log(log(log(x))). Currently, two methods are reported: the first has us substituting u = log(x), and then substituting u = log(u). This second substitution ought not to reuse the variable u - it should say v = log(u), or in any case something that's not u or x. (The second method, substituting u = log(log(x)) in one go, is fine.)
When requesting diff(x^3) the graph is that of x^3, not that of diff(x^3). (If this is for some reason desired the graph should at least be labeled as such).
On input diff(cos)
:
Error:
diff(cos)
object of type 'property' has no len()
Google recently added a feature that lets you solve various geometric problems with their search engine (http://googlesystem.blogspot.com/2014/03/google-geometry-calculator.html, https://support.google.com/websearch/answer/4572089), e.g. calculate the diagonal of a square with 6 cm edge, calculate the area of a triangle with height 4 and base 5. Something like this would be nice for Gamma (perhaps without the NLP for now), especially with interactive results. It's also nice how Google shows the formula.
SymPy has some geometry support, but:
This one is quite impressive, it highlights the corresponding part of the formula when the input field is clicked and shows you the necessary constraints:
It also gives you a little derivation of the answer:
UI have started work on introducing 3D plotting in Gamma and will be discussing all the issues here. Code will be written in Gamma only...like 2D (D3.js's) not in SymPy.
For detailed explanation of how i wish to achieve it, see My Proposed GSoC Project
This is not a GSoC project.
log(27,3) (log_3(27)) links to the same function in Wolfram Alpha, however Wolfram Alpha interprets log base and value in reversed order (log_27(3)).
It might be useful to convert syntax for the Wolfram Alpha link to a format compatible with it when needed.
Discrete Mathematics > Boolean Logic > (x | y) & (x | ~y) & (~x | y)
gives:
There was an error in Gamma. For referencethe last five traceback entries are: Traceback (most recent call last):
File "/base/data/home/apps/s~sympy-gamma-hrd/20.374009304867725665/app/views.py", line 278, in eval_card
result = g.eval_card(card_name, expression, variable, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/20.374009304867725665/app/logic/logic.py", line 326, in eval_card
'output': card.format_output(result, mathjax_latex)
File "/base/data/home/apps/s~sympy-gamma-hrd/20.374009304867725665/app/logic/resultsets.py", line 61, in format_output
return self.card_info['format_output_function'](output, formatter)
File "/base/data/home/apps/s~sympy-gamma-hrd/20.374009304867725665/app/logic/resultsets.py", line 385, in _format_dict
for key, val in sorted(dictionary.iteritems()):
File "/base/data/home/apps/s~sympy-gamma-hrd/20.374009304867725665/sympy/sympy/core/relational.py", line 226, in __nonzero__
raise TypeError("symbolic boolean expression has no truth value.")
TypeError: symbolic boolean expression has no truth value.
All,
I am using gamma.sympy on older version of python which is 2.6. All the function are working fine. Only "print_U" method in intsteps.py file is not supported in 2.6 version. Particular the below syntax in the "print_U" methods in not supporting
def print_U(self, rule):
with self.new_step(), self.new_u_vars() as (u, du):
So, how can i convert this entire method to support 2.6 version. Or is there any older version of Sympy.gamma exist to support older version of python.
Currently SymPy Gamma, supports the 1.6.1
version of NumPy - listed in app.yaml
file.
The latest available version of NumPy as of today, i.e, 18th March'16, is 1.10.4
.
Now, if we update NumPy to the latest version,
And then after rebuilding the app.yaml
file -:
i) if in app.yaml
file , we change the numpy version to the latest one, then the following error pops up n the terminal while starting the Google App Engine-:
(sympygamma) ashutoshsaboo@ASHUTOSH-PC:~/sympy_gamma$ ../Downloads/google_appengine/dev_appserver.py .
Traceback (most recent call last):
File "../Downloads/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "../Downloads/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1040, in <module>
main()
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1033, in main
dev_server.start(options)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 758, in start
options.config_paths, options.app_id)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 831, in __init__
module_configuration = ModuleConfiguration(config_path, app_id)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 127, in __init__
self._config_path)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 424, in _parse_configuration
config, files = appinfo_includes.ParseAndReturnIncludePaths(f)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/api/appinfo_includes.py", line 82, in ParseAndReturnIncludePaths
appyaml = appinfo.LoadSingleAppInfo(appinfo_file)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/api/appinfo.py", line 2190, in LoadSingleAppInfo
listener.Parse(app_info)
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/api/yaml_listener.py", line 227, in Parse
self._HandleEvents(self._GenerateEventParameters(stream, loader_class))
File "/home/ashutoshsaboo/Downloads/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: numpy version "1.10.4" is not supported, use one of: "1.6.1"
in "./app.yaml", line 28, column 1
ii) Or else, in case if we don't edit the app.yaml
file after rebuilding it, then error #70 pops up.
I guess, we must ensure that the SymPy Gamma supports the latest version of NumPy, since as newer versions of NumPy come up, it may start deprecating previous functions, then it may cause problems with our code.
This gets displayed in the area where the plot()
graphs are generally displayed.
This happens in case of all the queries, in this query as well - plot(sin(x) + cos(2x))
. Error shown below. Is there some problem with my installation, or is it an internal issue only? I've followed the installation steps from this link - https://github.com/ashutoshsaboo/sympy_gamma .
I've followed the steps till - Uploading to GAE (Manually) only. As in I haven't followed any steps beyond that title, mentioned in the above link. So, is that causing the issue? Or what is it that's causing this issue?
Plot:
plot(sin(x) + cos(2*x))
There was an error in Gamma. For referencethe last five traceback entries are: Traceback (most recent call last):
File "/home/ashutoshsaboo/sympy_gamma/app/views.py", line 278, in eval_card
result = g.eval_card(card_name, expression, variable, parameters)
File "/home/ashutoshsaboo/sympy_gamma/app/logic/logic.py", line 322, in eval_card
result = card.eval(evaluator, components, parameters)
File "/home/ashutoshsaboo/sympy_gamma/app/logic/resultsets.py", line 98, in eval
return self.card_info['eval_method'](evaluator, components, parameters)
File "/home/ashutoshsaboo/sympy_gamma/app/logic/resultsets.py", line 562, in eval_plot
series = series.get_segments()
File "/home/ashutoshsaboo/sympy_gamma/sympy/sympy/plotting/plot.py", line 457, in get_segments
sample([self.start, f_start], [self.end, f_end], 0)
AttributeError: 'NoneType' object has no attribute 'random'
Announcement: https://www.mathjax.org/cdn-shutting-down/
It would be nice to incorporate the stats package of sympy into gamma, in order to allow using Bernoulli
, Binomial
, 'Normal,
variance`, etc.
Using Sympy Gamma for integrate(2/(log(n)**2*n), (n,2, oo))
, one substitution is wrong and incomplete (mixing new and old variable) and then a repeated variable appear without reason in next step (still without complete substitution).
http://www.sympygamma.com/input/?i=x*exp%28-x^2%29
See: integral step-by-step
Screenshot: http://s23.postimg.org/7ta3ufu4r/2014_04_13_19_45_54.png
Nearly every function has a See Also section in its help (for instance http://www.sympygamma.com/input/?i=factorial).
It would be nice to parse these and link them back to SymPyGamma, so that seeing the help for functions mentioned in See Also would be just one click away.
What do you think?
The input is 22/7 - integrate(x**4*(1-x)**4/(1+x**2), (x, 0, 1))
, but it only evaluates integrate(x**4*(1-x)**4/(1+x**2), (x, 0, 1))
.
Currently SymPy Gamma uses an older version of SymPy. SymPy has recently released version 1.0 and SymPy Gamma should use that.
It'd be cool to have a link to open the current page as IPython Notebook.
To implement it, I would simply create a Json file (the IPython Notebook format) with all the commands (i.e. derivatives, integrals, graphs, ...). When you load it to the IPython notebook and execute, it should roughly reproduce the SymPy Gamma page.
have few queries
Currently, SymPy Gamma, doesn't have the latest version of SymPy.
It's important for SymPy Gamma to have a newer version of SymPy.
See for example http://www.sympygamma.com/input/?i=10**10+-+1
The following equation returns 'False'
Equation : ((sin(x) - cos(x))(sin(x) + cos(x))) == (1 - 2 (cos(x)**2))
How ever individually the RHS and LHS produce the right results
(1 - 2 (cos(x)**2)) = -cos(2x)
((sin(x) - cos(x))(sin(x) + cos(x))) = -cos(2x)
link:
http://www.sympygamma.com/input/?i=%284x%2B2%29%2F%283x-4%29
simply click on the "See Steps" button in the "Antiderivative forms" box
I came across this by accident when testing the integral step-by-step feature. Derivative works fine though.
There was an error in Gamma. For reference the last five traceback entries are: Traceback (most recent call last):
File "/base/data/home/apps/s~sympy-gamma-hrd/19.372006176671940865/app/views.py", line 278, in eval_card
result = g.eval_card(card_name, expression, variable, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/19.372006176671940865/app/logic/logic.py", line 322, in eval_card
result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/19.372006176671940865/app/logic/resultsets.py", line 97, in eval
return self.card_info['eval_method'](evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/19.372006176671940865/app/logic/resultsets.py", line 643, in eval_intsteps
return intsteps.print_html_steps(integrand, components['variable'])
File "/base/data/home/apps/s~sympy-gamma-hrd/19.372006176671940865/app/logic/intsteps.py", line 341, in print_html_steps
a = HTMLPrinter(rule)
AttributeError: 'tuple' object has no attribute '_asdict'
Although I'm not sure how much does this project want to follow the Pythonic syntax but I believe that at least this small addition would enhance the overall experience.
There is a substantial difference between
ln(Abs(x -3) + 2)
and
ln(|x -3| + 2)
It seems that ^
already works the way many would expect (http://www.sympygamma.com/input/?i=a^b).
I could try to take a look at that if you find it worth looking into.
http://www.sympygamma.com/input/?i=solve%28y-%281%2Fy%29+%3D+x%2C+y%29
Not sure what the output should look like but the problem seems to be that not every SyntaxError has to have a .text
attribute.
Mentioned on Hacker News/Reddit:
satisfiable
showing an errorNatural language was also mentioned. Some resources:
Reported at https://twitter.com/michaelaye/status/721005528420200448
I guess it comes from this example on the homepage http://gamma.sympy.org/input/?i=integrate%28exp%28x%29%20/%20%281%20%2B%20exp%282x%29%29%29
http://www.sympygamma.com/input/?i=integrate%28x*cos%28-n*x%29%2C+%28x%2C+-pi%2C+0%29%29
Antiderivative forms:
There was an error in Gamma. For referencethe last five traceback entries are:
Traceback (most recent call last):
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/views.py", line 278,
in eval_card result = g.eval_card(card_name, expression, variable, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/logic.py", line 322, in eval_card result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 117, in eval result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 98, in eval return self.card_info['eval_method'](evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 636, in eval_integral_manual components['variable'])
AttributeError: 'ExprCondPair' object has no attribute 'is_polynomial'
Originally reported by @10110111 here
I enter the following into sympygamma.com input field:
integrate((sin(x/17) sin(x/15) sin(x/13) sin(x/11) sin(x/9) sin(x/7) sin(x/5) sin(x/3) sin(x))/x^9,(x,0,oo))
It's a Borwein-type integral, taken from Wolfram Mathematica documentation on its Integrate[] function: http://wolfram.com/xid/0mrb9e-iypuw5 (see "Neat Examples" section for expression and result).
sympygamma.com thinks for about a minute, then says "Looks like we've had a problem...Please report the issue to us so we can fix it!". So I'm reporting it here.
I couldn't find a way to use Xor in Gamma. It treats ^
always as **
which should not happen. And if that is that case, there is no way to use xor.
This http://www.sympygamma.com/input/?i=integrate%28exp%28-x%29*sin%281%2Fx%29%2C+%28x%2C+0%2C+oo%29%29
Sometimes says "computation timed out", but sometimes it gives this traceback:
There was an error in Gamma. For referencethe last five traceback entries are: Traceback (most recent call last):
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/views.py", line 278, in eval_card
result = g.eval_card(card_name, expression, variable, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/logic.py", line 322, in eval_card
result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 117, in eval
result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 98, in eval
return self.card_info['eval_method'](evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 636, in eval_integral_manual
components['variable'])
TypeError: unsupported operand type(s) for -: 'Mul' and 'NoneType'
Which seems like a bug.
When I type point
it interprets it as p*o*i*n*t
and when I type Point
it gives me relevant details from the docs.
A user won't be searching for class name(because they don't know it). So we should enhance this search process maybe by capitalizing the first char or by just suggesting a "Did you mean?".
Working on my iPhone in Safari, if I run factorint(1000), then I get the text "prime factorization of 1000" rather than the actual factorization.
If we can, we should create sphinx generated documentations for SymPy gamma. This will help newcomers in understanding the code mainly the logic
module.
I found this problem while trying plot_parametric
(http://docs.sympy.org/dev/modules/plotting.html#sympy.plotting.plot.plot_parametric), realising SymPy Gamma interprets it as a symbol.
If the integral is made indefinite Gamma doesn't actually evaluate it either (giving an Integral object)
There was an error in Gamma. For referencethe last five traceback entries are: Traceback (most recent call last):
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/views.py", line 278, in eval_card
result = g.eval_card(card_name, expression, variable, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/logic.py", line 322, in eval_card
result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 117, in eval
result = card.eval(evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 98, in eval
return self.card_info['eval_method'](evaluator, components, parameters)
File "/base/data/home/apps/s~sympy-gamma-hrd/24.376529677133784673/app/logic/resultsets.py", line 636, in eval_integral_manual
components['variable'])
TypeError: unsupported operand type(s) for +: 'Add' and 'NoneType'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.