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

Obtain first significant digits of a number using variable-precision arithmetic

Assume you want to know the first W significant digits of a number, say pi, using vpa. Simply calling vpa with that many digits does not work. Consider the following example with W = 35: >> disp(vpa(sym('pi'),…
Luis Mendo
  • 110,752
  • 13
  • 76
  • 147
5
votes
2 answers

How to use z3 BitVec or Int as an array index?

I want to use a Int vector as an array index. python. array = [12,45,66,34] s= Solver() x = Int('x') s.add(array[x] == 66) so the x should be 2.. how can i do it?
pandaos
  • 51
  • 1
  • 3
5
votes
1 answer

SymPy "solves" a differential equation it shouldn't solve

Here's what I did: from sympy import * x = symbols("x") y = Function("y") dsolve(diff(y(x),x) - y(x)**x) The answer I get (SymPy 1.0) is: Eq(y(x), (C1 - x*(x - 1))**(1/(-x + 1))) But that's wrong. Both Mathematica and Maple can't solve this ODE. …
Frunobulax
  • 345
  • 2
  • 13
5
votes
3 answers

Analytic intersection between two cubic expressions

I am solving the analytic intersection of 2 cubic curves, whose parameters are defined in two separate functions in the below code. By plotting the curves, it can be easily seen that there is an intersection: zoomed version: However, the sym.solve…
DavidC.
  • 669
  • 8
  • 26
5
votes
1 answer

sympy laurent polynomial factor

I think there must be a simple answer to this, but I searched long and couldn't find it. Example: A simple Laurent Polynomial, so that >> p = 2*y*x**2+4*y/x A factorization gives >> factor(p) 2*y*(x**3 + 2)/x How do I extract the factor 2*y/x ? Is…
Felix
  • 51
  • 2
5
votes
1 answer

Maxima: how to replace variables in equations

I'm trying to write down some notes of my work. The way Maxima would simplify my work is that once I write bunch of equations and I want to change the definition of a variable, I do it and re-evaluate the entire file. Here is an example of what I'm…
guidout
  • 322
  • 1
  • 4
  • 13
5
votes
3 answers

SymPy and square roots of complex numbers

When using solve to compute the roots of a quadratic equation, SymPy returns expressions which could be simplified but I can't get it to simplify them. A minimal example looks like so: from sympy import * sqrt(-24-70*I) Here, SymPy just returns…
Frunobulax
  • 345
  • 2
  • 13
5
votes
0 answers

difficulties solving recursive integrals with sage

I have recently asked a question on math.stackexchange concerning how to compute volumes of intersecting hypercubes and hyperspheres to which I got an extremely helpful answer. Now, I'm trying to utilize sage to generate some analytic solution for…
carsten
  • 1,315
  • 2
  • 13
  • 27
5
votes
1 answer

simplifying and rearranging non-commutative variables in mathematica

In short, I have an expression that contains multiplications between p1, p2, q1 and q2, and I'd like to use [qi,pi]=ii*hb, where i={1,2} to get the expression to a symmetric form (pi^a*qi^b+qi^b*pi^a)/2. So for example, for p2*q2*p2^2 I get…
kirill_igum
  • 3,953
  • 5
  • 47
  • 73
5
votes
1 answer

How to set the size of a wxplot2d plot in a wxMaxima worksheet?

I'd like to set the size of a wxplot2d plot on a maxima worksheet to be smaller or larger than the default. How does one do this?
daj
  • 6,962
  • 9
  • 45
  • 79
5
votes
1 answer

Rewrite a symbolic expression in terms of a specific subexpression

I need to rewrite a symbolic expression in terms of a specific subexpression. Consider the following scenario: expression f with 2 variables a, b subexpression c = a / b syms a b c f = b / (a + b) % = 1 / (1 + a/b) = 1 / (1 + c) <- what I need Is…
Fugu_Fish
  • 131
  • 2
  • 10
5
votes
6 answers

Symbolic mathematical calculations in Clojure vs. F#

I have come across the following F# sample and found it intriguing. http://www.codeproject.com/KB/net-languages/SymbolicCalcInFS.aspx Does Clojure have language/library facilities for doing something like this with ease? It is ok to force Polish…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
5
votes
1 answer

Finding properties of a real function

Is there a way, using sympy, to figure out (some) properties of a function, thought of as a real function? For example, if >>> x = Symbol('x', real=True) >>> f = Lambda(x, sqrt((x-2)/(x+2))) then something like >>> f.domain() (-oo, -2) U [2,…
Bach
  • 6,145
  • 7
  • 36
  • 61
5
votes
1 answer

Decomposition of complex system using MATLAB

Consider the following system in complex symbolic form: % syms ix %// or % syms x %//? sys(ix) = ((10+(ix)))/((20+5(ix)+(10(ix))^2+(ix)^3)) Where ix = imaginary part Can MATLAB symbolically compute imag(sys(jx)) and real(sys(jx))?
salam
  • 229
  • 1
  • 4
5
votes
1 answer

Printing syms / matlabFunction slow

I am having a lot of trouble trying to make symbolic substitution go faster - that is, substituting in for variables in a symbolic expression and getting out a double. I am creating a complicated function f, and calculating its jacobian df. This…
user650261
  • 2,115
  • 5
  • 24
  • 47