clisp and gclisp give different answer for the same
Subject: clisp and gclisp give different answer for the same
From: Javed Alam
Date: Fri, 19 Sep 2003 18:09:22 -0400
Hi
I ran the maxima versions(5.9.0) compiled with clisp(2.31) and
gclisp(2.5.0) for exact same problems. The build_info for both is included.
OS ENVIRONMENT: CYGWIN under WINXP
CYGWIN { 2003/08/31 12:05:44 Starting cygwin install, version 2.340.2.5 }
Here is what I am getting as output:
MAXIMA version compiled with the clisp runs most of the problems but
fails to produce results for
1. problems involving differentiation of functions
2. 2nd order non-homogeneous ordinary differential equations. It works
ok for 2nd order homogenous ordinary equations.
Other than this everything else seems to work including plot2d and
plot3d functions.
I am including the screen output from both runs :
CLISP run
jalam@JOVE4 ~
$ maxima
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2003
Maxima 5.9.0 http://maxima.sourceforge.net
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
;; Loading file /usr/local/share/maxima/5.9.0/share/maxima-init.lisp ...
;; Loaded file /usr/local/share/maxima/5.9.0/share/maxima-init.lisp
(C1) build_info;
(D1) BUILD_INFO
(C2) build_info();
Maxima version: 5.9.0
Maxima build date: 6:33 9/12/2003
host type: i686-pc-cygwin
lisp-implementation-type: CLISP
lisp-implementation-version: 2.31 (released 2003-09-01) (built
3272325060) (memo
ry 3272351601)
(D2)
(C3) 2 + 2;
(D3) 4
(C4) integrate(x^2,x);
3
x
(D4) --
3
(C5) integrate(x^3,x,0,1);
1
(D5) -
4
(C6) 'diff(x,t,2)=0;
2
d x
(D6) --- = 0
2
dt
(C7) ode2(d6,x,t);
(D7) x = %K2 t + %K1
(C8) 'diff(x,t,2) + a*'diff(x,t) + b*x=0;
2
d x dx
(D8) --- + a -- + b x = 0
2 dt
dt
(C9) ode2(d8,x,t);
2
Is 4 b - a positive, negative, or zero?
positive;
a t
- --- 2 2
2 SQRT(4 b - a ) t SQRT(4 b - a ) t
(D9) x = %E (%K1 SIN(----------------) + %K2 COS(----------------))
2 2
(C10) solve(x^2 -3*x +2=0,x);
(D10) [x = 1, x = 2]
(C11) diff(x,x);
(D11) 1
(C12) diff(x^2,x);
d 2
(D12) -- (x )
dx
(C13) 'diff(x,t,2) +a*'diff(x,t) + b*x =d*sin(e*t);
2
d x dx
(D13) --- + a -- + b x = d SIN(e t)
2 dt
dt
(C14) ode2(d13,x,t);
2
Is 4 b - a positive, negative, or zero?
positive;
a t
- --- 2
2 SQRT(4 b - a ) t
(D14) x = %E (d SIN(----------------)
2
/ 2 2
[ 2 e t + SQRT(4 b - a ) t SQRT(4 b - a ) t - 2 e t
I (SIN(------------------------) - SIN(------------------------))
] 2 2
/
a t
2 - --- 2
SQRT(4 b - a ) t d 2 SQRT(4 b - a ) t
/(2 COS(----------------) (-- (%E SIN(----------------)))
2 dt 2
a t
2 - --- 2
SQRT(4 b - a ) t d 2 SQRT(4 b - a ) t
- 2 SIN(----------------) (-- (%E COS(----------------)))) dt
2 dt 2
2 / 2
SQRT(4 b - a ) t [ 2 e t + SQRT(4 b - a ) t
+ d COS(----------------) I (COS(------------------------)
2 ] 2
/
2 2
SQRT(4 b - a ) t - 2 e t SQRT(4 b - a ) t
- COS(------------------------))/(2 COS(----------------)
2 2
a t
- --- 2 2
d 2 SQRT(4 b - a ) t SQRT(4 b - a ) t
(-- (%E SIN(----------------))) - 2 SIN(----------------)
dt 2 2
a t
- --- 2
d 2 SQRT(4 b - a ) t
(-- (%E COS(----------------)))) dt)
dt 2
(C15)
- --- 2 2
2 SQRT(4 b - a ) t SQRT(4 b - a ) t
+ %E (%K1 SIN(----------------) + %K2 COS(----------------))
2 2
(C15)
GCLISP RUN for the sake of comparison
jalam@JOVE4 ~
jalam@JOVE4 /tmp/maxima/lib/maxima/5.9.0/binary-gcl
$ ./maxima -eval "(user::run)"
GCL (GNU Common Lisp) Version(2.5.0) Thu Jan 30 02:37:51 CST 2003
Licensed under GNU Library General Public License
Contains Enhancements by W. Schelter
Use (help) to get some basic information on how to use GCL.
Maxima 5.9.0 http://maxima.sourceforge.net
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(C1) build_info;
(D1) BUILD_INFO
(C2) build_info();
Maxima version: 5.9.0
Maxima build date: 19:10 2/9/2003
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL-2-5.0
(D2)
(C3) 2 + 2;
(D3) 4
(C4) integrate (x^2,x);
3
x
(D4) --
3
(C5) integrate(x^3,x,0,1);
1
(D5) -
4
(C6) 'diff(x,t,2)=0;
2
d x
(D6) --- = 0
2
dt
(C7) ode2(d6,x,t);
(D7) x = %K2 t + %K1
(C8) 'diff(x,t,2) + a*'diff(x,t) + b*x=0;
2
d x dx
(D8) --- + a -- + b x = 0
2 dt
dt
(C9) ode2(d8,x,t);
2
Is 4 b - a positive, negative, or zero?
positive;
a t
- --- 2 2
2 SQRT(4 b - a ) t SQRT(4 b - a ) t
(D9) x = %E (%K1 SIN(----------------) + %K2 COS(----------------))
2 2
(C10) solve(x^2 - 3*x +2=0,x);
(D10) [x = 1, x = 2]
(C11) diff(x,x);
(D11) 1
(C12) diff(x^2,x);
(D12) 2 x
(C13) 'diff(x,t,2) + a*'diff(x,t) + b*x = d*sin(e*t);
2
d x dx
(D13) --- + a -- + b x = d SIN(e t)
2 dt
dt
(C14) ode2(d13,x,t);
2
Is 4 b - a positive, negative, or zero?
positive;
a t
- --- 2 2
2 SQRT(4 b - a ) t SQRT(4 b - a ) t
(D14) x = %E (%K1 SIN(----------------) + %K2 COS(----------------))
2 2
2
(d e - b d) SIN(e t) + a d e
COS(e t)
-
--------------------------------------
4 2 2 2
e + (a - 2 b) e + b
(C15)
This shows that it could be a very small problem in clisp compilation of
maxima on winxp under cygwin. Any suggestion will be very helpful. Thanks
regards javed
James Amundson wrote:
>On Fri, 2003-09-19 at 01:31, Javed Alam wrote:
>
>
>>I tried to solve this 2nd order differential equation
>>and end up with
>>a wrong answer because if I try doing the same with maxima compiled with
>>GCL I get the
>>right answer. Did some body else had the same problem?
>>
>>
>
><snip>
>
>
>
>>(C1) 'diff(x,t,2) + a*x = b*sin(c*t);
>> 2
>> d x
>>(D1) --- + a x = b SIN(c t)
>> 2
>> dt
>>(C2) ode2(d1,x,t);
>>Is a positive, negative, or zero?
>>
>>positive;
>> /
>> [
>>(D2) x = b SIN(SQRT(a) t) I (SIN(c t + SQRT(a) t) + SIN(c t - SQRT(a) t))
>> ]
>>1. Break [1]>
>>
>> d
>>/(2 COS(SQRT(a) t) (-- (SIN(SQRT(a) t)))
>> dt
>>
>> d
>> - 2 SIN(SQRT(a) t) (-- (COS(SQRT(a) t)))) dt
>> dt
>>
>> /
>> [
>> + b COS(SQRT(a) t) I (COS(c t + SQRT(a) t) - COS(c t - SQRT(a) t))
>> ]
>> /
>>
>> d
>>/(2 COS(SQRT(a) t) (-- (SIN(SQRT(a) t)))
>> dt
>>
>> d
>> - 2 SIN(SQRT(a) t) (-- (COS(SQRT(a) t)))) dt + %K1 SIN(SQRT(a) t)
>> dt
>>
>> + %K2 COS(SQRT(a) t)
>>
>>
>
>I was not able to reproduce this result with Maxima 5.9.0+Clisp 2.29 or
>the current Maxima cvs+Clisp 2.31. Looking at it, I don't see how you
>could possibly get "1. Break [1]>" In the middle of a displayed
>equation. Do you know what happened there? It would be helpful for you
>to send us the output of "build_info();"
>
>--Jim
>
>
>
>
>
--
*Javed Alam, *Ph.D.
*Professor*
*Civil/Environmental/Chemical Engineering Department*
Youngstown State University
Youngstown, Ohio 44555
Phone 330-941-3029
Fax 330-941-3265
e-mail jalam@cc.ysu.edu <mailto:jalam@cc.ysu.edu>
web: http://www.eng.ysu.edu/~jalam/ <http://www.eng.ysu.edu/%7Ejalam/>
======================================================
"Knowledge will forever govern ignorance, and a people who mean to be
their own governors, must arm themselves with the power knowledge gives.
A popular government without popular information or the means of
acquiring it, is but a prologue to a farce or a tragedy or perhaps both."
- James Madison /(Fourth President of the United States)/
<http://opengov1.media.mit.edu/>
"Facts are stupid things..."
- Ronald Reagan /(40th President of the United States)/
<http://opengov1.media.mit.edu/>
========================================================