Fix typo in display-html-help
[maxima.git] / share / contrib / diffequations / tests / rtestode_murphy_1_3.mac
blobb4e3492030bb51957ec7fabe06c6c28f63af9f72
1 (load("contrib_ode"),0);
2 0$
4 /* ODE tests - Murphy equations 1.201 - 1.300
6   Reference: 
7     G M Murphy, Ordinary Differential Equations and Their 
8     Solutions, Van Nostrand, 1960
10   First Order and of First Degree, p 224 ff
13 /* Don't kill(all); It messes up trigsimp */
15 /* Print ode number*/
16 (pn_(n_):=print("Murphy ODE 1.",n_),true);
17 true;
19 /* 201 */
20 assume(b>0);
21 [b>0];
22 (pn_(201),ans:contrib_ode(eqn:x*'diff(y,x)=y+a*sqrt(y^2+b*x^2),y,x));
23 [x=%c*%e^(x*asinh(y/(sqrt(b)*x))/(a*abs(x)))];
24 assume(x>0);
25 [x>0];
26 ratsimp(ans[1]);
27 x = %c*%e^(asinh(y/(sqrt(b)*x))/a);
28 map(log,%/%c);
29 log(x/%c) = asinh(y/(sqrt(b)*x))/a;
30 map(sinh,a*%);
31 sinh(a*log(x/%c)) = y/(sqrt(b)*x);
32 solve(%,y);
33 [y = sqrt(b)*x*sinh(a*log(x/%c))];
34 [method,ode_check(eqn,%[1])];
35 [genhom,0];
36 forget(b>0,x>0);
37 [b>0,x>0];
39 /* 240 riccati */
41 /* 249 */
42 ans:contrib_ode(eqn:3*x*'diff(y,x)=3*x^(2/3)+(1-3*y)*y,y,x);
43 [y=tanh(3*x^(1/3)+%c)*x^(1/3)];
44 [method,ode_check(eqn,ans[1])];
45 [riccati,0];
47 /* 266 */
48 (pn_(266),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x^n+x^2*y^2,y,x));
49 [[y=-'diff(%u,x,1)/%u,%u*(b*x^(n-2)+a/x^2)+'diff(%u,x,2)=0]];
50 method;
51 riccati;
53 /* 267 Riccati */
54 (pn_(267),ans:contrib_ode(eqn:x^2*'diff(y,x)+2+x*y*(4+x*y)=0,y,x));
55 [x=%c*(x*y+2)/(x*y+1)];
56 method;
57 genhom;
59 /* 268 */
60 (pn_(268),ans:contrib_ode(eqn:x^2*'diff(y,x)+2+a*x*(1-x*y)-x^2*y^2=0,y,x));
61  [y = -((%c*a^3*x^3*%e^(a*x)-%c*a^2*x^2*%e^(a*x)+2*%c*a*x*%e^(a*x)
62                                  -2*%c*%e^(a*x)-1)
63           /(x*(2*%c*%e^(a*x)+1)+%c*a^2*x^3*%e^(a*x)-2*%c*a*x^2*%e^(a*x)))];
64 [method,ode_check(eqn,ans[1])];
65 [riccati,0];
67 /* 270 */
68 (pn_(270),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x^n+c*x^2*y^2,y,x));
69 [[y=-'diff(%u,x,1)/(%u*c),%u*c^2*(b*x^(n-2)+a/x^2)+'diff(%u,x,2)*c=0]];
70 method;
71 riccati;
73 /* 271 Riccati */
74 (pn_(271),assume(4*a*c-b^2-2*b-1>0),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x*y+c*x^2*y^2,y,x),forget(4*a*c-b^2-2*b-1>0),ans);
75 [x=%c*%e^(2*atan((2*c*x*y+b+1)/sqrt(4*a*c-b^2-2*b-1))/sqrt(4*a*c-b^2-2*b-1))];
76 method;
77 genhom;
79 /* 272 */
80 (pn_(272),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x*y+c*x^4*y^2,y,x));
81 [y = (sqrt(a)*(%c*bessel_y(-((b+5)/2),-sqrt(a)*sqrt(c)*x)
82                     +bessel_j(-((b+5)/2),-sqrt(a)*sqrt(c)*x)
83                     -%c*bessel_y(-((b+1)/2),-sqrt(a)*sqrt(c)*x)
84                     -bessel_j(-((b+1)/2),-sqrt(a)*sqrt(c)*x))*sqrt(c)*x
85          +b*(-%c*bessel_y(-((b+3)/2),-sqrt(a)*sqrt(c)*x)
86             -bessel_j(-((b+3)/2),-sqrt(a)*sqrt(c)*x))
87          -3*%c*bessel_y(-((b+3)/2),-sqrt(a)*sqrt(c)*x)
88          -3*bessel_j(-((b+3)/2),-sqrt(a)*sqrt(c)*x))
89          /((2*%c*bessel_y(-((b+3)/2),-sqrt(a)*sqrt(c)*x)
90           +2*bessel_j(-((b+3)/2),-sqrt(a)*sqrt(c)*x))
91           *c*x^3)];
92 [method,ode_check(eqn,ans[1])];
93 [riccati,0];
95 /* 275 - Abel eqn of 1st kind */
96 (pn_(275),ans:contrib_ode(eqn:x^2*'diff(y,x)=a*x^2*y^2-a*y^3,y,x));
97 false;
99 /* 276 - Abel eqn of 1st kind */
100 (pn_(276),ans:contrib_ode(eqn:x^2*'diff(y,x)+a*y^2+b*x^2*y^3=0,y,x));
101 false;
103 /* 300 Riccati */
104 (pn_(300),ans:contrib_ode(eqn:(1-x^2)*'diff(y,x)=1-(2*x-y)*y,y,x),0);
106 [method,ode_check(eqn,ans[1])];
107 [riccati,0];