intermediate steps in simplify

Messages in english

Modérateur : xcasadmin

robertcailliau
Messages : 4
Inscription : mer. déc. 13, 2017 5:02 pm

intermediate steps in simplify

Message par robertcailliau » mer. déc. 13, 2017 10:35 pm

Sorry for newbie question: it there a way to see the intermediate steps in a simplify?

I wanted to see how
(1+cos(α)-sin(α))/(1+cos(α)+sin(α))

gets to

cos(α)/(1+sin(α))

but did not find any way to show the intermediate steps.

Thanks.

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: intermediate steps in simplify

Message par parisse » jeu. déc. 14, 2017 6:37 am

Unfortunately, step by step is implemented only for some commands, not for simplify...

robertcailliau
Messages : 4
Inscription : mer. déc. 13, 2017 5:02 pm

Re: intermediate steps in simplify

Message par robertcailliau » jeu. déc. 14, 2017 8:59 am

OK, merci. C'est ce que je craignais.
Dommage, car manuellement je ne suis pas arrivé à le faire (pas assez de temps) mais j'ai deux façons géométriques différentes qui mènent à ces deux expressions.

Intentions d'implémenter "step by step" dans une future version?

Robert.

(je suis à Prévessin près de Genève, pas très loin de Grenoble)

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: intermediate steps in simplify

Message par parisse » jeu. déc. 14, 2017 5:50 pm

Je n'ai rien prevu pour le moment en pas a pas pour simplify...

robertcailliau
Messages : 4
Inscription : mer. déc. 13, 2017 5:02 pm

Re: intermediate steps in simplify

Message par robertcailliau » jeu. déc. 14, 2017 11:02 pm

Pas de souci, merci & bonnes fêtes,
R.C.
(j'ai trouvé une solution purement géométrique)

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: intermediate steps in simplify

Message par lukamar » ven. déc. 15, 2017 8:31 am

Hi Robert,

I think that showing intermediate steps for a simplification algorithm, even if implemented, wouldn't be particularly useful in general, unfortunately. It could work in straightforward cases (which are used to advertise similar features for some commercial packages), but these algorithms, especially those for trigonometric simplification (see fig. 1 in this paper: http://www.sciencedirect.com/science/ar ... 7706001609) often "inflate" the expression during the process and then try to "deflate" it. In "inflated" state, the expression tends to look quite unreadable, so there is a great possibility that at least one leap between intermediate steps would be difficult to grasp, even read at all, thus breaking the step-by-step chain.
I'm saying this because I myself implemented the algorithm from the above paper for GiNaC (https://www.ginac.de/) a few years ago and tried to implement step-by-step solution (which is, I admit, a tempting feature) to find out if it could work. Then I saw what mess it produces in most cases... But the solution always came up nice :)

robertcailliau
Messages : 4
Inscription : mer. déc. 13, 2017 5:02 pm

Re: intermediate steps in simplify

Message par robertcailliau » ven. déc. 15, 2017 10:35 am

Thanks Lukamar.

Understood, and very well appreciated(*). Though I would not be capable of writing these algorithms myself, as a programmer I do have some idea of how such a series of steps might get out of hand.

Robert.

PS: just for fun, and to situate my "problem": in this particular case, I needed to show that
(1+cos(α)-sin(α))/(1+cos(α)+sin(α))
is equal to
cos(α)/(1+sin(α))
which xcas's "simplify()" does immediately but unfortunately without showing any intermediates. As this was for some didactic page on astrolabes, I would have appreciated the steps. Of course I can work it out by hand myself, and tried to do so but quickly got lost and then decided I had no further time to spend on it right now.

Obviously, my "problem" is only one of being didactic. And as it concerns astrolabes which are really geometric, I happened to find a purely geometric solution.
Sometime after the holidays I may get to sit down with a coffee and derive one from the other by hand. No worries and no hurries.

(*) I happened to work at CERN for 32 years, and got to know Martinus Veltman, who wrote the very first algebraic manipulation program "Schoonschip" (I also reviewed his book "Facts and Mysteries in Elementary Particle Physics", highly positively, very good read!).

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: intermediate steps in simplify

Message par parisse » ven. déc. 15, 2017 5:54 pm

Thanks for pointing the article, I fixed one bug preventing the simplification of their example 3 (simplify(tan(7pi/18)+tan(5pi/18)-sqrt(3)*tan(5pi/18)*tan(7pi/18))). I do not simplify trig expressions with rewriting rules. Instead I rewrite with complex exponentials, then I try to rewrite exponentials with algebraically independant exponentials, and convert back exponentials to trigonometric functions.

Répondre