Questions tagged [simplification]
249 questions
1
vote
1 answer
Is there a way to add my own identities to simplify a system of polynomial equations in sympy?
I have the following identity:
1 = a + b + c
Supose that I have the expression:
expr = x*(a + b + c)
It can be simplified as x.
Is there a way to declare it to SymPy so it can simplify them? Actually I do the job mannualy:
>>> import sympy
>>>…

Alan Cristhian
- 614
- 7
- 8
1
vote
4 answers
Determining complex security and permissions
I've been put on a project that has a messy class that writes buttons to a page. The app is a document manager and has a popup list of buttons, such as download, email, and print. Depending on the user's roles, and the state of the document,…

MrGrigg
- 1,732
- 2
- 21
- 26
1
vote
1 answer
Java simplifying a repetitive code snippet to a function within ActionListener
I am wondering what is an elegant and effective way of simplifying the following snippet of code. Since I have many more buttons and their mechanics all behave in the same way, the symmetry of the methods, and the alternation from color.green ->…

hexaquark
- 883
- 4
- 16
1
vote
2 answers
Sympy `factor` and `simplify` not working properly?
Since I am working on a project involving square roots, I need square roots to be simplified to the max. However, some square roots expressions do not produce the disired result. Please consider checking this example:
>>> from sympy import * # just…

Amin Guermazi
- 1,632
- 9
- 19
1
vote
1 answer
Sympy simplification is broken (square roots)?
I tried this in python shell
>>> from sympy import sqrt
>>> sqrt((-9/10 + 6*sqrt(3)/5)**2 + (6/5 + 9*sqrt(3)/10)**2)
sqrt((-0.9 + 6*sqrt(3)/5)**2 + (1.2 + 9*sqrt(3)/10)**2)
and when type it in google:
So how do I get numpy to give me a more…

Amin Guermazi
- 1,632
- 9
- 19
1
vote
0 answers
Image Processing: Quantifying roughness of a shape compared to a smooth shape
I am trying to find the roughness of shapes in an image. I have found the contours and used simplification.cutil.simplify_coords_vwp(contour,1000) to calculate a polygon that I want to use as the "smooth" shape (this is similar to the more commonly…

Cameron Greenwalt
- 47
- 8
1
vote
1 answer
Symbolic Algebraic Simplifier
I'm trying to solve this equation for x (or y). Is there some way to do it in Matlab? The "simplify" function (even with "steps",100,"All", true) doesn't do it.
-k+Sqrt[x^2+y^2]+Sqrt[(x-ax)^2+y^2]+Sqrt[(x-bx)^2+(y-by)^2]

dsa42
- 55
- 4
1
vote
1 answer
SymPy with advanced rewrite and simplification
For instance, I want to expand the following simultaneous equations in first order difference with respect to x, y and z1:
$$x^\alpha y^(1-\alpha) = z_1$$
$$x^\beta y^(1-\beta) = z_2$$
It is obviously that
$$\alpha \hat{x} + (1-\alpha) \hat{y} =…

Econometrica
- 11
- 2
1
vote
2 answers
Turning Map("a" -> 2, "b" -> 1) into seq("a","a","b") using map
I am trying to turn a Map("a" -> 2, "b" -> 1) into seq("a","a","b") through the map function, Currently I am trying to run the code below giving me the desired result.
Is there a smarter way to do this? Possibly a better way through the map…

ChakirBelhaj
- 295
- 2
- 12
1
vote
1 answer
Maxima. Function of independent variables as a factor
Is there a function that selects a function of independent variables as a factor?
For example, if you write:
'integrate(2*y*x^2, x);
you will get:
2*y*'integrate(x^2, x);
Like that, only without an integral?:
[2*y, x^2]

Ramzan Altair
- 97
- 7
1
vote
0 answers
Simplifying this complicated Mathematica result using known definitions
While solving a boundary value problem, I reached the following expression for a Fourier constant (CC01) after simplification using Simplify. The expression is still huge. Is there any way to simplify this further in Mathematica using some…

Avrana
- 111
- 4
1
vote
1 answer
Mesh simplification for multi layers
There is a landscape in my game, it consists of several layers(each is a separate mesh), now i want to do mesh simplification to the whole layers, but I found there is many intersections between different layers after apply simplification in the…

Su Tongkui
- 31
- 1
- 4
1
vote
1 answer
F# Units of Measure doesn't simplify
Assume such measures are defined:
[] type kilogram
[] type kg = kilogram
[] type s
When I define a binding like this:
let x = 1. // Type of x: float
F# correctly simplifies type of x from…

Avestura
- 1,438
- 14
- 24
1
vote
1 answer
Stanford CoreNLP find homogeneous parts of sentence
I'm trying to build sentence simplification algorithm based on Stanford CoreNLP. One of simplification I want to do - transform sentence with homogeneous parts of sentence to several sentences.
E.g.
I love my mom, dad and sister. -> I love my mom.…

Danila Zharenkov
- 1,720
- 1
- 15
- 27
1
vote
0 answers
sympy matrix to explicit sum and back (to matrix notation)
I am working in sympy with symbolic matrices.
Once made explicit I can not return to implicit representations.
I tried to work something out with the pair of .as_explicit() and MatrixExpr.from_index_summation(expr)
But the latter seems to expect an…

0-_-0
- 1,313
- 15
- 15