MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Semi-symbolically Semi-numerically


I'm working on a project where certain elements need to be computed 
numerically. Not surprisingly, some simplifications that work 
symbolically, don't work with floating numbers. But some still do, e.g.
1.0 Sin[a]^2 + 1.0 Cos[a]^2 // Simplify is 1.0;

Is there a way to make the example that follows, that starts with Cos[8 
theta] then goes to Cartesian coordinates and back to polar, to work as 
well as the trivial trig example above?

Many thanks in advance,


toCart = theta -> ArcTan[x, y];
toPolar = {x -> Cos[theta], y -> Sin[theta]};
help = {Cos[ArcTan[x, y]] -> x/Sqrt[x^2 + y^2],
    Sin[ArcTan[x, y]] -> y/Sqrt[x^2 + y^2]};

((Cos[8 theta] /. toCart // TrigExpand) /. help // FullSimplify) /.
   toPolar // Simplify
((1.0 Cos[8 theta] /. toCart // TrigExpand) /. help //
     FullSimplify) /. toPolar // Simplify

Out[1357]= Cos[8 theta]

1. Cos[theta]^8 - 28. Cos[theta]^6 Sin[theta]^2 -
  28. Cos[theta]^2 Sin[theta]^6 + 1. Sin[theta]^8 +
  4.375 Sin[2 theta]^4

  • Prev by Date: Re: Researchers break speed barrier in solving important class of
  • Next by Date: Re: nested SetDelayed
  • Previous by thread: Re: Can Mathematica do this (infinite series)?
  • Next by thread: Re: Semi-symbolically Semi-numerically