home *** CD-ROM | disk | FTP | other *** search
- "File: RECUREQN.MTH (c) 01/07/1990 Soft Warehouse Inc."
-
- " Methods for solving recurrence relations."
-
- "METHODS FOR 1ST-ORDER RECURRENCE RELATIONS:"
-
- "Soln to linear 1st-order difference eqn y(x+1)=p(x)y(x)+q(x), y(x0)=y0:"
-
- LIN1_DIFFERENCE(px,qx,x,x0,y0):=PRODUCT(px,x,x0,x-1)*(y0+SUM(qx/PRODUCT(px,x,x~
- 0,x),x,x0,x-1))
-
- "Returns soln to y(k x) = p(x) y(x) + q(x), y(x0)=y0:"
-
- GEOMETRIC1(px,qx,k,x,x0,y0):=LIM(LIN1_DIFFERENCE(LIM(px,x,k^x_),LIM(qx,x,k^x_)~
- ,x_,LOG(x0,k),y0),x_,LOG(x,k))
-
- "Returns gen solution to f(y(x)-x d)=g(d), where d represents y(x+1)-y(x):"
-
- CLAIRAUT_DIF(f_,gd,d_):=LIM(f_=gd,d_,@1)
-
- "METHODS FOR 2ND-ORDER DIFFERENCE EQUATIONS:"
-
- "Methods for 2nd-order linear equations with constant coefficients:"
-
- "Returns discriminant for soln to y(x+2)+py(x+1)+qy(x)=0 with p & q const:"
-
- LIN2_RED_CCF_RECUR_DISC(p_,q_):=p_^2-4*q_
-
- "Returns solution to y(x+2)+py(x+1)+qy=0 with p & q constant & disc > 0:"
-
- LIN2_RED_CCF_RECUR_POS(p_,q_,x):=@1*((SQRT(p_^2-4*q_)-p_)/2)^x+@2*((-p_-SQRT(p~
- _^2-4*q_))/2)^x
-
- "Returns solution to y(x+2)+py(x+1)+qy=0 with p & q constant & disc < 0:"
-
- LIN2_RED_CCF_RECUR_NEG(p_,q_,x):=q_^(x/2)*(@1*SIN(x*ATAN(SQRT(4*q_-p_^2)/(-p_)~
- ))+@2*COS(x*ATAN(SQRT(4*q_-p_^2)/(-p_))))
-
- "Returns solution to y(x+2)+py(x+1)+qy=0 with p & q constant & disc = 0:"
-
- LIN2_RED_CCF_RECUR_0(p_,x):=(-p_/2)^x*(@1+@2*x)
-
- "Methods for reduced 2nd-order linear equations:"
-
- "Returns 0 if p(x) y(x+2) + q(x) y(x+1) + r(x) y(x) = 0 is exact:"
-
- EXACT2_IF_0(px,qx,rx,x):=px+LIM(qx,x,x+1)+LIM(rx,x,x+2)
-
- "If p(x)y(x+2)+q(x)y(x+1)+r(x)y(x)=0 exact, -> s st s(x)y(x+1)+r(x)y(x)=c:"
-
- EXACT2_RECUR(px,x):=LIM(px,x,x-1)
-
- "Given a particular soln u to y(x+2)+p(x)y(x+1)+q(x)=0, returns another:"
-
- LIN2_RED_GIVEN1(qx,ux,x):=ux*SUM(PRODUCT(qx,x)/(ux*LIM(ux,x,x+1)),x)
-
- "A method for any reduced 2nd-order linear equation:"
-
- "A helper function analogous to a Wronskian:"
-
- CASORATIAN(ux,vx,x):=DET([[ux, vx], [LIM(ux,x,x+1), LIM(vx,x,x+1)]])
-
- "Partic soln to y(x+2)+p(x)y(x)+q(x)y(x)=r(x) from partic solns u&v for r=0:"
-
- LIN2_COMPLETE(ux,vx,rx,x):=vx*SUM(rx*LIM(ux/CASORATIAN(ux,vx,x),x,x+1),x)-ux*SUM(~
- rx*LIM(vx/CASORATIAN(ux,vx,x),x,x+1),x)
-
- "Given y(x,@1,@2) and y(x1)=y1, y(x2)=x2, determines @1 and @2:"
-
- IMPOSE_BV2(x,y_,x1,y1,x2,y2):=SOLVE([LIM(y_,x,x1)=y1, LIM(y_,x,x2)=y2],[@1, @2~
- ])