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

Walter Roberson
Walter Roberson 2020년 3월 5일
Because you used addition here where the original question used multiplication.

댓글을 달려면 로그인하십시오.

 채택된 답변

Mohammad Sami
Mohammad Sami 2020년 3월 5일

1 개 추천

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

AVM
AVM 2020년 3월 5일
Thanks. Then shall I have to do it separtely? and then multiply the two things?
AVM
AVM 2020년 3월 5일
Pl give the complete coding if possible.
AVM
AVM 2020년 3월 5일
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 2020년 3월 5일
This is missing the factorial in the divisor.
Mohammad Sami
Mohammad Sami 2020년 3월 5일
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 2020년 3월 5일
@sami: Thanks. Actually I was wrong. I have done a mistake in analytic calcualtion. It's working.
AVM
AVM 2020년 3월 5일
편집: AVM 2020년 3월 5일
@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 2020년 3월 29일
can you please help me to plot this equation?
Atrolita afra
Atrolita afra 2020년 3월 29일
other information and the figure is here

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

질문:

AVM
2020년 3월 5일

댓글:

2020년 3월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by