天道酬勤,学无止境

computer-algebra-systems

C# library for algebra simplification and solving [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago. Improve this question There are quite a few algebra solvers and simplifiers on the web (for example, the decent one at algebra.com). However, I'm looking for something I can plug into C# as part of a larger project (I'm making my own calculator, but obviously I'd ask permission etc.). Ideally, I'd use code like: String s = MathLib.Simplify("5x*(500/x^2*(sqrt(3)/4)+1)+2x^2+(sqrt(3)/2)*x^2

2021-05-17 18:13:12    分类:问答    c#   algebra   symbolic-math   computer-algebra-systems

How to do function composition in Sympy?

I want to do something like h = f(g(x)) and be able to differentiate h, like h.diff(x). For just one function like h = cos(x) this is in fact possible and the documentation makes it clear. But for function compositions it is not so clear. If you have done this, kindly show me an example or link me to the relevant document. (If Sympy can't do this, do you know of any other packages that does this, even if it is non-python) thank you.

2021-05-08 21:52:24    分类:问答    python   sympy   computer-algebra-systems

Dealing with piecewise equations returned by sympy integrate

In sympy I have an integral which returns a Piecewise object, e.g. In [2]: from sympy.abc import x,y,z In [3]: test = exp(-x**2/z**2) In [4]: itest = integrate(test,(x,0,oo)) In [5]: itest Out[5]: ⎧ ___ ⎪ ╲╱ π ⋅z │ ⎛ 1 ⎞│ π ⎪ ─────── for │periodic_argument⎜──────────────, ∞⎟│ ≤ ─ ⎪ 2 │ ⎜ 2 ⎟│ 2 ⎪ │ ⎝polar_lift (z) ⎠│ ⎪ ⎪∞ ⎪⌠ ⎨⎮ 2 ⎪⎮ -x ⎪⎮ ─── ⎪⎮ 2 ⎪⎮ z ⎪⎮ ℯ dx otherwise ⎪⌡ ⎪0 ⎩ I would like to extract just the first branch of this piecewise equation, in other words, I would like to be able to do something like itest.parts(0)to extract simply sqrt(pi)*z/2. I can't seem to find any way to do

2021-05-01 04:21:07    分类:问答    python   sympy   symbolic-math   computer-algebra-systems   symbolic-computation

符号代数表达式的符号(Sign of a symbolic algebraic expression)

问题 是否有任何算法可以找到“树-形式”中给出的任意符号代数表达式的符号? 我知道不存在通用算法,因为零识别问题对于任意表达式都是无法确定的,但是我应该如何解决查找表达式符号的问题呢? (这是如何在计算机代数中完成的?) 例如: sign(sqrt(2)-1) = ? 回答1 评估功能值 为此,您需要功能评估器引擎​​(编写代码并不难),仅当您要支持+,-操作时,才没有方法评估符号! 我所有的函数评估器的工作方式如下: 编译函数的源文本首先创建支持的函数表(id,操作数,名称,函数指针),例如: +,-,*,/,sin,cos,.... 这些将成为您需要评估的任何受支持表达式的基础。 也不要忘记在代码中编写所有功能。 将括号( , )也用作功能( push,pop )。 将您的函数按操作数进行分组,因此+,-分别带有1和2个操作数(两个不同的函数!!!)。 现在从表达式中提取: 变量名常量名称和值数字值进入某种表/列表: variables[](id,name,value) constants[](id,name,value) numbers [](id, ,value) 现在终于构造了编译后的函数字符串。 我的字符串是两个int的集合。 第一个是type (要使用的表),第二个是id (表中的索引)。 例如表达式: sign(sqrt(2)-1) 类型: id type 0

2021-04-29 16:02:23    分类:技术分享    algorithm   algebra   computer-algebra-systems

Multivariate Taylor approximation in sympy

I aim to write a multidimensional Taylor approximation using sympy, which uses as many builtin code as possible, computes the truncated Taylor approximation of a given function of two variables returns the result without the Big-O-remainder term, as e.g. in sin(x)=x - x**3/6 + O(x**4). Here is what I tryed so far: Approach 1 Naively, one could just combine the series command twice for each variable, which unfortunately does not work, as this example shows for the function sin(x*cos(y)): sp.sin(x*sp.cos(y)).series(x,x0=0,n=3).series(y,x0=0,n=3) >>> NotImplementedError: not sure of order of O(y*

2021-04-29 14:12:27    分类:问答    python   sympy   computer-algebra-systems   symbolic-computation

Haskell library like SymPy? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago. Improve this question I need to manipulate expressions like 1 + sqrt(3) and do basic arithmetic like addition, subtraction, and division. I'd like the result to be in some sort of canonical form so that it can be used as a key in a map. Turning 1 + sqrt(3) into a float is not feasible due to roundoff problems. I used SymPy for this task in Python. Is there an equivalent native library

2021-04-23 06:38:26    分类:问答    haskell   symbolic-math   computer-algebra-systems

Sign of a symbolic algebraic expression

Is there any algorithm that can find the sign of an arbitrary symbolic algebraic expression given in a "Tree - Form"? I know that a general algorithm doesn't exist because the zero recognizion problem is undecidable for an arbitrary expression, but how should I approach the problem of finding the sign of an expression? (how is this done in computer algebra?) For example: sign(sqrt(2)-1) = ?

2021-04-05 03:16:56    分类:问答    algorithm   algebra   computer-algebra-systems