simplify_trig does not work with matrix?

32 views
Skip to first unread message

Jean-François Ingenbleek

unread,
Feb 13, 2020, 10:16:23 AM2/13/20
to sage-support
var("u,v,l",domain=RR)
sigma = vector([u*cos(v),u*sin(v),l*u])
Dsigma = matrix([[diff(s,u) for s in sigma],[diff(s,v) for s in sigma]]).transpose()
print(Dsigma)
EFG = (Dsigma.transpose())*Dsigma
EFG.simplify_trig()
print(EFG)

gives

[   cos(v) -u*sin(v)]
[   sin(v)  u*cos(v)]
[        l         0]

[  l^2 + cos(v)^2 + sin(v)^2                           0]
[                          0 u^2*cos(v)^2 + u^2*sin(v)^2]

Why Simplify_trig does not work in this case?

Thanks to everybody

Dima Pasechnik

unread,
Feb 13, 2020, 11:33:43 AM2/13/20
to sage-support
On Thu, Feb 13, 2020 at 3:16 PM Jean-François Ingenbleek
<jinge...@gmail.com> wrote:
>
> var("u,v,l",domain=RR)
> sigma = vector([u*cos(v),u*sin(v),l*u])
> Dsigma = matrix([[diff(s,u) for s in sigma],[diff(s,v) for s in sigma]]).transpose()
> print(Dsigma)
> EFG = (Dsigma.transpose())*Dsigma
> EFG.simplify_trig()

this works, but it does not change EFG, you'll need to create a new element,

sage: EFG.simplify_trig()
[l^2 + 1 0]
[ 0 u^2]

or overwrite EFG:

EFG=EFG.simplify_trig()

HTH
Dima



> print(EFG)
>
> gives
>
> [ cos(v) -u*sin(v)]
> [ sin(v) u*cos(v)]
> [ l 0]
>
> [ l^2 + cos(v)^2 + sin(v)^2 0]
> [ 0 u^2*cos(v)^2 + u^2*sin(v)^2]
>
>
> Why Simplify_trig does not work in this case?
>
>
> Thanks to everybody
>
> --
> 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 sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/7b286f22-dd42-4a3e-bb95-f5e1f8638173%40googlegroups.com.

Jean-François Ingenbleek

unread,
Feb 14, 2020, 3:54:18 AM2/14/20
to sage-support
Jove! it's stupidity on my part.

Thanks
Reply all
Reply to author
Forward
0 new messages