reduce a complete vector
- Subject: reduce a complete vector
- From: Dan Stanger
- Date: Mon, 19 Nov 2001 13:02:30 -0700
e:SIN(tD + tC + tB) + SIN(tD + tC - tB);
trigreduce(factor(trigexpand(e)));
gives
2 COS(tB) SIN(tD + tC)
However, that does not fully simplify the second term. You have to do more work. One
way
of doing this is to create a matching rule, that looks at expressions and see if they
contain a sum
of tD + tC + tB, and then try to use trigreduce(factor(trigexpand(e))) instead.
alexandre@emc.ufsc.br wrote:
> ok,
> but the problem is to get the first term too:
> cos(tB)*sin(tD + tC)
> raher than
> [ SIN(tD + tC + tB) SIN(tD + tC - tB) ]
> > [ ----------------- + -----------------
> ]
> > (D20) [ 2 2 ]
>
> I'd like to apply command sequences to all the vector A and get B, and no
> apply sequences to the terms A[1][1] and A[2][1]...
> alexandre
>
> On Mon, 19 Nov 2001, Dan Stanger wrote:
>
> > Have you tried
> > fullmapl(lambda([u],trigreduce(factorout(ratexpand(trigexpand(u)),sin,cos))),a)?
> >
> > It returned
> >
> > [ SIN(tD + tC + tB) SIN(tD + tC - tB) ]
> > [ ----------------- + ----------------- ]
> > (D20) [ 2 2 ]
> > [ r SIN(tB) COS(tD + 2 tC) - dA SIN(tB) SIN(tD + tC) ]
> > Dan Stanger
> > dan.stanger@ieee.org
> >
> > Ps Could you email me back and confirm that you got this thru the maxima
> > mailing list also?
> >
> > alexandre@emc.ufsc.br wrote:
> >
> > > I've
> > > A:matrix([cos(tB)*(cos(tC)*SIN(tD)+sin(tC)*cos(tD))],
> > > [r*sin(tB)*cos(tC)*(cos(tC)*cos(tD)-sin(tC)*sin(tD))
> > > +sin(tB)*(-r*sin(tC)-dA)*(cos(tC)*sin(tD)+sin(tC)*COS(tD
> > >
> > > and I need get
> > >
> > > B:matrix([cos(tB)*sin(tD + tC)],[r*sin(tB)*cos(tD+2*tC) -
> > > dA*sin(tB)*sin(tD+tC)]);
> > >
> > > I try:
> > >
> > > fixup(x) :=trigreduce(factorout(ratexpand(trigexpand(x)),sin,cos));
> > > then
> > > map(fixup,A);
> > >
> > > but the result is not so simple...it's:
> > >
> > > SIN(tD + tC + tB) SIN(tD + tC - tB)
> > > (D8) MATRIX([----------------- + -----------------],
> > > 2 2
> > >
> > > r SIN(tD + 2 tC + tB) r SIN(tD - 2 tC + tB)
> > > --------------------- + ---------------------
> > > 2 2 r SIN(tD + 2 tC + tB)
> > > [--------------------------------------------- + ---------------------
> > > 2 4
> > >
> > > r SIN(tD + 2 tC - tB) r SIN(tD - 2 tC - tB)
> > > --------------------- + ---------------------
> > > 2 2 r SIN(tD + 2 tC - tB)
> > > - --------------------------------------------- - ---------------------
> > > 2 4
> > >
> > > dA COS(tD + tC + tB) dA COS(tD + tC - tB) r SIN(tD - 2 tC + tB)
> > > + -------------------- - -------------------- - ---------------------
> > > 2 2 4
> > >
> > > r SIN(tD - 2 tC - tB)
> > > + ---------------------])
> > > 4
> > >
> > > is not so simple...
> > >
> > > _______________________________________________
> > > Maxima mailing list
> > > Maxima@www.math.utexas.edu
> > > http://www.math.utexas.edu/mailman/listinfo/maxima
> >