## maxima-bugs

 [Maxima-bugs] [ maxima-Bugs-2876387 ] ode2 asks if sqrt(3) is an integer From: SourceForge.net - 2009-10-10 23:30:41 ```Bugs item #2876387, was opened at 2009-10-11 10:30 Message generated for change (Tracker Item Submitted) made by billingd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&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: Share Libraries Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: David Billinghurst (billingd) Assigned to: David Billinghurst (billingd) Summary: ode2 asks if sqrt(3) is an integer Initial Comment: (%i1) ode2('diff(y,x,2)*x^2+'diff(y,x)*x+(x^2-3)*y=0,y,x); is sqrt(3) an integer? type y or n. n; (%o1) y = bessel_j(- sqrt(3), x) %k2 + bessel_j(sqrt(3), x) %k1 Reported by Robert Malik. I have had a look and this is actually a problem in the ode2() function. In share/diffequations/ode/ode2.mac we have: bessel2(a,b):=block([nu,b1,intp,radexpand:'all,%k1,%k2], if not(freeof(x,y,b1: ratsimp((1-b)*(x-pt)^2))) then return(false), if ratsimp(a*(x-pt)) # 1 then return(false), nu: sqrt(b1), method: 'bessel, if nu = 1/2 then return(y = (%k1*sin(x-pt) + %k2*cos(x-pt))/sqrt(x-pt)), if featurep(nu,'integer) then intp: 'y else if numberp(nu) then intp: 'n, loop, if not(intp='y or intp='n) then (intp: readonly("is", nu, "an integer? type y or n."), go(loop)), if intp = 'y then return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_y(nu,x-pt)), return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_j(-nu,x-pt)))\$ I thought that the askinteger() function might be part of the solution. However: (%i1) askinteger(sqrt(3)); Is sqrt(3) an integer? no; (%o1) no ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-2876387 ] ode2 asks if sqrt(3) is an integer From: SourceForge.net - 2009-10-11 00:41:18 ```Bugs item #2876387, was opened at 2009-10-11 10:30 Message generated for change (Comment added) made by billingd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&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: Share Libraries Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: David Billinghurst (billingd) Assigned to: David Billinghurst (billingd) Summary: ode2 asks if sqrt(3) is an integer Initial Comment: (%i1) ode2('diff(y,x,2)*x^2+'diff(y,x)*x+(x^2-3)*y=0,y,x); is sqrt(3) an integer? type y or n. n; (%o1) y = bessel_j(- sqrt(3), x) %k2 + bessel_j(sqrt(3), x) %k1 Reported by Robert Malik. I have had a look and this is actually a problem in the ode2() function. In share/diffequations/ode/ode2.mac we have: bessel2(a,b):=block([nu,b1,intp,radexpand:'all,%k1,%k2], if not(freeof(x,y,b1: ratsimp((1-b)*(x-pt)^2))) then return(false), if ratsimp(a*(x-pt)) # 1 then return(false), nu: sqrt(b1), method: 'bessel, if nu = 1/2 then return(y = (%k1*sin(x-pt) + %k2*cos(x-pt))/sqrt(x-pt)), if featurep(nu,'integer) then intp: 'y else if numberp(nu) then intp: 'n, loop, if not(intp='y or intp='n) then (intp: readonly("is", nu, "an integer? type y or n."), go(loop)), if intp = 'y then return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_y(nu,x-pt)), return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_j(-nu,x-pt)))\$ I thought that the askinteger() function might be part of the solution. However: (%i1) askinteger(sqrt(3)); Is sqrt(3) an integer? no; (%o1) no ---------------------------------------------------------------------- >Comment By: David Billinghurst (billingd) Date: 2009-10-11 11:41 Message: For DEs of the form x^2*'diff(y,x,2)+x*'diff(y,x)+(x^2-n^2)*y=0, we need to know if n is an integer. The existing code is weak and asks when n is a known constant such as %e, declared as noninteger or is a surd such as sqrt(3). We can fix some of these using the askinteger() function in function bessel2(). This is done in revision 1.4 of share/diffequations/ode2.mac. The original problem is not solved. We need to improve the askinteger() function. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-2876387 ] ode2 asks if sqrt(3) is an integer From: SourceForge.net - 2009-10-17 10:58:27 ```Bugs item #2876387, was opened at 2009-10-11 10:30 Message generated for change (Comment added) made by billingd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&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: Share Libraries Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: David Billinghurst (billingd) Assigned to: David Billinghurst (billingd) Summary: ode2 asks if sqrt(3) is an integer Initial Comment: (%i1) ode2('diff(y,x,2)*x^2+'diff(y,x)*x+(x^2-3)*y=0,y,x); is sqrt(3) an integer? type y or n. n; (%o1) y = bessel_j(- sqrt(3), x) %k2 + bessel_j(sqrt(3), x) %k1 Reported by Robert Malik. I have had a look and this is actually a problem in the ode2() function. In share/diffequations/ode/ode2.mac we have: bessel2(a,b):=block([nu,b1,intp,radexpand:'all,%k1,%k2], if not(freeof(x,y,b1: ratsimp((1-b)*(x-pt)^2))) then return(false), if ratsimp(a*(x-pt)) # 1 then return(false), nu: sqrt(b1), method: 'bessel, if nu = 1/2 then return(y = (%k1*sin(x-pt) + %k2*cos(x-pt))/sqrt(x-pt)), if featurep(nu,'integer) then intp: 'y else if numberp(nu) then intp: 'n, loop, if not(intp='y or intp='n) then (intp: readonly("is", nu, "an integer? type y or n."), go(loop)), if intp = 'y then return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_y(nu,x-pt)), return(y = %k1*bessel_j(nu,x-pt) + %k2*bessel_j(-nu,x-pt)))\$ I thought that the askinteger() function might be part of the solution. However: (%i1) askinteger(sqrt(3)); Is sqrt(3) an integer? no; (%o1) no ---------------------------------------------------------------------- >Comment By: David Billinghurst (billingd) Date: 2009-10-17 21:58 Message: The second stage of the fix is to extend the function nonintegerp, which is called by askinteger, to recognise that sqrt(n) is not an integer. This is done in revision 1.59 of compar.lisp. The ode in this report has been added to the testsuite in rtestode.mac. ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2009-10-17 21:58 Message: The reported bug is not present in the current cvs version of Maxima. Thank you for your report. If you see this bug in a later version of Maxima, please submit a new bug report. ---------------------------------------------------------------------- Comment By: David Billinghurst (billingd) Date: 2009-10-11 11:41 Message: For DEs of the form x^2*'diff(y,x,2)+x*'diff(y,x)+(x^2-n^2)*y=0, we need to know if n is an integer. The existing code is weak and asks when n is a known constant such as %e, declared as noninteger or is a surd such as sqrt(3). We can fix some of these using the askinteger() function in function bessel2(). This is done in revision 1.4 of share/diffequations/ode2.mac. The original problem is not solved. We need to improve the askinteger() function. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2876387&group_id=4933 ```