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
0
votes
1 answer

Is there a workaround to avoid SymPy hanging for high order trigonometic integrands?

I tried the following integral in SymPy 0.7.3: import sympy from sympy import cos, sin, pi sympy.var('x, L') sympy.var('i, k', integer=True) integrand = cos(pi*i*x/L)**2*cos(pi*k*x/L)**2*sin(pi*i*x/L)*sin(pi*k*x/L) print(sympy.integrate(integrand,…
Saullo G. P. Castro
  • 56,802
  • 26
  • 179
  • 234
0
votes
1 answer

Integrate a function in Matlab

I know this is a novice question, but I'm new at Matlab and am trying to integrate a function for n=0, n=1, etc.. This is my code so far: function x = t^n*(t+5)^-1 int(x,t=0..1) And I keep on getting this error: Error: File: a02_IX.m Line: 1…
zack
  • 101
  • 2
0
votes
2 answers

Matlab syms variable precision?

Just having some issues with variable precision in matlab.. I have the code: x = 0.1; syms y; S = solve(x+1==(1+y)/(1-y),y); y = double(S); val = abs(((2^2)*(y^2))/(2*(y-1)^2)) But val is always rounded off. I should be getting val = 0.0049999 but…
0
votes
1 answer

Solving nonlinear optimization equations with large errors

The variable y may take a value which is in a defined range: 3
Caniko
  • 867
  • 2
  • 11
  • 28
0
votes
2 answers

Solving nonlinear minimization equations symbolically in matlab

I have a large underdetermined equation system for which I search an unique solution in respect of any given constraints. I simplified my problem into the following one: x²-4=0, y²-9=0, x*y=myMin, x+y=myMin. What is the best way to implement this…
Caniko
  • 867
  • 2
  • 11
  • 28
0
votes
0 answers

Why symbolic variable usage takes time in matlab? How to remove it?

I have the following code. syms x y; % line 1 %solve them for the parabola equation A = [ x^2 x y 1 ;x0^2 x0 y0 1; x1^2 x1 y1 1; x2^2 x2 y2 1]; %line 2 S = solve(det(A),y); %line 3 (x1,y1), (x2,y2), (x3,y3) are integer coordinates. The line…
t0mkaka
  • 1,843
  • 2
  • 17
  • 21
0
votes
1 answer

Symbolic quadratic optimization with Maple

I'm trying to minimize a quadratic energy with linear equality constraints in Maple. Currently I'm issuing things like: with(Optimization): p := (t) -> c3*t^3 + c2*t^2; m :=…
Alec Jacobson
  • 6,032
  • 5
  • 51
  • 88
0
votes
1 answer

Convert symbolic Cartesian coordinates to spherical

Is there any way to do a symbolic transformation from Cartesian to spherical. I could do: x = r * sin(theta)*cos(phi) And so on, and then plug into an expression of x,y and z. Is there any easier command to do this?
yankeefan11
  • 485
  • 1
  • 6
  • 18
0
votes
0 answers

Matlab symbolic equation solver error "solve>char"

I'm trying to use the symbolic math toolbox in Matlab 2012b to get symbolic solutions to a set of equations. My code looks like: syms CPitch CRoll CYaw CX CY CZ syms VPitch VRoll VZ syms MPitch MRoll MZ Eqs = [ MPitch == cos(VRoll)*CPitch +…
ApockofFork
  • 487
  • 1
  • 4
  • 10
0
votes
2 answers

integrate cos(x)*cos(2x)*...*cos(mx) via SAGE

I'm going to find $I_m=\int_0^{2\pi} \prod_{k=1}^m cos(kx){}dx$, where $m=1,2,3\ldots$ Simple SAGE code: x=var('x') f = lambda m,x : prod([cos(k*x) for k in range(1,m+1)]) for m in range(1,15+1): print m, numerical_integral(f(m,x), 0,…
0
votes
2 answers

Mathematica: integrate symbolic vector function

I wrote a program that defines two piecewise functions "gradino[x_]" and "gradino1[x_]", where x is a vector of m components. I'm not able to write these functions explicitly using the x_i, I need to keep x as a vector. I need to measure the…
0
votes
4 answers

Generate sequence using previous terms sympy

I would like to generate a sequence such that the previously generated element was included in the next element, I am unsure how to do this. i.e generate the list such that its items were: where x is just a Sympy…
user124123
  • 1,642
  • 7
  • 30
  • 50
0
votes
2 answers

how to convert this solve answer to numeric in MATLAB

i solve symbolic equation: >> A=sym('[34618-150*w^2,-16502,0,0,0;-16502,31144-150*w^2,-14642,0,0;0,-14642,27018-150*w^2,-12376,0;0,0,-12376,22447-150*w^2,-10071;0,0,0,-10071,10071-150*w^2]') A = [ 34618-150*w^2, -16502, 0, …
0
votes
2 answers

Beautifying the output of Matlab aka human-readable form for output?

syms x y z; solve(x==y+1, y^2==z,z==9) ans = x: [2x1 sym] y: [2x1 sym] z: [2x1 sym] and now I want to see the results like Mathematica outputting {{x->-2,y->-3,z->9},{x->4,y->3,z->9}} for Solve[{x == y + 1, y^2 == z, z == 9}, {x, y, z}]. The…
hhh
  • 50,788
  • 62
  • 179
  • 282
0
votes
1 answer

Matlab: command check whether positive or negative sign before a term?

I am looking a command that would do: a*b*c -----> + -a --------> - a*b -------> + c*d*e*f*a--> + where a, b, c, d, e and f are symbolic variables in Matlab. Is there any command to return the initial sign of an expression?
hhh
  • 50,788
  • 62
  • 179
  • 282