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
6
votes
2 answers

How to take element-wise logarithm of a matrix in sympy?

Working with a sympy Matrix or numpy array of sympy symbols, how does one take the element-wise logarithm? For example, if I have: m=sympy.Matrix(sympy.symbols('a b c d')) Then np.abs(m) works fine, but np.log(m) does not work ("AttributeError:…
Bitwise
  • 7,577
  • 6
  • 33
  • 50
6
votes
3 answers

Evaluate Matlab symbolic function

I have a problem with symbolic functions. I am creating function of my own whose first argument is a string. Then I am converting that string to symbolic function: f = syms(func) Lets say my string is sin(x). So now I want to calculate it using…
user2141889
  • 2,255
  • 5
  • 23
  • 25
6
votes
2 answers

Solving Symbolic Boolean variables in Python

I need to solve a set of symbolic Boolean expressions like: >>> solve(x | y = False) (False, False) >>> solve(x & y = True) (True, True) >>> solve (x & y & z = True) (True, True, True) >>> solve(x ^ y = False) ((False, False), (True,…
hola
  • 930
  • 1
  • 17
  • 35
6
votes
1 answer

matlab: creating a symbolic vector

I am trying to create a function using the symbolic toolbox in matlab. I have been having trouble creating a symbolic vector (not a vector of symbolic variables). Do you guys know a way to do this without creating and editing a text-like matlab…
Avico
  • 321
  • 3
  • 8
6
votes
1 answer

Tidy up expression after differentiating

The equations I am working with in this problem contain exponentials. For this reason, after differentiating they appear again pretty much unchanged apart from additional constants and other factors. I was wondering if it might be possible to…
el_technic0
  • 553
  • 6
  • 14
6
votes
2 answers

C# library overloads ^ operator. How to use ** instead?

The Symbolism library overloads arithmetic operators. Although it's written in C# I can use it from F#: open Symbolism let x = new Symbol("x") let y = new Symbol("y") let z = new Symbol("z") printfn "%A" (2*x + 3 + 4*x + 5*y + z + 8*y) the…
6
votes
1 answer

Summation series using matlab

When i write this in matlab syms x; f=x^3-cos(x); g=diff(f) it gives out put as g = 3*x^2+sin(x) Now I want to generate summation series as I google and found "symsum" command but it doesn't do my required task, when i write the following…
Zaksh
  • 953
  • 2
  • 12
  • 29
6
votes
1 answer

Symbolic integration in Octave? (Need to Install extantion? How? - Using Ubuntu 12.04)

I would like to calculate the following symbolic expression in GNU Octave: int(exp(ikx-|k|^n),k,-infinity,infinity) , (- it would a function of 'x' of-course, where 'x' is an array of data.) I don't succeed. I understood, searching a bit in the…
user1611107
  • 287
  • 1
  • 4
  • 13
5
votes
3 answers

Sympy "global" substitution

I have a number of symbolic expressions in sympy, and I may come to realize that one of the coefficients is zero. I would think, perhaps because I am used to mathematica, that the following makes sense: from sympy import Symbol x = Symbol('x') y =…
mboratko
  • 376
  • 3
  • 16
5
votes
2 answers

SymPy: How can I check, if symbol is a constant or a variable?

In sympy, I want to create a constant e.g. to represent the speed of light. Thus I initialize c with the keyword constant=True. Later I want to check, if a symbol is a constant or a variable. Unexpectedly the command c.is_constant() outputs False. c…
shelly
  • 51
  • 1
  • 4
5
votes
2 answers

Automatically simplify redundant arithmetic relations

I am looking for a way to automatically determine, e.g., that (a < 12) & (a < 3) & (c >= 4) is the same as (a < 3) & (c >= 4). I looked into Matlab's symbolic toolbox and SymPy in Python, but these are apparently only capable of simplifying purely…
japhwil
  • 299
  • 4
  • 16
5
votes
0 answers

Bounded sympy symbol variables

I would like to solve a multivariate optimization problem by converting it to a system of non-linear equations and solving using sympy's "solve" function as so: xopt = sympy.solve(gradf, x, set=True) Trouble is, this particular equation has an…
5
votes
0 answers

Sympy - Integration is slow when expression contains many symbols

Say I have the following expression which I would like to integrate over the variable z from 0 to L. import sympy as sp mdot, D, R, alpha, beta, xi, mu0, q, cp, Tin, L = sp.symbols("\dot{m}, D, R, alpha, beta, xi, mu_0, q, c_p, T_in, L", real=True,…
Davide_sd
  • 10,578
  • 3
  • 18
  • 30
5
votes
1 answer

Evaluation of the exponential of a symbolic array in Python

I'm trying to evaluate the exponential of a symbolic array. Basically I have a numeric array a and a symbolic variable x defined. I then defined a function f which is equal to the exponential of the multiplication of the two, and tried to evaluate…
Élio Pereira
  • 181
  • 1
  • 14
5
votes
0 answers

symbolic computation in lisp/scheme, compile-time or runtime?

I am doing symbolic computations for origami, involving computing the parametric equation of a crease given two points, as below. I am hoping to turn that into a very simple origami theorem prover/CAS hybrid. ; number -> number -> vertex (struct…
Raoul
  • 1,872
  • 3
  • 26
  • 48