From: Stavros M. (Σ. Μ. <mac...@al...> - 2016-10-09 22:47:15
|
Voici une petite bidouille qui semble résoudre tes exemples. Dis-moi si tu encontre des problèmes. expcontract(ex) := block([inflag:true,inner], if mapatom(ex) then ex elseif op(ex)="*" then (inner:map('expcontract,ex), if mapatom(inner) or (op(inner) # "*") then expcontract(inner) else expcontract_merge(inner)) else map('expcontract,ex))$ expcontract_merge(ex) := block([prod:1, exx, inner], exx: makelist( if mapatom(i) or op(i)#"^" then [i,1] else args(i), i, args(ex)), for i in group_by_key(exx) do ( inner: product(i[j][1],j,1,length(i)), prod: prod * (if i[1][2]=1 then inner else ratsimp(inner)^i[1][2]) ), prod)$ group_by_key(keylist) := maplist('listify,equiv_classes(setify(keylist), lambda([m,n],m[2]=n[2])))$ ------------------ expcontract(x*(x-1)^k*(x+1)^k*(x+2)) => x*(x+2)*(x^2-1)^k Pour tes exemples, il faudra un radcan par la suite: ex: ((1-sqrt(5))^(12*%z8)*(sqrt(5)+1)^(12*%z8)*2^((-24*%z8)-1))/5-1/10$ eex: expcontract(ex) => (2^((-24*%z8)-1)*(-4)^(12*%z8))/5-1/10 reex: radcan(eex) => ((-1)^(12*%z8)-1)/10 ... et aussi ... declare(%z8,integer)$ radcan(eex) == expand(reex,0,0) == ratsimp(reex) == 0 2016-10-09 17:20 GMT-04:00 serge de marre <sde...@gm...>: > Voici quelques examples un peu plus concrets. > Les exposants sont en effet toujours identiques > > ((1-sqrt(5))^(12*%z8)*(sqrt(5)+1)^(12*%z8)*2^((-24*%z8)-1))/5-1/10; > (2^(2*%z8+2)-4*(6-2^(5/2))^%z8*(2^(5/2)+6)^%z8)/2^(2*%z8); > (1263*(2143295-221064*sqrt(94))^%z8*(221064*sqrt(94)+ > 2143295)^%z8-1263)/188; > > Je ne parviens pas a faire fonctionner la suggestion de Jean-Marc, mais > merci beaucoup pour l'aide quand-meme. > > serge > > 2016-10-09 20:25 GMT+02:00 <ji...@fr...>: > >> Bon jour , >> >> et quelque chose comme ça : >> >> matchdeclare([u,v,w],true); >> >> tellsimp((u^w*v^w),(u*v)^w); >> >> E:(a-b*sqrt(q))^k*(a+b*sqrt(q))^k; >> >> expand(%); >> >> Jean-Marc >> >> ----- Mail original ----- >> De: "serge de marre" <sde...@gm...> >> À: max...@li... >> Envoyé: Samedi 8 Octobre 2016 23:18:31 >> Objet: [Maxima-lang-fr] Fwd: Simplification d'exposants >> >> >> >> Bonjour a tous, >> >> >> >> >> >> >> >> >> J'ai une expression comme celle-ci: >> k k >> (%o168) (a - b sqrt(q)) (b sqrt(q) + a) >> >> Comment puis-je transformer cette expression pour obtenir: >> 2 2 k >> (%o177) (a - b q) >> >> Merci d'avance >> >> serge >> >> >> >> ------------------------------------------------------------ >> ------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> _______________________________________________ >> Maxima-lang-fr mailing list >> Max...@li... >> https://lists.sourceforge.net/lists/listinfo/maxima-lang-fr >> > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Maxima-lang-fr mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-lang-fr > > |