Hi Ziga,
Thanks for the updated program.
I have applied this to the test cases and the results seem fine (see below).
I will post further testing results of your program in due course.
I dont know lisp, but am intrigued at how your concise program operates and
calls the built-in Maxima commands, eg. trigsimp(), etc. to produce
significant simplifications.
If possible, some comments explaining the operations performed, etc, will be
useful.
Please post any improved versions or more extensive versions of your program
(as suggested).
Thanks very much.
Best regards,
C. Frangos.
z = -sin(q2)*sin(q4)*sin(q6+q5)^2*sin(q8)
+cos(q2)*cos(q4)*sin(q6+q5)^2*sin(q8)-2*sin(q2)*sin(q4)*cos(q6+q5)^2*sin(q8)
+cos(q2)*cos(q4)*cos(q6+q5)^2*sin(q8)+sin(q2)*cos(q4)*sin(q6+q5)*cos(q8)
+cos(q2)*sin(q4)*sin(q6)*cos(q8)
nz = 217
zsimp = (sin(q2)*sin(q4)*(sin(q6+q5)^2-2)+cos(q2)*cos(q4))*sin(q8)
+(sin(q2)*cos(q4)*sin(q6+q5)+cos(q2)*sin(q4)*sin(q6))*cos(q8)
nzsimp = 119
pause
z = cos(q4+q2)^2*sin(q6+q5)^2*sin(q8)^3+cos(q4+q2)*sin(q4+q2)*sin(q6+q5)
*cos(q8)*sin(q8)^2
+cos(q4+q2)^2*sin(q6+q5)^2*cos(q8)^2
*sin(q8)
-cos(q4+q2)^2*cos(q6+q5)^2*sin(q8)
+cos(q4+q2)*sin(q4+q2)*sin(q6+q5)
*cos(q8)^3
nz = 207
zsimp = cos(q4+q2)*sin(q4+q2)*sin(q6+q5)*cos(q8)
-cos(q4+q2)^2*cos(2*(q6+q5))*sin(q8)
nzsimp = 76
pause
z = -sin(q2)^2*sin(q4)*sin(q6+q5)^2*sin(q8)
+cos(q2)*sin(q2)*cos(q4)*sin(q6+q5)^2*sin(q8)
-sin(q2)^2*sin(q4)*cos(q6+q5)^2*sin(q8)
+cos(q2)*sin(q2)*cos(q4)*cos(q6+q5)^2*sin(q8)
+cos(q2)*sin(q2)*sin(q4)*sin(q6+q5)*cos(q8)
+sin(q2)^2*cos(q4)*sin(q6+q5)*cos(q8)
nz = 248
zsimp = sin(q2)*sin(q4+q2)*sin(q6+q5)*cos(q8)-(-sin(q2)*cos(q4+q2)*sin(q8))
nzsimp = 67
pause
z = -sin(q2)*sin(q4+q3)*sin(q5)+sin(q2)*sin(q4+q2)+sin(q2)^2*cos(q3)*sin(q4)
+cos(q2)^2*cos(q3)*sin(q4)
nz = 98
zsimp = -sin(q2)*sin(q4+q3)*sin(q5)+sin(q2)*sin(q4+q2)+cos(q3)*sin(q4)
nzsimp = 62
pause
z = -sin(q2)*sin(q4)*sin(q6+q5)^2*sin(q8)
+cos(q2)*cos(q4)*sin(q6+q5)^2*sin(q8)-sin(q2)*sin(q4)*cos(q6+q5)^2*sin(q8)
+cos(q2)*cos(q4)*cos(q6+q5)^2*sin(q8)+cos(q2)*sin(q4)*sin(q6+q5)*cos(q8)
+sin(q2)*cos(q4)*sin(q6+q5)*cos(q8)
nz = 218
zsimp = cos(q4+q2)*sin(q8)+sin(q4+q2)*sin(q6+q5)*cos(q8)
nzsimp = 48
On Wednesday 23 September 2009 12:43:38 pm ?iga Lenar?i? wrote:
> On Sep 20, 2009, at 9:01 PM, Constantine Frangos wrote:
> > Hi Ziga,
> >
> > I have done some further testing of the two versions of simplify()
> > that were
> > posted, and the results seem encouraging.
> >
> > For the examples below, the first version (simplifyv1.lisp) somehow
> > produces
> > shorter simplified expressions that the second version
> > (simplifyv2.lisp).
> >
> > Any assistance with further tuning or improvements of the program
> > would be
> > appreciated.
> >
> > Regards,
> >
> > C. Frangos.
> >
> >
> >
> >
> > <simplifyv1.lisp><simplifyv2.lisp>
>
> Hi Constantine!
>
> Thanks for your interest and tests. The problem is that one of these
> two functions doesn't call trigsimp() function correctly, hence
> unsimplified results.
>
> I've attached the version I have on my disk. I hope it serves you
> well :)
>
> Regards,
> Ziga