Re: solving a trigonometric equation for a variable
Martin Rubey <[email protected]> Wed, 15 Jul 2009 17:37:53 +0200
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Message-ID | <[email protected]> |
Cap <[email protected]> writes: > Hello there! > > Well look, I'm a total axiom newbie and don't have much clue about math either. I really tried to solve this on my own, spent half a day to find what I need in the axiom documentation, but it's huge and I barely understand anything of it. Can you please help me out? > > I need to deal with the following equation: > > 0.5 * v*v * cos(theta + phi) * cos(theta + phi) + g*l * cos(phi) = g*l > > The variables v, theta, g and l are known. I need to calculate a phi > that satisfies the equation above. So I would like to solve the > equation for phi so that it starts with phi = ... This way any time I > get a new set of v, theta, g and l, I can calculate a new phi. How can > accomplish this using axiom? I tried: Your command is mostly correct -- instead of 0.5 use 1/2: > > solve(0.5*v*v*cos(theta+phi)*cos(theta+phi)+g*l*cos(phi)=g*l, phi) > > The answer I get is: > > Cannot find a definition or applicable library operation named solve > with argument type(s) > Equation Expression Float > Variable phi This says: there is no command solve that takes a float expression (i.e., expression involving variables, floats and elementary) and a variable. Thus: (1) -> solve(1/2*v*v*cos(theta+phi)*cos(theta+phi)+g*l*cos(phi)=g*l,phi) gives you 4 solutions, one being 2*atan(%phi0). (1) [phi= 2atan(%phi0) - theta, phi= 2atan(%phi1) - theta, -- skipped -- Type: List(Equation(Expression(Integer))) You get the value of %phi0 as follows: (4) -> definingPolynomial %phi0 (4) 4 2 2 2 theta 2 ((%phi0 - 2%phi0 + 1)v + (- 4%phi0 - 4)g l)tan(-----) 2 + 3 theta 4 2 2 (8%phi0 + 8%phi0)g l tan(-----) + (%phi0 - 2%phi0 + 1)v 2 + 4 2 (- 4%phi0 - 4%phi0 )g l / 2 theta 2 2 v tan(-----) + v - 4g l 2 Type: Expression(Integer) Not really nice, but more I was hoping for... Hope that helps, Martin