## [Maxima-bugs] [ maxima-Bugs-844521 ] differ.mac has many bugs

 [Maxima-bugs] [ maxima-Bugs-844521 ] differ.mac has many bugs From: SourceForge.net - 2003-11-18 16:25:25 ```Bugs item #844521, was opened at 2003-11-18 10:25 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barton Willis (willisbl) Assigned to: Nobody/Anonymous (nobody) Summary: differ.mac has many bugs Initial Comment: differ.mac solves finite difference equations; it has many bugs. And I can't find any user documentation for it either. Specifically It redefines the functions system and eigenvalues (C1) load("differ.mac"); Warning - you are redefining the MACSYMA function EIGENVALUES Warning - you are redefining the MACSYMA function SYSTEM (D1) C:/maxima/Maxima/share/maxima/5.9.0/share/algebra/diff er.mac (C2) display2d : false; (D2) FALSE It solves this one correctly (C3) difference(x[k+1] = x[k] / 5, x[k]); (D3) x[k] = x[0]/5^k But make the equation nonhomogeneous and the solution is wrong (C4) difference(x[k+1] = x[k] / 5 + 1, x[k]); (D4) x[k] = 0 <=== BOGUS I don't think differ.mac can solve non-constant coefficient equations, but it doesn't check that the coefficients are constant (C5) difference(x[k+1] = k * x[k], x[k]); (D5) x[k] = x[0]*k^k <=== BOGUS It can't solve this degenerate equation (C6) difference(x[k+2] + 2 * x[k+1] + x[k], x[k]); Non-square matrix in inverse #0: SYSTEM(eqnlist=[x[k+1] = -(x[k+2]+x[k])/2,x[k+1] = x[k+1]],varlist=[x[k+1],x[k]])(differ.mac line 91) #1: second_order_difference(eqn=x[k+1] = -(x[k+2]+x [k])/2,var=x[k])(differ.mac line 73) #2: difference(eqn=x[k+2]+2*x[k+1]+x[k],var=x[k]) (differ.mac line 113) -- an error. Quitting. To debug this try DEBUGMODE (TRUE);) But the non-degenerate equation is okay (C7) difference(x[k+2] + 8 * x[k+1] + x[k], x[k]); (D7) x[k] = (-SQRT(15)-4)^k*(SQRT(15)-4)*((SQRT(15) + .... differ.mac doesn't check that the equation is linear and may give an incorrect solution when it is (C12) difference(x[k+1] - x[k]^2 + x[k] = 0,x[k]); (D12) x[k] = x[0]*(-1)^k-((-1)^k-1)*x[k]^2/2 <== BOGUS Bugs in differ.mac are far too easy to find. I haven't tried recur.mac; maybe it is somewhat better? Barton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&group_id=4933 ```

 [Maxima-bugs] [ maxima-Bugs-844521 ] differ.mac has many bugs From: SourceForge.net - 2003-11-18 16:25:25 ```Bugs item #844521, was opened at 2003-11-18 10:25 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barton Willis (willisbl) Assigned to: Nobody/Anonymous (nobody) Summary: differ.mac has many bugs Initial Comment: differ.mac solves finite difference equations; it has many bugs. And I can't find any user documentation for it either. Specifically It redefines the functions system and eigenvalues (C1) load("differ.mac"); Warning - you are redefining the MACSYMA function EIGENVALUES Warning - you are redefining the MACSYMA function SYSTEM (D1) C:/maxima/Maxima/share/maxima/5.9.0/share/algebra/diff er.mac (C2) display2d : false; (D2) FALSE It solves this one correctly (C3) difference(x[k+1] = x[k] / 5, x[k]); (D3) x[k] = x[0]/5^k But make the equation nonhomogeneous and the solution is wrong (C4) difference(x[k+1] = x[k] / 5 + 1, x[k]); (D4) x[k] = 0 <=== BOGUS I don't think differ.mac can solve non-constant coefficient equations, but it doesn't check that the coefficients are constant (C5) difference(x[k+1] = k * x[k], x[k]); (D5) x[k] = x[0]*k^k <=== BOGUS It can't solve this degenerate equation (C6) difference(x[k+2] + 2 * x[k+1] + x[k], x[k]); Non-square matrix in inverse #0: SYSTEM(eqnlist=[x[k+1] = -(x[k+2]+x[k])/2,x[k+1] = x[k+1]],varlist=[x[k+1],x[k]])(differ.mac line 91) #1: second_order_difference(eqn=x[k+1] = -(x[k+2]+x [k])/2,var=x[k])(differ.mac line 73) #2: difference(eqn=x[k+2]+2*x[k+1]+x[k],var=x[k]) (differ.mac line 113) -- an error. Quitting. To debug this try DEBUGMODE (TRUE);) But the non-degenerate equation is okay (C7) difference(x[k+2] + 8 * x[k+1] + x[k], x[k]); (D7) x[k] = (-SQRT(15)-4)^k*(SQRT(15)-4)*((SQRT(15) + .... differ.mac doesn't check that the equation is linear and may give an incorrect solution when it is (C12) difference(x[k+1] - x[k]^2 + x[k] = 0,x[k]); (D12) x[k] = x[0]*(-1)^k-((-1)^k-1)*x[k]^2/2 <== BOGUS Bugs in differ.mac are far too easy to find. I haven't tried recur.mac; maybe it is somewhat better? Barton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&group_id=4933 ```
 [Maxima-bugs] [ maxima-Bugs-844521 ] differ.mac has many bugs From: SourceForge.net - 2006-07-13 05:59:38 ```Bugs item #844521, was opened at 2003-11-18 09:25 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&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 Submitted By: Barton Willis (willisbl) Assigned to: Nobody/Anonymous (nobody) Summary: differ.mac has many bugs Initial Comment: differ.mac solves finite difference equations; it has many bugs. And I can't find any user documentation for it either. Specifically It redefines the functions system and eigenvalues (C1) load("differ.mac"); Warning - you are redefining the MACSYMA function EIGENVALUES Warning - you are redefining the MACSYMA function SYSTEM (D1) C:/maxima/Maxima/share/maxima/5.9.0/share/algebra/diff er.mac (C2) display2d : false; (D2) FALSE It solves this one correctly (C3) difference(x[k+1] = x[k] / 5, x[k]); (D3) x[k] = x[0]/5^k But make the equation nonhomogeneous and the solution is wrong (C4) difference(x[k+1] = x[k] / 5 + 1, x[k]); (D4) x[k] = 0 <=== BOGUS I don't think differ.mac can solve non-constant coefficient equations, but it doesn't check that the coefficients are constant (C5) difference(x[k+1] = k * x[k], x[k]); (D5) x[k] = x[0]*k^k <=== BOGUS It can't solve this degenerate equation (C6) difference(x[k+2] + 2 * x[k+1] + x[k], x[k]); Non-square matrix in inverse #0: SYSTEM(eqnlist=[x[k+1] = -(x[k+2]+x[k])/2,x[k+1] = x[k+1]],varlist=[x[k+1],x[k]])(differ.mac line 91) #1: second_order_difference(eqn=x[k+1] = -(x[k+2]+x [k])/2,var=x[k])(differ.mac line 73) #2: difference(eqn=x[k+2]+2*x[k+1]+x[k],var=x[k]) (differ.mac line 113) -- an error. Quitting. To debug this try DEBUGMODE (TRUE);) But the non-degenerate equation is okay (C7) difference(x[k+2] + 8 * x[k+1] + x[k], x[k]); (D7) x[k] = (-SQRT(15)-4)^k*(SQRT(15)-4)*((SQRT(15) + .... differ.mac doesn't check that the equation is linear and may give an incorrect solution when it is (C12) difference(x[k+1] - x[k]^2 + x[k] = 0,x[k]); (D12) x[k] = x[0]*(-1)^k-((-1)^k-1)*x[k]^2/2 <== BOGUS Bugs in differ.mac are far too easy to find. I haven't tried recur.mac; maybe it is somewhat better? Barton ---------------------------------------------------------------------- >Comment By: Robert Dodier (robert_dodier) Date: 2006-07-12 23:59 Message: Logged In: YES user_id=501686 differ package is superseded by solve_rec, which returns valid results (to the best of my knowledge) for the bug examples shown in this report. Also, the solve_rec package is documented. I've moved differ.mac and differ.dem to archive/share/trash/. Closing this report as fixed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=844521&group_id=4933 ```