Artifact 1951a88c6a93849c0b2c197abfd9b4a2facd2695cf7f970082f96a9cbdd0ffa1:
- File
r35/xlog/changevr.log
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 6477) [annotate] [blame] [check-ins using] [more...]
Codemist Standard Lisp 3.54 for DEC Alpha: May 23 1994 Dump file created: Mon May 23 10:39:11 1994 REDUCE 3.5, 15-Oct-93 ... Memory allocation: 6023424 bytes +++ About to read file tstlib.red %*********************************************************************; % This is a test file for the CHANGEVAR package. ; % Make sure that before you attempt to run it the ; % MATRIX package and CHANGEVAR is loaded. ; %*********************************************************************; algebraic; %*********************************************************************; % ON DISPJACOBIAN; % To get the Jacobians printed, remove the... ; % ... percentage sign before the word ON ; %*********************************************************************; % ; % *** First test problem *** ; % ; % Here are two Euler type of differential equations, ; % ; % 3 2 ; % 2 x y''' + 3 x y'' - y = 0 ; % ; % ; % 2 ; % 5 x y'' - x y' + 7 y = 0 ; % ; % ; % An Euler equation can be converted into a (linear) equation with ; % constant coefficients by making change of independent variable: ; % ; % u ; % x = e ; % ; % The resulting equations will be ; % ; % ; % 2 y''' - 3 y'' + y' - y = 0 ; % ; % and ; % ; % 5 y'' - 6 y' + 7 y = 0 ; % ; % ; % Where, now (prime) denotes differentiation with respect to the new ; % independent variable: u ; % How this change of variable is done using CHANGEVAR follows. ; % ; %*********************************************************************; operator y; changevar(y, u, x=e**u, { 2*x**3*df(y(x),x,3)+3*x**2*df(y(x),x,2)-y(x), 5*x**2*df(y(x),x,2)-x*df(y(x),x)+7*y(x) } ) ; {2*df(y(u),u,3) - 3*df(y(u),u,2) + df(y(u),u) - y(u), 5*df(y(u),u,2) - 6*df(y(u),u) + 7*y(u)} %*********************************************************************; % *** Second test problem *** ; % ; % Now, the problem is to obtain the polar coordinate form of Laplace's; % equation: ; % ; % 2 2 ; % d u d u ; % ------ + ------ = 0 ; % 2 2 ; % d x d y ; % ; % (The differentiations are partial) ; % ; % For polar coordinates the change of variables are : ; % ; % x = r cos(theta) , y = r sin(theta) ; % ; % As known, the result is : ; % ; % ; % 2 2 ; % d u 1 d u 1 d u ; % ------ + --- ------ + --- ---------- = 0 ; % 2 r d r 2 2 ; % d r r d theta ; % ; % How this change of variable is done using CHANGEVAR follows. ; % ; % 2 2 ; % (To get rid of the boring sin + cos terms we introduce a LET ; % statement) ; % ; %*********************************************************************; operator u; let sin theta**2 = 1 - cos theta**2 ; changevar(u, { r , theta }, { x=r*cos theta, y=r*sin theta }, df(u(x,y),x,2)+df(u(x,y),y,2) ) ; 2 df(u(r,theta),r,2)*r + df(u(r,theta),r)*r + df(u(r,theta),theta,2) --------------------------------------------------------------------- 2 r end; (changevr 300 0) End of Lisp run after 0.31+0.68 seconds