How to simplify infinite double matrix summation in Matlab.
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hilal Ahmad Bhat
el 2 de Mzo. de 2024
I need to calculate the following sum:
I used the following code:
beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1];
syms k l t
f = ((-A).^k./factorial(k)).*((factorial(k+l).*(-R).^l)/gamma((2-beta).*l...
+ 2.*k + 2)).*((t.^((2-beta).*l+2.*k+1))/factorial(l));
F = vpasum(vpasum(f,k,0,inf),l,0,inf);
G = subs(F,t,1)
This yields G as a symbolic sum but I need it as numeric sum. I tried it using symsum function but that too yields a symbolic answer. Using, subs function for t=1 won't change it into a numeric value. Any help would be highly appriciated.
5 comentarios
Walter Roberson
el 2 de Mzo. de 2024
(-R).^l
I suspect that is
(-R)^l
and
(-A).^k
I suspect that is
(-A)^k
Respuesta aceptada
Walter Roberson
el 3 de Mzo. de 2024
Movida: Walter Roberson
el 3 de Mzo. de 2024
beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1];
syms k l t
f = ((-A)^k./factorial(k)).*((factorial(k+l).*(-R)^l)/gamma((2-beta).*l...
+ 2.*k + 2)).*((t.^((2-beta).*l+2.*k+1))/factorial(l));
F = symsum(symsum(f,k,0,inf),l,0,inf);
G = subs(F,t,1)
vpa(G)
6 comentarios
Torsten
el 5 de Mzo. de 2024
Editada: Torsten
el 5 de Mzo. de 2024
beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1]; t = 1;
mat = zeros(2);
mat_inner = Inf(2);
tol = 1e-6;
s1 = 0;
while norm(mat_inner,'fro') > tol
mat_inner = zeros(2);
for s2 = 0:s1
mat_inner = mat_inner + f(s1-s2,s2,beta,A,R,t);
end
mat = mat + mat_inner;
s1 = s1 + 1;
end
s1
format long
mat
function mat = f(k,l,beta,A,R,t)
mat = (-1)^(k+l)*A^k/factorial(k)*R^l/factorial(l)*factorial(k+l)...
*t^((2-beta)*l+2*k+1)/gamma((2-beta)*l+2*k+2);
end
Más respuestas (1)
Torsten
el 2 de Mzo. de 2024
Editada: Torsten
el 2 de Mzo. de 2024
Are you sure that the matrix potentials for A and R are meant elementwise ?
beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1]; t = 1;
N = 50;
M = N;
mat = zeros(2);
for s1 = 0:N
for s2 = 0:M
mat = mat + f(s1,s2,beta,A,R,t);
end
end
mat
function mat = f(k,l,beta,A,R,t)
mat = (-A).^k/factorial(k).*(-R).^l/factorial(l)*factorial(k+l)...
*t^((2-beta)*l+2*k+1)/gamma((2-beta)*l+2*k+2);
end
3 comentarios
Torsten
el 3 de Mzo. de 2024
Editada: Torsten
el 3 de Mzo. de 2024
I doubt you will find an analytical expression for your double sum - that's what summing up to infinity would mean. Thus you will have to compute the sum numerically.
Infinite sums are numerically evaluated by building finite sums up to an index N until the result changes only neclectably if N is increased.
That's what I did.
If you meant usual matrix multiplication, replace
function mat = f(k,l,beta,A,R,t)
mat = (-A).^k/factorial(k).*(-R).^l/factorial(l)*factorial(k+l)...
*t^((2-beta)*l+2*k+1)/gamma((2-beta)*l+2*k+2);
end
by
function mat = f(k,l,beta,A,R,t)
mat = (-A)^k/factorial(k)*(-R)^l/factorial(l)*factorial(k+l)...
*t^((2-beta)*l+2*k+1)/gamma((2-beta)*l+2*k+2);
end
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!