I would like to do this double summation . where alpha=2; beta=1.5;
I am confuse about the command availbale in online .Pl somebody help me what is way of solving this summation.

1 commentaire

Walter Roberson
Walter Roberson le 5 Mar 2020
Because you used addition here where the original question used multiplication.

Connectez-vous pour commenter.

 Réponse acceptée

Mohammad Sami
Mohammad Sami le 5 Mar 2020

1 vote

You can define a function to calculate the expression inside the brackets.
a = @(p,param)param.^p./factorial(p); % (param^n)/factorial(n)
% param is alpha or beta, p = n or m
sum(sum(a(0:10,2)' * a(0:15,1.5)))

11 commentaires

AVM
AVM le 5 Mar 2020
Thanks. Then shall I have to do it separtely? and then multiply the two things?
AVM
AVM le 5 Mar 2020
Pl give the complete coding if possible.
AVM
AVM le 5 Mar 2020
clc;
clear;
syms n m
alpha=2;
beta=2;
f=@(n,m)(alpha.^n)+(beta.^m);
symsum(symsum(f,n,0,3),m,0,3)
Why this coding gives the result 120 insted of 30. Pl help me.
Mohammad Sami
Mohammad Sami le 5 Mar 2020
This is missing the factorial in the divisor.
Mohammad Sami
Mohammad Sami le 5 Mar 2020
Its already complete. I just put the multiplication and sum in one line
I think 120 is the correct answer.
a = @(p,param)param.^p; % (param^n)/factorial(n)
% param is alpha or beta, p = n or m
sum(sum(a(0:3,2)' + a(0:3,2)))
I don't have the symbolic toolbox myself so can't test it.
AVM
AVM le 5 Mar 2020
@sami: Thanks. Actually I was wrong. I have done a mistake in analytic calcualtion. It's working.
AVM
AVM le 5 Mar 2020
Modifié(e) : AVM le 5 Mar 2020
@Sami: I am trying to solve the following case according to your code of my previous problem, I am little bit confuse how to handle it. Pl help me.
clc;
clear;
syms alpha r1 theta mu nu lambda t n1 m1 theta2
r2=1.0;
theta2=2.0;
alpha1=0.5;
alpha2=1.0;
lambda=2.0;
omega=1;
phi=pi/3;
mu=cosh(r2);
nu=exp(1i*theta2).*sinh(r2);
f=((((alpha1.*exp(-1i*omega*t))*r1.*exp(-1i*theta)).^(n1))*(((alpha1.*exp(1i*omega*t))*r1.*exp(1i*theta)).^(m1))./(factorial(m1).*factorial(n1))).*...
1./sqrt((((mu).^2)-((abs(nu)).^2).*exp(-2*1i*lambda*t*(n1-m1)))).*...
exp(((1./mu).*exp(-2*1i*lambda*t*(n1-m1)).*real(((alpha2).^2)*conj(nu))+((alpha2).^2).*(exp(-1i*lambda*t*(n1-m1))))./...
(((mu).^2)-((abs(nu)).^2).*exp(-2*1i*lambda*t*(n1-m1))));
Now I would like to evaluate this double summation fucntion 'f' over n1 and m1 from 0 to 20 each of them. Pl help me to do that
I believe you should be able to solve this with the symbolic toolbox. I dont have the toolbox to check if it works.
Similar to what you posted earlier. Since only m1, n1 and t don't have a fixed value, only declare those as symbols.
Declare f as a function.
% your ealier post.
syms n m
alpha=2;
beta=2;
f=@(n,m)(alpha.^n)+(beta.^m);
symsum(symsum(f,n,0,3),m,0,3)
for the current question
syms n1 m1 t
r2=1.0;
theta2=2.0;
alpha1=0.5;
alpha2=1.0;
lambda=2.0;
omega=1;
phi=pi/3;
mu=cosh(r2);
nu=exp(1i*theta2).*sinh(r2);
f=@(n1,m1)((((alpha1.*exp(-1i*omega*t))*r1.*exp(-1i*theta)).^(n1))*(((alpha1.*exp(1i*omega*t))*r1.*exp(1i*theta)).^(m1))./(factorial(m1).*factorial(n1))).*...
1./sqrt((((mu).^2)-((abs(nu)).^2).*exp(-2*1i*lambda*t*(n1-m1)))).*...
exp(((1./mu).*exp(-2*1i*lambda*t*(n1-m1)).*real(((alpha2).^2)*conj(nu))+((alpha2).^2).*(exp(-1i*lambda*t*(n1-m1))))./...
(((mu).^2)-((abs(nu)).^2).*exp(-2*1i*lambda*t*(n1-m1))));
symsum(symsum(f,n1,0,20),m1,0,20)
Atrolita afra
Atrolita afra le 29 Mar 2020
can you please help me to plot this equation?
Atrolita afra
Atrolita afra le 29 Mar 2020
other information and the figure is here

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by