Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## maxima-bugs

 [Maxima-bugs] [ maxima-Bugs-2862208 ] specint(exp(-s*t)*t^n*bessel_j(1, t), t) is wrong From: SourceForge.net - 2009-09-19 15:34:43 ```Bugs item #2862208, was opened at 2009-09-19 17:34 Message generated for change (Tracker Item Submitted) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: specint(exp(-s*t)*t^n*bessel_j(1,t),t) is wrong Initial Comment: We have the remark in the testfile rtest14.mac that the Laplace transform of t^n*bessel_j(1,t) does not work for a general power n. These are the results: (%i3) assume(s>0)\$ (%i5) expr:specint(exp(-s*t)*t^n*bessel_j(1,t),t); Is n+2 positive, negative, or zero? p; (%o5) assoc_legendre_p(-n-1,-1,1/sqrt(1/s^2+1)) *gamma(n+2)*(1/s^2+1)^(-n/2-1/2)*s^(-n-1) The above result is wrong. We insert specific values for n and get: (%i6) expr,n=2; (%o6) 0 (%i7) expr,n=3; (%o7) 0 (%i8) expr,n=4; (%o8) 0 But we get the correct results if we do directly the integration for the specific values: (%i10) specint(exp(-s*t)*t^2*bessel_j(1,t),t); (%o10) 3/((1/s^2+1)^(5/2)*s^4) (%i11) specint(exp(-s*t)*t^3*bessel_j(1,t),t); (%o11) 12*(1/(1/s^2+1)^(5/2)-5/(4*(1/s^2+1)^(7/2)*s^2))/s^5 (%i12) specint(exp(-s*t)*t^4*bessel_j(1,t),t); (%o12) 60*(1/(1/s^2+1)^(7/2)-7/(4*(1/s^2+1)^(9/2)*s^2))/s^6 We have to different bugs which causes the problem: 1. In the routine lgf24 in hyp.lisp the first parameter of the Associated Legendre Polynom is wrongly calculated. We have (n (mul -1 (add a a m))) ; that is not 2*a-c The correct calculation would be (n (sub (add a a) c)) ; calculate 2*a-c 2. With the correction from above we get the correct expression with a wrong sign. The reason is that we have to calculate assoc_legendre_p(n,-1,x) which gives a wrong sign. See the bug report Bug ID: 2862197 "assoc_legendre_p(n,-1,x) wrong sign". Remark: The two test in rtesthyp.mac to test the algorithm of legf24 are wrong too. Dieter Kaiser ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-2862208 ] specint(exp(-s*t)*t^n*bessel_j(1, t), t) is wrong From: SourceForge.net - 2009-09-19 16:43:43 ```Bugs item #2862208, was opened at 2009-09-19 17:34 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: specint(exp(-s*t)*t^n*bessel_j(1,t),t) is wrong Initial Comment: We have the remark in the testfile rtest14.mac that the Laplace transform of t^n*bessel_j(1,t) does not work for a general power n. These are the results: (%i3) assume(s>0)\$ (%i5) expr:specint(exp(-s*t)*t^n*bessel_j(1,t),t); Is n+2 positive, negative, or zero? p; (%o5) assoc_legendre_p(-n-1,-1,1/sqrt(1/s^2+1)) *gamma(n+2)*(1/s^2+1)^(-n/2-1/2)*s^(-n-1) The above result is wrong. We insert specific values for n and get: (%i6) expr,n=2; (%o6) 0 (%i7) expr,n=3; (%o7) 0 (%i8) expr,n=4; (%o8) 0 But we get the correct results if we do directly the integration for the specific values: (%i10) specint(exp(-s*t)*t^2*bessel_j(1,t),t); (%o10) 3/((1/s^2+1)^(5/2)*s^4) (%i11) specint(exp(-s*t)*t^3*bessel_j(1,t),t); (%o11) 12*(1/(1/s^2+1)^(5/2)-5/(4*(1/s^2+1)^(7/2)*s^2))/s^5 (%i12) specint(exp(-s*t)*t^4*bessel_j(1,t),t); (%o12) 60*(1/(1/s^2+1)^(7/2)-7/(4*(1/s^2+1)^(9/2)*s^2))/s^6 We have to different bugs which causes the problem: 1. In the routine lgf24 in hyp.lisp the first parameter of the Associated Legendre Polynom is wrongly calculated. We have (n (mul -1 (add a a m))) ; that is not 2*a-c The correct calculation would be (n (sub (add a a) c)) ; calculate 2*a-c 2. With the correction from above we get the correct expression with a wrong sign. The reason is that we have to calculate assoc_legendre_p(n,-1,x) which gives a wrong sign. See the bug report Bug ID: 2862197 "assoc_legendre_p(n,-1,x) wrong sign". Remark: The two test in rtesthyp.mac to test the algorithm of legf24 are wrong too. Dieter Kaiser ---------------------------------------------------------------------- >Comment By: Dieter Kaiser (crategus) Date: 2009-09-19 18:43 Message: I think the answer of example 73 in rtest14.mac is wrong too. We can check it when we insert specific values: (%i6) expr:factor(ratsimp(specint(exp(-s*t)*t^u*bessel_j(v,t),t))); (%o6) (s^2+1)^(-u/2-1/2)*assoc_legendre_p(-u-1,-v,s/sqrt(s^2+1))*gamma(v+u+1) (%i7) expr,u=2,v=1; (%o7) 0 When we correct the code we get the expected result: (%i12) expr:factor(ratsimp(specint(exp(-s*t)*t^u*bessel_j(v,t),t))); (%o12) (s^2+1)^(-u/2-1/2)*assoc_legendre_p(u,-v,s/sqrt(s^2+1))*gamma(v+u+1) (%i13) expr,u=2,v=1; (%o13) 3*s*sqrt(1-s^2/(s^2+1))/(s^2+1)^2 Dieter Kaiser ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-2862208 ] specint(exp(-s*t)*t^n*bessel_j(1, t), t) is wrong From: SourceForge.net - 2009-09-19 23:36:36 ```Bugs item #2862208, was opened at 2009-09-19 17:34 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Integration Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: specint(exp(-s*t)*t^n*bessel_j(1,t),t) is wrong Initial Comment: We have the remark in the testfile rtest14.mac that the Laplace transform of t^n*bessel_j(1,t) does not work for a general power n. These are the results: (%i3) assume(s>0)\$ (%i5) expr:specint(exp(-s*t)*t^n*bessel_j(1,t),t); Is n+2 positive, negative, or zero? p; (%o5) assoc_legendre_p(-n-1,-1,1/sqrt(1/s^2+1)) *gamma(n+2)*(1/s^2+1)^(-n/2-1/2)*s^(-n-1) The above result is wrong. We insert specific values for n and get: (%i6) expr,n=2; (%o6) 0 (%i7) expr,n=3; (%o7) 0 (%i8) expr,n=4; (%o8) 0 But we get the correct results if we do directly the integration for the specific values: (%i10) specint(exp(-s*t)*t^2*bessel_j(1,t),t); (%o10) 3/((1/s^2+1)^(5/2)*s^4) (%i11) specint(exp(-s*t)*t^3*bessel_j(1,t),t); (%o11) 12*(1/(1/s^2+1)^(5/2)-5/(4*(1/s^2+1)^(7/2)*s^2))/s^5 (%i12) specint(exp(-s*t)*t^4*bessel_j(1,t),t); (%o12) 60*(1/(1/s^2+1)^(7/2)-7/(4*(1/s^2+1)^(9/2)*s^2))/s^6 We have to different bugs which causes the problem: 1. In the routine lgf24 in hyp.lisp the first parameter of the Associated Legendre Polynom is wrongly calculated. We have (n (mul -1 (add a a m))) ; that is not 2*a-c The correct calculation would be (n (sub (add a a) c)) ; calculate 2*a-c 2. With the correction from above we get the correct expression with a wrong sign. The reason is that we have to calculate assoc_legendre_p(n,-1,x) which gives a wrong sign. See the bug report Bug ID: 2862197 "assoc_legendre_p(n,-1,x) wrong sign". Remark: The two test in rtesthyp.mac to test the algorithm of legf24 are wrong too. Dieter Kaiser ---------------------------------------------------------------------- >Comment By: Dieter Kaiser (crategus) Date: 2009-09-20 01:36 Message: Fixed in hyp.lisp revision 1.106. Now we get the expected results for Laplace transforms of t^n*bessel_j(v,t) with more general parameters n and v. Closing this bug report as fixed. Dieter Kaiser ---------------------------------------------------------------------- Comment By: Dieter Kaiser (crategus) Date: 2009-09-19 18:43 Message: I think the answer of example 73 in rtest14.mac is wrong too. We can check it when we insert specific values: (%i6) expr:factor(ratsimp(specint(exp(-s*t)*t^u*bessel_j(v,t),t))); (%o6) (s^2+1)^(-u/2-1/2)*assoc_legendre_p(-u-1,-v,s/sqrt(s^2+1))*gamma(v+u+1) (%i7) expr,u=2,v=1; (%o7) 0 When we correct the code we get the expected result: (%i12) expr:factor(ratsimp(specint(exp(-s*t)*t^u*bessel_j(v,t),t))); (%o12) (s^2+1)^(-u/2-1/2)*assoc_legendre_p(u,-v,s/sqrt(s^2+1))*gamma(v+u+1) (%i13) expr,u=2,v=1; (%o13) 3*s*sqrt(1-s^2/(s^2+1))/(s^2+1)^2 Dieter Kaiser ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2862208&group_id=4933 ```