Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## [Maxima-commits] CVS: maxima/share/contrib/diffequations/tests rtest_sym.mac,1.1,1.2

 [Maxima-commits] CVS: maxima/share/contrib/diffequations/tests rtest_sym.mac,1.1,1.2 From: David Billinghurst - 2004-01-31 12:45:35 ```Update of /cvsroot/maxima/maxima/share/contrib/diffequations/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12486 Modified Files: rtest_sym.mac Log Message: Add unit tests for lie_symgen_separable and lie_symgen_linear. Index: rtest_sym.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/diffequations/tests/rtest_sym.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rtest_sym.mac 27 Jan 2004 23:35:51 -0000 1.1 +++ rtest_sym.mac 31 Jan 2004 12:43:53 -0000 1.2 @@ -116,3 +116,68 @@ false; /* Investigate me */ ode1_a(phi:y*(1+2*x*y)/x,y,x); false; + +/* Unit tests for lie_symgen_separable + + solve 'diff(y,x) = phi(x,y) = f(x)*g(y) + + This is using a sledge hammer to crack walnuts, but educational + + */ +s:lie_symgen_separable(f:cos(x),g:exp(y),y,x); +[1/COS(x),0]; +symtest(phi:f*g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-%E^-y; +ans:lie_exact(phi,mu,y,x); +%E^-y*(SIN(x)*%E^y+1) = %C; +solve(ans,y); +[y = -LOG(%C-SIN(x))]; +ode_check('diff(y,x)=phi,%[1]); +0; + +s:lie_symgen_separable(f:cos(x),g:tan(y),y,x); +[1/COS(x),0]; +symtest(phi:f*g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-1/TAN(y); +ans:lie_exact(phi,mu,y,x); +SIN(x)-LOG(SIN(y)) = %C; +solve(ans,y); +[y = ASIN(%E^(SIN(x)-%C))]; +ode_check('diff(y,x)=phi,%[1]); +0; + + +/* Unit tests for lie_symgen_linear + + solve 'diff(y,x) = phi(x,y) = f(x)*y + g(x) + + */ +s:lie_symgen_linear(f:2,g:1,y,x); +[1/2,%C*%E^(2*x)]; +symtest(phi:f*y+g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-2/(2*y-2*%C*%E^(2*x)+1); +ans:lie_exact(phi,mu,y,x); +2*x-LOG(-2*y+2*%C*%E^(2*x)-1) = %C; +solve(ans,y); +[y = -(%E^(2*x-%C)-2*%C*%E^(2*x)+1)/2]; +ode_check('diff(y,x)=phi,%[1]); +0; + +s:lie_symgen_linear(f:1,g:sin(x)+x,y,x); +[1,(SIN(x)-COS(x)+2*%C*%E^x-2)/2]; +symtest(phi:f*y+g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-2/(2*y+SIN(x)+COS(x)-2*%C*%E^x+2*x+2); +ans:lie_exact(phi,mu,y,x); +x-LOG(2*y+SIN(x)+COS(x)-2*%C*%E^x+2*x+2) = %C; +solve(ans,y); +[y = -(SIN(x)+COS(x)-%E^(x-%C)-2*%C*%E^x+2*x+2)/2]; +ode_check('diff(y,x)=phi,%[1]); +0; ```

 [Maxima-commits] CVS: maxima/share/contrib/diffequations/tests rtest_sym.mac,1.1,1.2 From: David Billinghurst - 2004-01-31 12:45:35 ```Update of /cvsroot/maxima/maxima/share/contrib/diffequations/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12486 Modified Files: rtest_sym.mac Log Message: Add unit tests for lie_symgen_separable and lie_symgen_linear. Index: rtest_sym.mac =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/diffequations/tests/rtest_sym.mac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rtest_sym.mac 27 Jan 2004 23:35:51 -0000 1.1 +++ rtest_sym.mac 31 Jan 2004 12:43:53 -0000 1.2 @@ -116,3 +116,68 @@ false; /* Investigate me */ ode1_a(phi:y*(1+2*x*y)/x,y,x); false; + +/* Unit tests for lie_symgen_separable + + solve 'diff(y,x) = phi(x,y) = f(x)*g(y) + + This is using a sledge hammer to crack walnuts, but educational + + */ +s:lie_symgen_separable(f:cos(x),g:exp(y),y,x); +[1/COS(x),0]; +symtest(phi:f*g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-%E^-y; +ans:lie_exact(phi,mu,y,x); +%E^-y*(SIN(x)*%E^y+1) = %C; +solve(ans,y); +[y = -LOG(%C-SIN(x))]; +ode_check('diff(y,x)=phi,%[1]); +0; + +s:lie_symgen_separable(f:cos(x),g:tan(y),y,x); +[1/COS(x),0]; +symtest(phi:f*g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-1/TAN(y); +ans:lie_exact(phi,mu,y,x); +SIN(x)-LOG(SIN(y)) = %C; +solve(ans,y); +[y = ASIN(%E^(SIN(x)-%C))]; +ode_check('diff(y,x)=phi,%[1]); +0; + + +/* Unit tests for lie_symgen_linear + + solve 'diff(y,x) = phi(x,y) = f(x)*y + g(x) + + */ +s:lie_symgen_linear(f:2,g:1,y,x); +[1/2,%C*%E^(2*x)]; +symtest(phi:f*y+g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-2/(2*y-2*%C*%E^(2*x)+1); +ans:lie_exact(phi,mu,y,x); +2*x-LOG(-2*y+2*%C*%E^(2*x)-1) = %C; +solve(ans,y); +[y = -(%E^(2*x-%C)-2*%C*%E^(2*x)+1)/2]; +ode_check('diff(y,x)=phi,%[1]); +0; + +s:lie_symgen_linear(f:1,g:sin(x)+x,y,x); +[1,(SIN(x)-COS(x)+2*%C*%E^x-2)/2]; +symtest(phi:f*y+g,xi:s[1],eta:s[2],y,x); +0; +mu:lie_integrating_factor(phi,xi,eta); +-2/(2*y+SIN(x)+COS(x)-2*%C*%E^x+2*x+2); +ans:lie_exact(phi,mu,y,x); +x-LOG(2*y+SIN(x)+COS(x)-2*%C*%E^x+2*x+2) = %C; +solve(ans,y); +[y = -(SIN(x)+COS(x)-%E^(x-%C)-2*%C*%E^x+2*x+2)/2]; +ode_check('diff(y,x)=phi,%[1]); +0; ```