How can I simplify this expression using "abs" function?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
8 comentarios
Walter Roberson
el 20 de Nov. de 2023
I think in the Wolfram output that the # stand in for the variable whose value has to be found to make the expression zero
Respuestas (2)
Star Strider
el 20 de Nov. de 2023
This seems to work —
syms n k
Expr = 7/6 * symsum((2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^3 - k)-(k*(k+1)*(2*k+1))/6, k, 1, n-1)
Expr = simplify(Expr, 500)
.
5 comentarios
Star Strider
el 20 de Nov. de 2023
Editada: Star Strider
el 20 de Nov. de 2023
Edited —
syms n k
Expr = symsum(abs((2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k)/6-(k*(k+1)*(2*k+1))/6), k, 1, n-1)
Expr = simplify(Expr, 400)
.
Torsten
el 20 de Nov. de 2023
Editada: Torsten
el 20 de Nov. de 2023
You must determine the value for k0 where the expression
2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1)
changes sign from positive to negative. Then you can add
1/6*(2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1))
from k = 1 to k = floor(k0) and add
-1/6*(2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1)))
from k = floor(k0)+1 to k = n-1.
syms n k
p = simplify(2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1))
s = solve(p,k,'MaxDegree',3)
result = simplify(1/6*symsum(2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1),k,1,floor(s(1)))-...
1/6*symsum(2*n^3 + 3*n^2 + n - 2*k^3 - 3*k^2 - k - k*(k+1)*(2*k+1),k,floor(s(1))+1,n-1))
subs(result,n,13)
k = 1:12;
n = 13;
expr = 1/6*abs(2*n^3 + 3*n^2 + n - 2*k.^3 - 3*k.^2 - k - k.*(k+1).*(2*k+1))
sum(expr)
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




