From: SourceForge.net <noreply@so...>  20031118 16:25:25

Bugs item #844521, was opened at 20031118 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 nonconstant 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]); Nonsquare 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 nondegenerate 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)^k1)*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 