home *** CD-ROM | disk | FTP | other *** search
- "File: ODE2.MTH (c) 01/22/90 Soft Warehouse, Inc."
-
- "ELEMENTARY METHODS FOR 2ND-ORDER ORDINARY DIFFERENTIAL EQUATIONS:"
-
- "To avoid confusion, linear eqns of form y''+p(x)y'+q(x)y=r(x) are here"
-
- " called REDUCED if r=0 or COMPLETE if r/=0. HOMOGENEOUS is reserved for"
-
- " eqns invariant under x->tx, y->ty."
-
- "Returns discriminant for soln to y'' + p y' + q y = 0 with p & q const:"
-
- LIN2_RED_CCF_DISC(p_,q_):=p_^2-4*q_
-
- "Returns soln to y'' + p y' + q y = 0 with p & q constant & disc > 0:"
-
- LIN2_RED_CCF_POS(p_,q_,x):=@1*#e^((SQRT(p_^2-4*q_)-p_)*x/2)+@2*#e^((-p_-SQRT(p~
- _^2-4*q_))*x/2)
-
- "Returns soln to y'' + p y' + q y = 0 with p & q constant & disc < 0:"
-
- LIN2_RED_CCF_NEG(p_,q_,x):=#e^(-p_*x/2)*(@1*SIN(x*SQRT(4*q_-p_^2)/2)+@2*COS(x*~
- SQRT(4*q_-p_^2)/2))
-
- "Returns soln to y'' + p y' + q y = 0 with p & q constant & disc = 0:"
-
- LIN2_RED_CCF_0(p_,x):=#e^(-p_*x/2)*(@1+@2*x)
-
- "Helper for LIN2_COMPLETE:"
-
- WRONSKIAN(ux,vx,x):=DET([[ux, vx], [DIF(ux,x), DIF(vx,x)]])
-
- "Retrns partic soln to y''+p(x)y'+q(x)=r(x) given partic solns u&v for r=0:"
-
- "Eg: To solve y'' + 2y' + y = #e^-x LN x, LIN2_RED_CCF_DISC(2,1) gives 0,"
-
- " then LIN_2_RED_CCF_0 (2,x) gives (@2 x + @1)#e^-x, then this result"
-
- " + LIN2_COMPLETE (x #e^-x, #e^-x, #e^-x LN x, x) gives the gen soln."
-
- LIN2_COMPLETE(ux,vx,rx,x):=vx*INT(ux*rx/WRONSKIAN(ux,vx,x),x)-ux*INT(vx*rx/WRO~
- NSKIAN(ux,vx,x),x)
-
- "Given 1 soln u(x) to y''+p(x)y'+q(x)=0, returns another independent one:"
-
- SECOND_RED_PARTIC(px,ux,x):=ux*INT(#e^INT(px,x)/ux^2,x)
-
- "Returns solution to y''=q(y), y(x0)=y0, y'(x0)=v0:"
-
- AUTONOMOUS_CONSERVATIVE(qy,x,y_,x0,y0,v0):=x=x0+INT((2*INT(qy,y_,y0,y_)+v0^2)^~
- (-1/2),y_,y0,y_)
-
- "Reduces ODE of form d2y/dx2=r(v,y) with v=dy/dx to 1st ord dv/dy=result."
-
- "If you can solve it for v(y), then solve the separable eqn y'=v(y) for y:"
-
- "eg: To solve y''=(1-2y)y', AUTONOMOUS((1-2y)v,v,y) gives 2y+1 for dv/dy,"
-
- " then using file ODE1, SEPARABLE(1,1/(2y+1),v,y,v0,y0) & solving for v"
-
- " gives y^2+y+v0-y0^2-y0, then use SEPARABLE(1,y^2+y+v0-y0^2-y0,x,y,x0,y0)"
-
- AUTONOMOUS(rvy,v_):=rvy/v_
-
- "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~
- ])
-
- "Given y(x,@1,@2) and y(x0)=y0, y'(x0)=v0, determines @1 and @2:"
-
- IMPOSE_IC2(x,y_,x0,y0,v0):=SOLVE([LIM(y_,x,x0)=y0, LIM(DIF(y_,x),x,x0)=v0],[@1~
- , @2])
-
- "ADVANCED METHODS FOR 2ND-ORDER ORDINARY DIFFERENTIAL EQUATIONS:"
-
- "Returns gen solution to y'' + p(x) y' + q(y) (y')^2 = 0"
-
- LIOUVILLE(px,qy,x,y_):=INT(#e^INT(qy,y_),y_)=@1+@2*INT(#e^INT(-px,x),x)
-
- "Returns [0,0] if f(x,y,v)y''+g(x,y,v)=0 is exact, where v denotes y':"
-
- EXACT2_IF_ZEROS(f_,g_,x,y_,v_):=[(v_*DIF(f_,y_,2)+2*DIF(DIF(f_,x),y_)-DIF(DIF(~
- g_,y_),v_))*v_+DIF(f_,x,2)-DIF(DIF(g_,x),v_)+DIF(g_,y_), v_*DIF(DIF(f_,y_),v_)~
- +DIF(DIF(f_,x),v_)+2*DIF(f_,y_)-DIF(g_,v_,2)]
-
- "Returns a 1st integral to the exact eqn f(x,y,v)y''+g(x,y,v)=0:"
-
- EXACT2_AUX3(s_,h_,x):=s_+INT(h_-DIF(s_,x),x)
-
- EXACT2_AUX2(r_,x,y_,v_):=EXACT2_AUX3(INT(DIF(r_,v_),y_),LIM(r_,v_,0),x)
-
- EXACT2_AUX1(p_,g_,x,y_,v_):=p_+EXACT2_AUX2(g_-DIF(p_,x)-v_*DIF(p_,y_),x,y_,v_)
-
- EXACT2(f_,g_,x,y_,v_):=EXACT2_AUX1(INT(f_,v_),g_,x,y_,v_)=@1
-
- "ax+b->#e^t converts y''+p y'/(ax+b)+qy/(ax+b)^2 to d^2y/dt^2 +c dy/dt +ky"
-
- "EULER(p,q,b) -> [c,k]. Solve that lin-red-ccf eqn then let t->ln(ax+b):"
-
- EULER(p_,q_,b_):=[p/b-1, q/b^2]
-
- "Using v for y', y''=r(x,y,v) is equidimensional in y if result free of y:"
-
- EQUIDIMENSIONAL_IF_FREE_OF_Y(rxyv,y_,v_):=LIM(rxyv,v_,y_*v_)/y_
-
- "For equidimensional-in-y y''=r(x,y,v) gives dv/dx for transformed y & v."
-
- "Solve this 1st-ord ODE for a relation between v and x, then subst v->v/y,"
-
- " to get a 1st-order eqn in the orig. x, y and v:"
-
- EQUIDIMENSIONAL_Y(rxyv,y_,v_):=LIM(rxyv,y_,1)-v_^2
-
- "Using v for y', y''=r(x,y,v) is equidimensional in x if result free of x:"
-
- EQUIDIMENSIONAL_IF_FREE_OF_X(rxyv,x,v_):=x^2*LIM(rxyv,v_,v_/x)
-
- "For equidimensional-in-x y''=r(x,y,v) gives dv/dy for transformed y & v."
-
- "Solve this 1st-ord ODE for a relation between v and y, then subst v->x v,"
-
- " to get a 1st-order eqn in the orig. x, y and v:"
-
- EQUIDIMENSIONAL_X(rxyv,x,v_):=(v_+LIM(rxyv,x,1))/v_
-
- "Using var v for y', y''=r(x,y,v) is homogeneous if result is free of x:"
-
- HOMOGENEOUS2_IF_FREE_OF_X(rxyv,x,y_):=x*LIM(rxyv,y_,x*y_)
-
- "For v=y' & homogeneous y''=r(x,y,v) gives dv/dy for transformed x,y & v."
-
- "Solve this 1st-ord ODE for a relation between v and y, then subst v->v-y,"
-
- " then y->y/LN x to get a 1st-order eqn in the orig. x, y and v:"
-
- HOMOGENEOUS2(rxyv,x,y_,v_):=(LIM(LIM(rxyv,x,1),v_,v_+y_)-v_)/v_
-
- HOMOGENEOUS2((y-x*v)^2/(n*x^3),x,y,v)