I have some long equations, such as:
θ = -(Tq - Lα CLβ_1- CLβ_2 LTδ - Cβ_1 q- Cβ_2 q Lαρ Lαδ - Tqy - αρq - αqy 2αρqy 2CLβ_1^2 q 2CLβ_2^2 q- 2CLβ_1 δ- 3LTβ_1 q- LTβ_2 q Lαβ_1 q Lαβ_2 q- 2Lαρδ 2Cβ_1 qy 4CLβ_1 β_2 q 2Lαβ_1 ρq)/(2δ 2y 2Lβ_1- Tq - 2δy - δ^2- y^2- LT 4β_1^2 qy 2β_2^2 qy- 6Lβ_1 δ- 2Lβ_2 δ- 2β_1 qy- 2β_2 qy 4Lβ_1^2 δ 2Lβ_2^2 δ Lβ_1^2 q Lβ_2^2 q 4LTβ_1 q 2LTβ_2 q 2Lβ_1 β_2 q- 1)
I want to factorize these equations, How I can do it? can it be possible for the task in either MATLAB or other software?
CodePudding user response:
First up: MATLAB can't handle Greek letters, so you'll have to use different variable names.
Yes, you can factor this with MATLAB, provided you have the Symbolic Toolbox. Use factor(), check its documentation for examples on usage.
CodePudding user response:
I'd recommend the free and open source CAS Maxima:
which has a factor and ratsimp command. Ideally you'd use ASCII characters though, so here is just an example of how that would work:
expr: x^2 - y^2;
print(factor(expr));
