Questions tagged [symbolic-math]

Symbolic math tools allows for analytically process mathematical expressions - without the necessity of assigning specific numeric values to variables.

Common software that allows for symbolic math operations include

See this comparison of computer algebra systems (CAS) for other software packages that support symbolic math operations.

Online examples of Computer Algebra System

1493 questions
9
votes
2 answers

Solving systems of equations in R

Solving an equation symbolically can be achieved in R using the Ryacas library. For example library(Ryacas) yacas("Solve(x/(1+x) == a, x)") gives expression(list(x == a/(1 - a))) Does anybody know how to (symbolically) solve a system of…
Brani
  • 6,454
  • 15
  • 46
  • 49
9
votes
2 answers

How to simplify an expression for a complex constant using sympy?

I have done some calculations in sympy, and the result is in the end a set of constants. One of them is inserted directly into the snippet below: from sympy import * expr = (18**(Rational(1, 3))/(6*(3 + sqrt(3)*I)**(Rational(1, 3))) +…
josteinb
  • 1,892
  • 2
  • 18
  • 32
9
votes
2 answers

Calculus Limits with Java

I wish to calculate limits (calculus) with Java. I have the following class Limit that can calculate limits: package calculus; public final class Limit { private Limit() { } public static final double limit(Function function, double…
hyper-neutrino
  • 5,272
  • 2
  • 29
  • 50
9
votes
1 answer

Matlab/Mupad symbolic simplification for pretty output

I need to automatically simplify some symbolic expressions but the simplify function of matlab can't do everything i need. Example: simplify(expand((ax + bx)^2 + (ay + by)^2)) Which results in the output ax^2 + 2*ax*bx + ay^2 + 2*ay*by + bx^2 +…
Daniel
  • 2,993
  • 2
  • 23
  • 40
9
votes
3 answers

Factoring polys in sympy

I'm doing a very simple probability calculations of getting subset of X, Y, Z from set of A-Z (with corresponding probabilities x, y, z). And because of very heavy formulas, in order to handle them, I'm trying to simplify (or collect or factor - I…
akaRem
  • 7,326
  • 4
  • 29
  • 43
8
votes
2 answers

Simplifying a very long symbolic expression by automatically introducing temporal variables or in any other way

After attempting to solve a symbolic math problem, I got an expression with about 17000 characters. I am using the symbolic toolbox for Matlab, but I am open to any suggestion (Mathematica, whatever). For obvious reasons, I won't copy-paste the…
Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104
8
votes
1 answer

sympy - symbolic sum over symbolic number of elements

What is the most appropriate way to express the following in SymPy: A sum over samples 'x[i]' with 'i' going from concrete 0 to symbolic 'N'. 'x[i]' itself shall be symbolic, i.e. always appear as variable. The goal is to use these expressions in a…
Frank-Rene Schäfer
  • 3,182
  • 27
  • 51
8
votes
3 answers

How to simplify logarithm of exponent in sympy?

When I type import sympy as sp x = sp.Symbol('x') sp.simplify(sp.log(sp.exp(x))) I obtain log(e^x) Instead of x. I know that "there are no guarantees" on this function. Question. Is there some specific simplification (through series expansion or…
Sergey Dovgal
  • 614
  • 6
  • 21
8
votes
1 answer

Sympy computing the inverse laplace transform

I am having some trouble computing the inverse laplace transform of a symbolic expression using sympy. In matlab and in the book I am working from the expression s/(s^2 + w^2) transforms to cos(wt). When I attempt to do this using sympy like…
SomeRandomPhysicist
  • 1,531
  • 4
  • 19
  • 42
8
votes
1 answer

Factorise symbolic expression (square of a sum) in MATLAB

If I start with the following symbolic expression: a^2 + 2*a*b + b^2 Then run simplify (or factor), I get the expected result: >> simplify(a^2 + 2*a*b + b^2) (a + b)^2 Now when I run the same example, but adding another term, no factorisation…
btalb
  • 6,937
  • 11
  • 36
  • 44
8
votes
1 answer

Convert symbolic expressions to Python functions using SymPy

I have a rather large symbolic function that is evaluated for different values of a parameter in a loop. In each iteration, after finding the expression of the function, partial derivatives are derived. Something like this: from sympy import diff,…
AGandom
  • 455
  • 1
  • 5
  • 8
8
votes
1 answer

sympy: 'Transpose' object has no attribute tolist

I'm trying to do some symbolic matrix calculations with sympy. My goal is to obtain a symbolic representation of the result of some matrix computations. I've run into some problems which I have boiled down to this simple example, in which I try to…
8
votes
1 answer

How to solve matrix equation with sympy?

In sympy, given a matrix equation M * x + N * y = 0 (or more complicated..) how to solve this for x? (M,N = matrices, x,y = vectors) I tried this with normal symbols, but obviously this failed. Using MatrixSymbol was not working as well. Is there…
Dirk
  • 1,789
  • 2
  • 21
  • 31
8
votes
1 answer

Content MathML vs. OpenMath for model exchange

In my research group, we have different people doing algebraic modelling in different symbolic tools such as Symbolic Toolbox in Matlab and Sympy in Python. These models are then typically exported to C-code and copy-pasted-adapted into our own…
Joel
  • 1,295
  • 15
  • 30
8
votes
1 answer

How do I convert an anonymous function to a symbolic function in MATLAB?

Say I have a anonymous function f = @(x) x^2 and I want to convert this to a symbolic function. Is there a built in command for that?
Will
  • 4,241
  • 4
  • 39
  • 48