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
4 answers

Getting all the leaves from an expression

I would like to get a List (ideally a set -- discarding repetition -- but assuming there's no direct way to do this I'll just use Union) of the leaves from a given expression. For example, the expression ArcTan[(-1 + 2*x)/Sqrt[3]]/Sqrt[3] has a…
Charles
  • 11,269
  • 13
  • 67
  • 105
6
votes
3 answers

Can program be used to simplify algebraic expressions?

We know 1+2+...+n is equal to n(n+1)/2. But can we get the same result programatically if we don't know it in advance? About why I have such a question. Think of a more complex situation: X1+X2+...+Xk=n, where Xi is integer and >= 0. What's the…
Je Rog
  • 5,675
  • 8
  • 39
  • 47
6
votes
1 answer

How to represent 5*π symbolically in Julia

Related to a previous question: I am using Julia Symbolics package and would like to represent 5*pi symbolically. I tried the following to no avail: using Symbolics 5 * Symbolics.pi # expanded to 15.707963267948966 Num(5) * Symbolics.pi #…
Tarik
  • 10,810
  • 2
  • 26
  • 40
6
votes
3 answers

Sqrt of constant representation in Julia Symbolics

I am looking for a way to represent a symbolic expression such as sqrt(3)*x so as to avoid sqrt(3) being calculated upfront. Sample code: using Symbolics @variables x y = sqrt(3)*x Showing y, we can see that sqrt(3) has become a floating point. Is…
Tarik
  • 10,810
  • 2
  • 26
  • 40
6
votes
2 answers

Are symbolic computation and functional programming related?

I was wondering if symbolic computation in Computer Algebra System (such as symbolic toolbox in Matlab, Mathematica) and functional programming related and how? Does the former belong to the latter? Thanks and regards!
Tim
  • 1
  • 141
  • 372
  • 590
6
votes
0 answers

Loading symbolic variables from Matlab in Python

I know spio.loadmat does not properly load symbolic variables created in Matlab into Python. But, I am wondering if anyone here has ever tried to load such .mat files in Python using any sort of trick.
Saj_Eda
  • 203
  • 1
  • 10
6
votes
1 answer

Symbolic integration slow with SymPy

I'm not a SymPy expert, but I've used it successfully in some of my lectures in the last years. However, sometimes it seems to be very slow with symbolic integration. Here's an example that Mathematica computes almost instantly while SymPy needs a…
Frunobulax
  • 345
  • 2
  • 13
6
votes
0 answers

Get REAL and IMAG from complex number in parsed equation

I am evaluating Math.NET Symbolics for use in our application where we want a simple math parser for the user to calculate custom equations from our measurement data. Our data is in the form of Complex numbers. To test I use the following…
6
votes
2 answers

Symbolic vs Numeric Math - Performance

Do symbolic math calculations (especially for solving nonlinear polynomial systems) cause huge performance (calculation speed) disadvantage compared to numeric calculations? Are there any benchmark/data about this? Found a related question: Symbolic…
6
votes
3 answers

Function for polynomials of arbitrary order (symbolic method preferred)

I've found polynomial coefficients from my data: R <- c(0.256,0.512,0.768,1.024,1.28,1.437,1.594,1.72,1.846,1.972,2.098,2.4029) Ic <- c(1.78,1.71,1.57,1.44,1.25,1.02,0.87,0.68,0.54,0.38,0.26,0.17) NN <- 3 ft <- lm(Ic ~ poly(R, NN, raw = TRUE)) pc <-…
user4489658
6
votes
1 answer

Display a matrix with putting a common factor in sympy

I want to display a matrix with putting an extracted common factor on outside of the matrix after matrix calculation in sympy. I wrote below code. from sympy import * a = symbols("a") b = symbols("b") A = Matrix([exp(I*a),exp(I*a)*exp(I*b)]) print…
user6695701
  • 197
  • 1
  • 10
6
votes
1 answer

Python Save a (Sparse) Matrix with a variable inside

I have some matrices of decent size (2000*2000) and I wish to have symbolic expressions in the elements of the matrices - i.e. .9**b + .8**b + .7**b ... is an example of an element. The matrices are quite sparse. I am creating these matrices by…
adamwlev
  • 97
  • 2
  • 7
6
votes
2 answers

How to simplify sqrt expressions in sympy

I'm using sympy v1.0 in a Jupyter Notebook. I'm having trouble getting expression to simplify how I'd like. Here's a toy example; it does the same thing my more complicated expressions do... import sympy sympy.init_printing(use_latex='mathjax') x, y…
Matt Hall
  • 7,614
  • 1
  • 23
  • 36
6
votes
1 answer

Avoid unwanted text from Octave's symbolic package

When you call vpa (from Octave's symbolic package) for the first time, Octave produces some text on screen before outputting the actual result. For example: >> x = pretty(vpa('sqrt(-1)')) OctSymPy v2.2.4: this is free software without warranty, see…
Luis Mendo
  • 110,752
  • 13
  • 76
  • 147
6
votes
1 answer

Pretty MuPad: Output of assignment, expression and result in one line - How to create that function?

I'm trying to get Matlabs's MuPad as pretty and convenient as MathCad. Assume two variable assignments: x_a:=2*unit::mm; y_b:=5*unit::mm; and I want a prettyfied (typeset with Tex) output like z = x_a + y_b = 7 mm I already managed to do so by…
Robert Seifert
  • 25,078
  • 11
  • 68
  • 113