Semi-symbolically Semi-numerically
- To: mathgroup at smc.vnet.net
- Subject: [mg113387] Semi-symbolically Semi-numerically
- From: Sam Takoy <sam.takoy at yahoo.com>
- Date: Tue, 26 Oct 2010 05:35:30 -0400 (EDT)
Hi, 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, Sam 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] Out[1358]= 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
- Follow-Ups:
- Re: Semi-symbolically Semi-numerically
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Semi-symbolically Semi-numerically