필터 지우기
필터 지우기

Sum of series with differentaition

조회 수: 4 (최근 30일)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019년 2월 5일
댓글: Walter Roberson 2019년 2월 6일
%% I am try to sum a series with respect to k, where function f has 2*k-1 times derivative too. As below program i am using and then error occured.
sysms k t
f = zeta(2*k)*(4^k-2)/4^k*diff(t^(-1/2),t,2*k-1)
pretty(f)
F = symsum(f,k,1,10)
%% I am facing error as
%%Error using sym/diff (line 71)
%%The second and third arguments must either be variables or a variable and a nonnegative integer specifying the number of differentiations.
%%Error in main (line 13)
%%f = zeta(2*k)*(4^k-2)/4^k*diff(t^(-1/2),t,2*k-1)

답변 (1개)

John D'Errico
John D'Errico 2019년 2월 5일
There is no reason to use symsum on this.
syms t
f = sym(0);
for k = 1:10
f = f + zeta(2*k).*(4.^k-2)/4.^k*diff(t^(-1/2),t,2*k-1);
end
vpa(f,5)
ans =
- 0.41123/t^(3/2) - 1.7757/t^(7/2) - 29.105/t^(11/2) - 1051.8/t^(15/2) - 67239.0/t^(19/2) - 6.7119e6/t^(23/2) - 9.6501e8/t^(27/2) - 1.8891e11/t^(31/2) - 4.8314e13/t^(35/2) - 1.5642e16/t^(39/2)
diff cannot handle a sumbolic order of dfferentiation anyway, so a simple loop is entirely adequate.
  댓글 수: 3
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019년 2월 6일
%% when i am trying this
syms y a t Q
FT = sym(0 );
y= a/t
for k = 1:5
FT = FT + zeta(2*k).*(4.^k-2)/4.^k*diff(y^(-1/2),y,2*k-1 );
end
vpa(FT,5 )
chi=(y^(1/2)+FT)*t^(1/2)/Q;
vpa(chi,3)
%%Then I found the error as
%%Error using sym/diff (line 71)
%%The second and third arguments must either be variables or a variable and a nonnegative integer specifying the number of differentiations.
%%Error in Im_Xi (line 6)
%%FT = FT + zeta(2*k).*(4.^k-2)/4.^k*diff(y^(-1/2),y,2*k-1 );
Walter Roberson
Walter Roberson 2019년 2월 6일
your y is an expression not a variable . you cannot differentiate with respect to an expression

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

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by