Re: Doubt about formula transcription



On Apr 7, 3:36 pm, Leonardo Marques <surf...@xxxxxxxxx> wrote:
hey guys,

im with a little problem when im transcripting a mathformulafrom
maple to fortran, because when i put a solution on the equation, i got
a result diferent from zero.

Theformulais: 2*arctan(sin(a)*cos(a)/(.8-cos(a)^2))-4/9*Pi ;

I've transcripted to fortran as: 2*atan((sin(a)*cos(a))/(0.8-
cos(a)**2))-((pi)*4/9)

[code snipped]

Your equation has closed form solutions.

let gamma=(2pi)/9

1. invert the equation
2. apply formulas for sin(2x) and cos(2x)

sin(2a) sin(gamma)
---------- = tan(gamma) = ----------
.6-cos(2a) cos(gamma)

3. cross multiply and simplify

sin(2a) cos(gamma) + cos(2a) sin(gamma) = .6 sin(gamma)

4. apply formula for sin(A+B)

sin(2a+gamma) = .6 sin(gamma)

5. let beta = arcsine(.6 sin(gamma))

note that sin(x) = sin(pi-x)

2x + gamma = beta

pi - (2y + gamma) = beta

solve for principal solutions x and y

= (beta-gamma)/2 and (pi-beta-gamma)/2

[other solutions can of course be obtained by adding or subtracting
multiples of 2pi above.]

- e

.



Relevant Pages

  • Re: Doubt about formula transcription
    ... a result diferent from zero. ... I don't know Maple, but in Fortran 4/9 gives zero. ...
    (comp.lang.fortran)
  • Re: Doubt about formula transcription
    ... a result diferent from zero. ... I don't know Maple, but in Fortran 4/9 gives zero. ...
    (comp.lang.fortran)
  • Re: Searching zeros of complex function
    ... But I have to find the value of beta that makes det=0. ... The strategy for finding the zeros, ... I have a fortran routine based in Muller's ... Method for complex functions that I used some time ago for a complex ...
    (comp.lang.fortran)
  • Re: Searching zeros of complex function
    ... But I have to find the value of beta that makes det=0. ... I have a fortran routine based in Muller's ... is equivalent to finding the eigenvalues of A'. ... Nobody was getting angry with you -- merely a disagreement between the ...
    (comp.lang.fortran)
  • Re: Searching zeros of complex function
    ... > computing language (fortran, for example) detis constant for a value ... But I have to find the value of beta that makes det=0. ... > using, is very poor, because is not based in any mathematical basis: ... > Method for complex functions that I used some time ago for a complex ...
    (comp.lang.fortran)