2 MACSYMA's ordinary differential equation (ODE) solver ODE2
3 may be used for symbolically solving elementary ODEs of first and
6 One calls the ODE2 routine as follows:
8 (C1) X^2*'DIFF(Y,X) + 3*X*Y = SIN(X)/X;
10 (D1) X -- + 3 X Y = ------
20 We see from this example how ODE2 is used. Namely, it takes
21 three arguments: an ODE of first or second order (only the left hand side
22 need be given if the right hand side is 0), the dependent variable, and
23 the independent variable. When successful, it returns either an explicit
24 or implicit solution for the dependent variable. %C is used to represent
25 the constant in the case of first order equations, and %K1 and %K2 the
26 constants for second order equations. If ODE2 cannot obtain a solution
27 for whatever reason, it returns FALSE, after perhaps printing out an
30 The methods implemented for first order equations in the order in
31 which they are tested are: linear, separable, exact - perhaps requiring
32 an integrating factor, homogeneous, Bernoulli's equation, and a
33 generalized homogeneous method.
35 For second order: constant coefficient, exact, linear homogeneous
36 with non-constant coefficients which can be transformed to constant
37 coefficient, the Euler or equidimensional equation, the method of
38 variation of parameters, and equations which are free of either the
39 independent or of the dependent variable so that they can be reduced to
40 two first order linear equations to be solved sequentially.
42 In the course of solving ODEs, several variables are set purely
43 for informational purposes: METHOD denotes the method of solution used e.g.
44 LINEAR, INTFACTOR denotes any integrating factor used, ODEINDEX denotes the
45 index for Bernoulli's method or for the generalized homogeneous method,
46 and YP denotes the particular solution for the variation of parameters
49 In order to solve initial value problems (IVPs) and boundary
50 value problems (BVPs), the routine IC1 is available for first
51 order equations, and IC2 and BC2 for second order IVPs and BVPs,
52 respectively. They are used as in the following examples:
54 (C3) IC1(D2,X=%PI,Y=0);
60 (C4) 'DIFF(Y,X,2) + Y*'DIFF(Y,X)^3 = 0;
70 (D7) ------------------ = %K2
73 (C8) RATSIMP(IC2(D7,X=0,Y=0,'DIFF(Y,X)=2));
76 (D9) - ---------------- = 0
79 (C10) BC2(D7,X=0,Y=1,X=1,Y=3);
82 (D11) --------------- = - 3
85 In order to see more clearly which methods have been implemented,
86 a demonstration file is available. To run it, you may do
87 DEMO(ODE2,DEMO,DSK,SHARE); .