On Sunday, November 13, 2016 at 2:14:07 PM UTC, Dima Pasechnik wrote: > > > > On Sunday, November 13, 2016 at 1:05:48 PM UTC, Emmanuel Charpentier wrote: >> >> Note that Sage's Maxima is still at 5.35.1... Hence my questions : >> tickets or not tickets ? >> > > well, your report on Maxima site talks about 5.38.1. > So it's not impossible that the bug you report is fixed by the patch on > Sage's #18920. > Let me check. > > it's another bug, indeed. (I mentioned this on https://sourceforge.net/p/maxima/bugs/3239/ too) Open a ticket, please...
> > >> >> -- >> Emanuel Charpentier >> >> Le dimanche 13 novembre 2016 13:57:13 UTC+1, Dima Pasechnik a écrit : >>> >>> this looks like bug in 5.38.1 that we patch on >>> https://trac.sagemath.org/ticket/18920 >>> by importing their fix which is not in a release yet: >>> >>> >>> https://git.sagemath.org/sage.git/diff/build/pkgs/maxima/patches/0001-In-eigenvectors-iterate-over-all-eigenvalues.patch?id=3afa33ba089b4b13e80ec9fbf41d7f83b7c00645 >>> >>> >>> >>> On Sunday, November 13, 2016 at 12:38:04 PM UTC, Emmanuel Charpentier >>> wrote: >>>> >>>> Problem : exhibit a concrete example of non-commutative operations to >>>> students stuck (at best) at high-school level in mathematics. >>>> Idea of solution : use rotations in R^3 : they can been (literally) >>>> shown. >>>> >>>> But I stumbled on the (apparently) simple step of computing the >>>> invariant vector (= axis) of the rotation, which fails, except in trivial >>>> cases. Let's setup an example (editer transcript of a session with cut'n >>>> aste from an editor) : >>>> >>>> sage: var("x,y,z,theta,phi", domain="real") >>>> ## Rotation of angle theta about the X axis : >>>> ....: >>>> M_x=matrix([[1,0,0],[0,cos(theta),-sin(theta)],[0,sin(theta),cos(theta)]]) >>>> ## Ditto, angle phi about the Y axis : >>>> ....: M_y=Matrix([[cos(phi),0,-sin(phi)],[0,1,0],[sin(phi),0,cos(phi)]]) >>>> ## A vector >>>> ....: V=vector([x,y,z]) >>>> ....: >>>> (x, y, z, theta, phi) >>>> >>>> Try to find the axis of (the rotation whose matrix is )M_x : >>>> >>>> sage: S_x=solve((M_x*V-V).list(),V.list());S_x >>>> [[x == r1, y == 0, z == 0]] >>>> >>>> So far, so good : one solution, easy to check : >>>> >>>> sage: V_x=vector(map(lambda e:e.rhs(), S_x[0])) >>>> ....: (M_x*V_x-V_x).simplify_trig() >>>> ....: >>>> (0, 0, 0) >>>> >>>> Things go pear-shaped when we try to find the axis of the composition >>>> of the rotations about X and Y axes : >>>> >>>> sage: S_yx_bad=solve((M_y*M_x*V-V).list(),V.list());S_yx_bad >>>> [[x == 0, y == 0, z == 0]] >>>> >>>> A rotation with no axis ? Now, now... >>>> >>>> I have explored a bit this (Maxima) problem, which led me to file Maxima's >>>> ticket 3239 <https://sourceforge.net/p/maxima/bugs/3239/>. It turns >>>> out that this is a Maxima error solving a simple linear equarion with >>>> complicated coefficients. >>>> >>>> Now, there is a workaround in sage : use Sympy's solvers : >>>> >>>> sage: import sympy >>>> ....: D_yx=sympy.solve((M_y*M_x*V-V).list(),V.list());D_yx >>>> ....: >>>> {x: -z*sin(phi)/(cos(phi) - 1), y: z*sin(theta)/(cos(theta) - 1)} >>>> >>>> Checking it is a bit more intricate, since this solution is expressed >>>> as Sympy's objects. But it can be done : >>>> >>>> sage: SD_yx={k._sage_():D_yx.get(k)._sage_() for k in D_yx.keys()} >>>> ....: V_yx=vector([SD_yx.get(x),SD_yx.get(y),z]) >>>> ....: (M_y*M_x*V_yx-V_yx).simplify_trig() >>>> ....: >>>> (0, 0, 0) >>>> >>>> This one doesn't seem to be covered in the "Solve tickets'" section of >>>> the Track symbolics <https://trac.sagemath.org/wiki/symbolics> page. >>>> Does this problem deserve a specific ticket ? >>>> >>>> And, by the way, (M_y*M_x).eigenvectors_right() : >>>> >>>> 1. needs about 10 minutes to >>>> 2. return an absolutely unusable solution (a few tens pages...). >>>> >>>> >>>> Is this one known ? Does it deserve a ticket ? >>>> >>>> Now for the suggestion : could we emulate what has been done with >>>> integrate(), and add an option "algorithm=" to Sage's solve ? >>>> >>>> HTH, >>>> >>>> -- >>>> Emmanuel Charpentier >>>> >>> -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
