simplify




Hi Ziga,

I have applied your simplify() function to one example (see below) and the 
expected simplification is obtained (number of characters in each expression 
(string) is also indicated).

The command:  matrixmap(simplify, sym_matrix), works.

As a suggestion, try also to develop a number of alternative versions of 
simplify(), using an increasingly extensive approach - you spoke about "brute 
force", combinations of terms, etc. Did you mean applying simplify() to all 
possible combinations of n terms in an expression, n=2,3,4,...., in 
sequence ?

Regards,

C. Frangos.



z = dphi*Iwr1*Lc^2
        *(-8*ddelta3*cos(delta3)*sin(delta3)*L2^2
         -4*ddelta3*cos(2*delta3)*Lc*L2)
  /(-4*sin(delta3)^2*L2^2-2*sin(2*delta3)*Lc*L2-Lc^2)^2
  -ddelta3*dphi*Iwr1*Lc^2
          *(-8*cos(delta3)*sin(delta3)*L2^2-4*cos(2*delta3)*Lc*L2)
   /(-4*sin(delta3)^2*L2^2-2*sin(2*delta3)*Lc*L2-Lc^2)^2
  -2*ddelta3*Iwr1*Lc^4
    *(-8*ddelta3*cos(delta3)*sin(delta3)*L2^2-4*ddelta3*cos(2*delta3)*Lc*L2)
   /(-4*sin(delta3)^2*L2^2-2*sin(2*delta3)*Lc*L2-Lc^2)^3
  +ddelta3^2*Iwr1*Lc^4*(-8*cos(delta3)*sin(delta3)*L2^2-4*cos(2*delta3)*Lc*L2)
   /(-4*sin(delta3)^2*L2^2-2*sin(2*delta3)*Lc*L2-Lc^2)^3

nz = 545

zsimp = -4*ddelta3^2*Iwr1*Lc^4*L2*(sin(2*delta3)*L2+cos(2*delta3)*Lc)
      /(4*sin(delta3)^2*L2^2+2*sin(2*delta3)*Lc*L2+Lc^2)^3

nzsimp = 113

pause 


On Saturday 12 September 2009 01:09:39 pm ?iga Lenar?i? wrote:
> Hi!
>
> On unix-like systems you put the file into ~/.maxima/ folder and then
> 'load(simplify);' finds it. On Windows, I don't know where exactly
> could you put the file. Perhaps if you put it inside /maxima/share
> or /maxima/share/contrib, 'load' will find it. You can always try
> specifying the path with 'load("/path/to/file/simplify.lisp");'...
>
> If you look at the variable
> file_search_lisp;
> it will show you, in which folders maxima looks for lisp files, when
> you type load(simplify); or load("simplify.lisp"); (play around a bit).
>
> Note that simplify is just a dumb function, which tries
> transformations that are already in Maxima on expression and it's
> subexpressions, returning the 'shortest' result... if you have a
> specific problem, that none of existing maxima commands can't
> simplify, 'simplify' probably won't be successful... it might also be
> slow as it is written now.
>
> If you have some longer expressions that I could test simplify on,
> please post them.
>
> Attached is the simplify.lisp file.
>
> Regards,
> Ziga