Tue Mar 24 19:53:42 MET 1998 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Ordinary Difference and Differential Equations ---------- -- Second order linear recurrence equation: r(n) = (n - 1)^2 + m n r:= operator('r); Type: BasicOperator Time: 0.07 (IN) + 0.05 (OT) + 0.02 (GC) = 0.13 sec [r(n + 2) - 2 * r(n + 1) + r(n) = 2, r(0) = 1, r(1) = m] (2) [r(n + 2) - 2r(n + 1) + r(n)= 2,r(0)= 1,r(1)= m] Type: List Equation Expression Integer Time: 1.17 (IN) + 0.05 (EV) + 0.24 (OT) + 0.07 (GC) = 1.52 sec -- => r(n) = 3^n - 2^n [Cohen, p. 67] [r(n) = 5*r(n - 1) - 6*r(n - 2), r(0) = 0, r(1) = 1] (3) [r(n)= 5r(n - 1) - 6r(n - 2),r(0)= 0,r(1)= 1] Type: List Equation Expression Integer Time: 0.10 (IN) + 0.05 (OT) = 0.15 sec -- => r(n) = Fibonacci[n + 1] [Cohen, p. 83] [r(n) = r(n - 1) + r(n - 2), r(1) = 1, r(2) = 2] (4) [r(n)= r(n - 1) + r(n - 2),r(1)= 1,r(2)= 2] Type: List Equation Expression Integer Time: 0.05 (IN) + 0.02 (OT) = 0.07 sec -- => [c^(n+1) [c^(n+1) - 2 c - 2] + (n+1) c^2 + 2 c - n] / [(c-1)^3 (c+1)] -- [Joan Z. Yu and Robert Israel in sci.math.symbolic] [r(n) = (1 + c - c**(n-1) - c**(n+1))/(1 - c**n)*r(n - 1) _ - c*(1 - c**(n-2))/(1 - c**(n-1))*r(n - 2) + 1, _ r(1) = 1, r(2) = (2 + 2*c + c**2)/(1 + c)] (5) [ r(n) = n - 1 n + 1 (r(n - 1)c - r(n - 1))c + n - 1 n - 2 n n - 1 2 (c - c r(n - 2)c + c r(n - 2) - 1)c + r(n - 1)(c ) + n - 1 n - 2 ((- c - 2)r(n - 1) - 1)c + c r(n - 2)c + (c + 1)r(n - 1) + - c r(n - 2) + 1 / n - 1 n n - 1 (c - 1)c - c + 1 , 2 c + 2c + 2 r(1)= 1, r(2)= -----------] c + 1 Type: List Equation Expression Integer Time: 0.48 (IN) + 0.13 (EV) + 0.13 (OT) + 0.03 (GC) = 0.78 sec )clear properties r -- Second order ODE with initial conditions---solve first using Laplace -- transforms: f(t) = sin(2 t)/8 - t cos(2 t)/4 f:= operator('f); Type: BasicOperator Time: 0.02 (IN) + 0.02 (OT) = 0.03 sec ode:= D(f(t), t, 2) + 4*f(t) = sin(2*t) ,, (7) f (t) + 4f(t)= sin(2t) Type: Equation Expression Integer Time: 0.17 (IN) + 0.15 (EV) + 0.02 (OT) + 0.02 (GC) = 0.35 sec map(e +-> laplace(e, t, s), %) 2 , 2 (8) (s + 4)laplace(f(t),t,s) - f (0) - f(0)s= ------ 2 s + 4 Type: Equation Expression Integer Time: 0.92 (EV) + 0.02 (OT) + 0.07 (GC) = 1.0 sec subst(subst(%, f(0) = 0), subst(D(f(x), x), x = 0) = 0) 2 2 (9) (s + 4)laplace(f(t),t,s)= ------ 2 s + 4 Type: Equation Expression Integer Time: 0.47 (IN) + 0.02 (EV) + 0.07 (OT) = 0.55 sec map(e +-> e/(s**2 + 4), %) 2 (10) laplace(f(t),t,s)= ------------- 4 2 s + 8s + 16 Type: Equation Expression Integer Time: 0.08 (IN) + 0.02 (OT) = 0.10 sec map(e +-> inverseLaplace(e, s, t), %) sin(2t) - 2t cos(2t) (11) "failed"= -------------------- 8 Type: Equation Union(Expression Integer,"failed") Time: 0.02 (IN) + 0.10 (EV) + 0.03 (OT) = 0.15 sec -- Now, solve the ODE directly solve(ode, f, t = 0, [0, 0]) sin(2t) - 2t cos(2t) (12) -------------------- 8 Type: Union(Expression Integer,...) Time: 0.30 (IN) + 0.87 (EV) + 0.07 (OT) = 1.23 sec )clear properties f ode -- Separable equation => y(x)^2 = 2 log(x + 1) + (4 x + 3)/(x + 1)^2 + 2 A y:= operator('y); Type: BasicOperator Time: 0.03 (IN) = 0.03 sec D(y(x), x) = x**2/(y(x)*(1 + x)**3) 2 , x (14) y (x)= ----------------------- 3 2 (x + 3x + 3x + 1)y(x) Type: Equation Expression Integer Time: 0.08 (IN) + 0.02 (EV) + 0.07 (OT) = 0.17 sec solve(%, y, x) 2 2 2 (- 2x - 4x - 2)log(x + 1) + (x + 2x + 1)y(x) - 4x - 3 (15) -------------------------------------------------------- 2 2x + 4x + 2 Type: Union(Expression Integer,...) Time: 0.02 (IN) + 0.82 (EV) + 0.02 (OT) + 0.42 (GC) = 1.27 sec -- Homogeneous equation. See Emilio O. Roxin, _Ordinary Differential -- Equations_, Wadsworth Publishing Company, 1972, p. 11 -- => y(x)^2 = 2 x^2 log|A x| D(y(x), x) = y(x)/x + x/y(x) 2 2 , y(x) + x (16) y (x)= ---------- x y(x) Type: Equation Expression Integer Time: 0.17 (IN) + 0.02 (EV) + 0.02 (OT) = 0.20 sec solve(%, y, x) 2 2 - 2x log(x) + y(x) (17) ------------------- 2 2x Type: Union(Expression Integer,...) Time: 0.15 (EV) = 0.15 sec -- First order linear ODE: y(x) = [A - cos(x)]/x^3 y:= operator('y); Type: BasicOperator Time: 0 sec x**2 * D(y(x), x) + 3*x*y(x) = sin(x)/x 2 , sin(x) (19) x y (x) + 3x y(x)= ------ x Type: Equation Expression Integer Time: 0.08 (IN) = 0.08 sec solve(%, y, x) cos(x) 1 (20) [particular= - ------,basis= [--]] 3 3 x x Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...) Time: 0.33 (EV) + 0.02 (OT) + 0.02 (GC) = 0.37 sec -- Exact equation => x + x^2 sin y(x) + y(x) = A [Roxin, p. 15] D(y(x), x) = -(1 + 2*x*sin(y(x)))/(1 + x**2*cos(y(x))) , - 2x sin(y(x)) - 1 (21) y (x)= ------------------ 2 x cos(y(x)) + 1 Type: Equation Expression Integer Time: 0.05 (IN) + 0.05 (OT) = 0.10 sec solve(%, y, x) 2 (22) x sin(y(x)) + y(x) + x Type: Union(Expression Integer,...) Time: 0.08 (EV) + 0.02 (OT) = 0.10 sec -- Nonlinear ODE => y(x)^3/6 + A y(x) = x + B ode:= D(y(x), x, 2) + y(x)*D(y(x), x)**3 = 0 ,, , 3 (23) y (x) + y(x)y (x) = 0 Type: Equation Expression Integer Time: 0.05 (IN) + 0.03 (EV) = 0.08 sec solve(%, y, x) >> Error detected within library code: getlincoeff: not an appropriate ordinary differential equation initial (24) -> real 20.4 user 9.1 sys 0.6 ------------------------------------------------------------------------------- Tue Mar 24 19:56:43 MET 1998 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Ordinary Difference and Differential Equations ---------- y:= operator('y); Type: BasicOperator Time: 0.05 (IN) + 0.08 (OT) + 0.02 (GC) = 0.15 sec -- Nonlinear ODE => y(x)^3/6 + A y(x) = x + B ode:= D(y(x), x, 2) + y(x)*D(y(x), x)**3 = 0 ,, , 3 (2) y (x) + y(x)y (x) = 0 Type: Equation Expression Integer Time: 0.60 (IN) + 0.22 (EV) + 0.18 (OT) + 0.08 (GC) = 1.08 sec -- => y(x) = [3 x + sqrt(1 + 9 x^2)]^(1/3) - 1/[3 x + sqrt(1 + 9 x^2)]^(1/3) -- [Pos96] solve(ode, y, x = 0, [0, 2]) >> Error detected within library code: getlincoeff: not an appropriate ordinary differential equation initial (3) -> real 5.1 user 2.3 sys 0.2 ------------------------------------------------------------------------------- Tue Mar 24 19:56:49 MET 1998 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Ordinary Difference and Differential Equations ---------- y:= operator('y); Type: BasicOperator Time: 0.05 (IN) + 0.08 (OT) + 0.02 (GC) = 0.15 sec -- A simple parametric ODE: y(x, a) = A e^(a x) D(y(x, a), x) = a*y(x, a) (2) y (x,a)= a y(x,a) ,1 Type: Equation Expression Integer Time: 0.47 (IN) + 0.15 (EV) + 0.18 (OT) + 0.07 (GC) = 0.86 sec solve(%, y, x); >> Error detected within library code: parseODE: equation has order 0 initial (3) -> real 2.2 user 1.6 sys 0.2 ------------------------------------------------------------------------------- Tue Mar 24 20:03:01 MET 1998 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Ordinary Difference and Differential Equations ---------- y:= operator('y); Type: BasicOperator Time: 0.05 (IN) + 0.08 (OT) = 0.13 sec -- ODE with boundary conditions. This problem has nontrivial solutions -- y(x) = A sin([pi/2 + n pi] x) for n an arbitrary integer solve(D(y(x), x, 2) + k**2*y(x) = 0, y, x = 0, [0]) (2) 0 Type: Union(Expression Integer,...) Time: 1.15 (IN) + 0.97 (EV) + 0.17 (OT) + 0.17 (GC) = 2.45 sec --bc(%, x = 0, y = 0, x = 1, D(y(x), x) = 0) -- => y(x) = Z_v[sqrt(x)] where Z_v is an arbitrary Bessel function of order v -- [Gradshteyn and Ryzhik 8.491(9)] D(y(x), x, 2) + 1/x*D(y(x), x) + 1/(4*x)*(1 - v**2/x)*y(x) = 0 2 ,, , 2 4x y (x) + 4xy (x) + (x - v )y(x) (3) ----------------------------------= 0 2 4x Type: Equation Expression Integer Time: 0.35 (IN) + 0.03 (EV) + 0.08 (OT) = 0.47 sec solve(%, y, x) 2 2 v WARNING (genufact): No known algorithm to factor ? - --, trying square-free. 4 WARNING (genufact): No known algorithm to factor 3 2 2 2 ? - 3? + (- v + 3)? + v - 1, trying square-free. (4) [particular= 0,basis= []] Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...) Time: 0.02 (IN) + 81.03 (EV) + 0.02 (OT) + 17.42 (GC) = 98.48 sec -- Delay (or mixed differential-difference) equation. See Daniel Zwillinger, -- _Handbook of Differential Equations_, Second Edition, Academic Press, Inc., -- 1992, p. 210 => y(t) = y0 sum((-a)^n (t - n + 1)^n/n!, n = 0..floor(t) + 1) D(y(t), t) + a*y(t - 1) = 0 , (5) y (t) + a y(t - 1)= 0 Type: Equation Expression Integer Time: 0.22 (IN) + 0.07 (OT) = 0.28 sec solve(%, y, t) t ++ (6) | a y(%V - 1)d%V + y(t) ++ Type: Union(Expression Integer,...) Time: 0.02 (IN) + 0.30 (EV) + 0.02 (OT) + 0.03 (GC) = 0.37 sec -- Discontinuous ODE [Zwillinger, p. 221] -- => y(t) = cosh t (0 <= t < T) -- (sin T cosh T + cos T sinh T) sin t -- + (cos T cosh T - sin T sinh T) cos t (T <= t) sgn(t) == if t < 0 then -1 else 1; Type: Void Time: 0 sec solve(D(y(t), t, 2) + sgn(t - TT)*y(t) = 0, y, t = 0, [1, 0]) Compiling function sgn with type Polynomial Integer -> Integer (8) cos(t) Type: Union(Expression Integer,...) Time: 0.15 (IN) + 0.13 (EV) + 0.03 (OT) = 0.32 sec )clear properties sgn Compiled code for sgn has been cleared. solve(D(y(t), t, 2) + sign(t - TT)*y(t) = 0, y, t = 0, [1, 0]) There are 31 exposed and 17 unexposed library operations named * having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op * to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named * with argument type(s) failed Expression Integer -- Integro-differential equation. See A. E. Fitzgerald, David E. Higginbotham -- and Arvin Grabel, _Basic Electrical Engineering_, Fourth Edition, -- McGraw-Hill Book Company, 1975, p. 117. -- => i(t) = 5/13 [-8 e^(-4 t) + e^(-t) (8 cos 2 t + sin 2 t)] i:= operator('i); Type: BasicOperator Time: 0.02 (IN) + 0.02 (OT) = 0.03 sec eqn:= D(i(t), t) + 2*i(t) + 5*'integrate(i(tau), tau = 0..t) = 10*%e**(-4*t) , - 4t (10) i (t) + 2i(t) + 5integrate(i(tau),tau= 0,t )= 10%e Type: Equation OutputForm Time: 0.17 (IN) + 0.05 (EV) + 0.03 (OT) = 0.25 sec solve(eqn, i, t) There are 6 exposed and 1 unexposed library operations named solve having 3 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op solve to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named solve with argument type(s) Equation OutputForm BasicOperator Variable t map(e +-> laplace(e, t, s), eqn) There are 1 exposed and 0 unexposed library operations named laplace having 3 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op laplace to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named laplace with argument type(s) OutputForm Variable t Variable s AXIOM will attempt to step through and interpret the code. Anonymous user functions created with +-> that are processed in interpret-code mode must have result target information available. This information is not present so AXIOM cannot proceed any further. This may be remedied by declaring the function. --subst(%, [t = 0, D(i(t), t) = 10]) )clear properties i eqn -- System of two linear, constant coefficient ODEs: -- x(t) = e^t [A cos(t) - B sin(t)], y(t) = e^t [A sin(t) + B cos(t)] x:= operator('x); Type: BasicOperator Time: 0 sec system:= [D(x(t), t) = x(t) - y(t), D(y(t), t) = x(t) + y(t)] , , (12) [x (t)= - y(t) + x(t),y (t)= y(t) + x(t)] Type: List Equation Expression Integer Time: 0.05 (IN) + 0.03 (EV) + 0.02 (OT) = 0.10 sec -- Check the answer ans:= [x(t) = %e^t*(A*cos(t) - B*sin(t)), y(t) = %e^t*(A*sin(t) + B*cos(t))] t t t t (13) [x(t)= - B %e sin(t) + A cos(t)%e ,y(t)= A %e sin(t) + B cos(t)%e ] Type: List Equation Expression Integer Time: 0.25 (IN) + 0.07 (EV) + 0.02 (OT) = 0.33 sec dans:= map(e +-> D(lhs(e), t) = D(rhs(e), t), ans) (14) , t t [x (t)= (- B - A)%e sin(t) + (- B + A)cos(t)%e , , t t y (t)= (- B + A)%e sin(t) + (B + A)cos(t)%e ] Type: List Equation Expression Integer Time: 0.02 (IN) + 0.07 (EV) + 0.02 (OT) = 0.10 sec map(e +-> subst(lhs(e), dans) = subst(rhs(e), ans), system) (15) [ t t (- B - A)%e sin(t) + (- B + A)cos(t)%e = t t (- B - A)%e sin(t) + (- B + A)cos(t)%e , t t t t (- B + A)%e sin(t) + (B + A)cos(t)%e = (- B + A)%e sin(t) + (B + A)cos(t)%e ] Type: List Equation Expression Integer Time: 0.02 (IN) + 0.03 (EV) + 0.03 (OT) = 0.08 sec )clear properties ans dans -- Triangular system of two ODEs: x(t) = A e^t [sin(t) + 2], -- y(t) = A e^t [5 - cos(t) + 2 sin(t)]/5 + B e^(-t) -- See Nicolas Robidoux, ``Does Axiom Solve Systems of O.D.E.'s Like -- Mathematica?'', LA-UR-93-2235, Los Alamos National Laboratory, Los Alamos, -- New Mexico. system:= [D(x(t), t) = x(t) * (1 + cos(t)/(2 + sin(t))), _ D(y(t), t) = x(t) - y(t)] , x(t)sin(t) + x(t)cos(t) + 2x(t) , (16) [x (t)= -------------------------------,y (t)= - y(t) + x(t)] sin(t) + 2 Type: List Equation Expression Integer Time: 0.08 (IN) + 0.03 (EV) + 0.03 (OT) = 0.15 sec -- Try solving this system one equation at a time solve(system.1, x, t) t t (17) [particular= 0,basis= [%e sin(t) + 2%e ]] Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...) Time: 0.70 (EV) + 0.02 (OT) + 0.03 (GC) = 0.75 sec x(t) = C1 * %.basis.1 t t (18) x(t)= C1 %e sin(t) + 2C1 %e Type: Equation Expression Integer Time: 0.17 (IN) + 0.02 (OT) = 0.18 sec solve(subst(system.2, %), y, t) (19) - t t 2 - t t 2 2C1 %e (%e ) sin(t) + (- C1 cos(t) + 5C1)%e (%e ) [particular= ------------------------------------------------------, 5 - t basis= [%e ]] Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...) Time: 0.03 (IN) + 2.0 (EV) + 0.02 (OT) + 0.05 (GC) = 2.10 sec y(t) = simplify(%.particular) + C2 * %.basis.1 t t - t 2C1 %e sin(t) + (- C1 cos(t) + 5C1)%e + 5C2 %e (20) y(t)= -------------------------------------------------- 5 Type: Equation Expression Integer Time: 0.08 (IN) + 0.23 (EV) + 0.03 (OT) = 0.35 sec )clear properties x y x:= operator('x); Type: BasicOperator Time: 0 sec y:= operator('y); Type: BasicOperator Time: 0.02 (IN) = 0.02 sec z:= operator('z); Type: BasicOperator Time: 0.03 (IN) = 0.03 sec -- 3 x 3 linear system with constant coefficients: -- (1) real distinct characteristic roots (= 2, 1, 3) [Roxin, p. 109] -- => x(t) = A e^(2 t), y(t) = B e^t + C e^(3 t), -- z(t) = -A e^(2 t) - C e^(3 t) system:= [D(x(t), t) = 2*x(t), _ D(y(t), t) = -2*x(t) + y(t) - 2*z(t), _ D(z(t), t) = x(t) + 3*z(t)] , , , (24) [x (t)= 2x(t),y (t)= - 2z(t) + y(t) - 2x(t),z (t)= 3z(t) + x(t)] Type: List Equation Expression Integer Time: 0.13 (IN) + 0.03 (OT) = 0.17 sec -- (2) complex characteristic roots (= 0, -1 +- sqrt(2) i) [Roxin, p. 111] -- => x(t) = A + e^(-t)/3 [-(B + sqrt(2) C) cos(sqrt(2) t) + -- (sqrt(2) B - C) sin(sqrt(2) t)], -- y(t) = e^(-t) [B cos(sqrt(2) t) + C sin(sqrt(2) t)], -- z(t) = e^(-t) [(-B + sqrt(2) C) cos(sqrt(2) t) -- -(sqrt(2) B + C) sin(sqrt(2) t)] system:= [D(x(t), t) = y(t), D(y(t), t) = z(t), _ D(z(t), t) = -3*y(t) - 2*z(t)] , , , (25) [x (t)= y(t),y (t)= z(t),z (t)= - 2z(t) - 3y(t)] Type: List Equation Expression Integer Time: 0.08 (IN) + 0.02 (EV) + 0.03 (OT) = 0.13 sec -- (3) multiple characteristic roots (= 2, 2, 2) [Roxin, p. 113] -- => x(t) = e^(2 t) [A + C (1 + t)], y(t) = B e^(2 t), -- z(t) = e^(2 t) [A + C t] system:= [D(x(t), t) = 3*x(t) - z(t), D(y(t), t) = 2*y(t), _ D(z(t), t) = x(t) + z(t)] , , , (26) [x (t)= - z(t) + 3x(t),y (t)= 2y(t),z (t)= z(t) + x(t)] Type: List Equation Expression Integer Time: 0.57 (IN) + 0.03 (EV) + 0.03 (OT) + 0.47 (GC) = 1.10 sec -- x(t) = x0 + [4 sin(w t)/w - 3 t] x0' [Rick Niles] -- + 6 [w t - sin(w t)] y0 + 2/w [1 - cos(w t)] y0', -- y(t) = -2/w [1 - cos(w t)] x0' + [4 - 3 cos(w t)] y0 + sin(w t)/w y0' system:= [D(x(t), t, 2) = 2*w*D(y(t), t), _ D(y(t), t, 2) = -2*w*D(x(t), t) + 3*w**2*y(t)] ,, , ,, , 2 (27) [x (t)= 2wy (t),y (t)= - 2wx (t) + 3w y(t)] Type: List Equation Expression Integer Time: 0.13 (IN) + 0.03 (EV) + 0.02 (OT) = 0.18 sec )clear properties x y z system -- ---------- Quit ---------- )quit real 267.4 user 92.4 sys 1.8