symsum equation not matching
2 ビュー (過去 30 日間)
古いコメントを表示
I am solving an equation to get the result in terms of symbol 'SI'. This is the given equation
but answer in terms of SI i am getting is not correct. I have used following code:
A=symsum( 2*m/( SI*SI*(NI-SI+1 )),m,1,SI/2 ) + symsum( 1/ ( SI*SI*(NI-SI+1 )),m,SI/2+1,SI )
which becomes
A = 1/(2*SI*(NI - SI + 1)) + (SI + 2)/(4*SI*(NI - SI + 1))
solving for SI with A=0 gives result as
ans =
root(z^3 - (z^2*(2*NI + 2))/2 - z/2 - 1, z, 1)
root(z^3 - (z^2*(2*NI + 2))/2 - z/2 - 1, z, 2)
root(z^3 - (z^2*(2*NI + 2))/2 - z/2 - 1, z, 3)
when i use vpa(ans), i get 3 equations with long terms (without z) but still answers does not match the given result shown below in diagram (NI is substituted by SL/u in the document so in square root term is actually (2/3)*NI-11/36
Any help will be highly appreciated.
0 件のコメント
採用された回答
Walter Roberson
2018 年 3 月 24 日
編集済み: Walter Roberson
2018 年 3 月 24 日
No, the SI you give is not a solution to that summation being 0.
2/(SI^2*(NI-SI+1)) is independent of m, so the first term of A is
2/(SI^2*(NI-SI+1)) * Sum(m, m=1..SI/2)
Sum(m, m=1..SI/2) for positive SI is ((SI/2)+1)*(SI/2)/2 . So you can calculate the first term as 2/(SI^2*(NI-SI+1)) * ((SI/2)+1)*(SI/2)/2 which works out as (SI+2)/(4*SI*(NI-SI+1))
1/(SI*(NI-SI+1)) is independent of m, so the second term of A is
1/(SI*(NI-SI+1)) * Sum(1, m=SI/2+1..SI)
which is 1/(SI*(NI-SI+1)) * (SI - (SI/2+1) + 1) = 1/(SI*(NI-SI+1)) * SI/2 which works out as 1/(2*(NI-SI+1))
so A = (SI+2)/(4*SI*(NI-SI+1)) + 1/(2*(NI-SI+1)) which works out as
A = (3*SI+2)/(4*SI*(NI-SI+1))
Note: this assumes that SI/2 is a positive integer! If it is not then the summation bounds need to be more carefully defined!
Now, for (3*SI+2)/(4*SI*(NI-SI+1)) to be 0, the numerator must be 0, which requires that 3*SI+2 is 0, which would require that SI = -2/3.
SI = -2/3 violates the assumption that SI/2 is a positive integer.
Therefore there is no solution for A = 0 -- not unless you very carefully define what it means to sum with non-integer boundaries or what it means to sum from 1 to a negative number in the bounds.
Exception: if NI is infinite but SI is finite then A can be 0.
4 件のコメント
Walter Roberson
2018 年 3 月 25 日
To minimize, take
A = (3*SI+2)/(4*SI*(NI-SI+1))
and differentiate with respect to A, equate to 0 and solve for SI.
You get the two possibilities,
SI = -2/3+(1/3)*sqrt(10+6*NI)
SI = -2/3-(1/3)*sqrt(10+6*NI)
the second of those cannot be a positive integer as required, so concentrate on the first one.
With some work you can show that SI is an integer under the case that NI = 6*P^2+4*P-1 for some positive integer P -- in which case SI = 2*P, which also satisfies the condition that SI/2 is a positive integer as required for the summations to be correctly defined.
The value at the minima is A = 1/(8*P^2)
For the situation where NI is not 6*P^2+4*P-1 for some positive integer P then I think SI would have to be in the range ceil(-2/3+(1/3)*sqrt(10+6*NI) - 2) to floor(-2/3+(1/3)*sqrt(10+6*NI) + 2) .
This value of SI is not the one from the formula you show.
If we examine the formula you are given,
SI = sqrt(2/3*NI-11/36)-1/6
and as before we say that SI must be an even integer so that SI/2 is integer so that the bounds of summation SI/2 and SI/2+1 are clearly defined; then let SI = 2 * p for some integer p, and then
solve(sqrt(2/3*NI-11/36)-1/6 = 2*p, NI)
This gives NI = 6*p^2+p+1/2
which is never an integer for any integer p. Though to be fair, nothing in the problem statement requires that NI is an integer.
If we substitute these values into A we get
A = (3*p+1)/(24*p^3-4*p^2+6*p)
for large p this approaches 1/(8*p^2), the value I found earlier. None the less, my analysis suggests that the formula you gave is not correct.
So a question to ask here is whether NI is expected to be integer, or if it is expected to be 1/2 greater than an integer.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!