|
From: Stavros M. (Σ. Μ. <mac...@al...> - 2016-10-10 16:10:40
|
Autres fonctions utile:
debugmode(true) -- entre dans un mode special (un peu difficile a
utiliser)
backtrace() -- imprime le call stack (fonctions appelées)
ff(n):=if n=0 then backtrace() else ff(n-1);
ff(2);
#0: ff(n=0)
#1: ff(n=1)
#2: ff(n=2)
break() -- entre dans un breakpoint, où toutes les fonctions Maxima
sont disponibles, ex.:
gg(a):= (q : q+a, if a=0 then break() else gg(a-1))$
q:0$
gg(4)$
Entering a Maxima break point. Type 'exit;' to resume.
_q;
10
_a;
0
_backtrace()$
#0: gg(a=0)
#1: gg(a=1)
#2: gg(a=2)
#3: gg(a=3)
#4: gg(a=4)
_C-C <<< abandonne le calcul
2016-10-10 11:58 GMT-04:00 Jean-François Ingenbleek <jin...@gm...>:
> Ok merci
>
> Le lun. 10 oct. 2016 16:31, Stavros Macrakis (Σταῦρος Μακράκης) <
> mac...@al...> a écrit :
>
>> Il y a des fonctions plus avancés/spécialisées pour le débogage, mais en
>> general je me limite à trace/untrace et à ajouter des print(...).
>>
>> 2016-10-10 10:29 GMT-04:00 Jean-François Ingenbleek <jin...@gm...
>> >:
>>
>> Je profite de l'occasion pour demander aux experts une référence pour
>> apprendre à utiliser les instruction de débogage...
>>
>> Merci par avance
>>
>> Le 10 octobre 2016 à 10:10, serge de marre <sde...@gm...> a écrit :
>>
>> Merci à tous et particulièrement a Stavros pour sa petite bidouille très
>> intéressante, qui semble en effet résoudre mes problèmes.
>> Justement, j'ai la chance que les %zi ont déjà eu un declare(integer), ce
>> qui facilite les choses.
>>
>> serge
>>
>>
>> 2016-10-10 0:47 GMT+02:00 Stavros Macrakis (Σταῦρος Μακράκης) <
>> mac...@al...>:
>>
>> 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
>>
>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> 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
>
>
|