From: Stavros M. (Σ. Μ. <mac...@al...> - 2014-07-31 22:34:05
|
I don't think trigrat is very useful for fractional powers. Consider the simplest example, trigrat(sin(x)^(1/2). This returns (sqrt(2)*%i*(sin(2*x)^2+cos(2*x)^2-2*cos(2*x)+1)^(1/4)* sin((atan2(cos(2*x)-1,-sin(2*x))-atan2(sin(x),cos(x))+%pi)/2)+ sqrt(2)*(sin(2*x)^2+cos(2*x)^2-2*cos(2*x)+1)^(1/4)* cos((atan2(cos(2*x)-1,-sin(2*x))-atan2(sin(x),cos(x))+%pi)/2))/2 Is that useful for anything? Note for example the subexpressions sin(2*x)^2+cos(2*x)^2 (identically 1) atan2(sin(x),cos(x)) probably should be treated as x etc. I doubt trigrat was even *designed* to be useful for this case. If something more powerful than ratsimp is wanted, perhaps a useful choice would be radcan(exponentialize(logarc(expr))). But don't blame me if that's a bad idea ... just a suggested thing to try. -s On Thu, Jul 31, 2014 at 5:50 PM, Stavros Macrakis (Σταῦρος Μακράκης) < mac...@al...> wrote: > a) What do you mean by "seems to be crashing"? Does Maxima give an error > message? Does the process coredump? Or does it just run for a very long > time? > > b) Why are you using trigrat to compare expressions? trigrat expands > expressions enormously. For example, trigrat(1/(sin(x)^(9/2)+1) is 173,754 > characters long. I am not surprised that calling trigrat on larger > expressions might take a long time. > > c) In your particular example, you don't need any trig simplifications at > all. lhs(ex)-rhs(ex) => 0. Why use a nuclear bomb when you can use a > nail-file? > > d) I'm not even sure that trigrat is any better at canonicalizing > expressions than other approaches. For example, trigrat sometimes produces > things like atan2(sin(x),cos(x)). > > e) For checking expressions that don't have parameters for equality, > taylor can be very valuable. There must be some way of determining how many > terms of a taylor series must be zero to prove that the expression is zero > for some classes of expression, but I don't know it.... > > f) If you really thing trigrat is what you need, at least use > is(equal(trigrat(a-b),0)) rather than is(trigrat(a=b)). There's a good > chance in the former case that cancellations will happen, while in the > latter, you are forcing trigrat to expand even if there will ultimately be > cancellations. > > > > On Thu, Jul 31, 2014 at 4:38 PM, Max Cohen <ma...@so...> wrote: > >> Hello, >> >> I use trigrat to compare expressions with trigonometry in them. When I do >> is(trigrat(((diff((7) /(4 +(sin(x))^((5)/2)),x)=( - ( (( ( 35 * cos(x) ) >> * (sin(x)^(3/2)) )/( 2 * (( (sin(x)^(5/2)) + 4 )^2) )) ) ))))); >> >> maxima seems to be crashing. However, if I interrupt maxima and run the >> same command again, it does answer!? >> This looks to me like a bug in maxima? >> >> Also, maybe related, the following takes a very long time on my machine: >> (trigrat(radcan((4*sin(%pi*93/180)/sin(%pi*65/180))))); >> >> I'm on ubuntu, sbcl. >> >> regards, >> >> Max <http://sowiso.com/en/blog/> >> >> >> ------------------------------------------------------------------------------ >> Infragistics Professional >> Build stunning WinForms apps today! >> Reboot your WinForms applications with our WinForms controls. >> Build a bridge from your legacy apps to the future. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Maxima-discuss mailing list >> Max...@li... >> https://lists.sourceforge.net/lists/listinfo/maxima-discuss >> >> > |