Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Solving Equation by Iteration

Andrew_F_1
Beginner
1,932 Views

Hello,

I wrote the following code to solve an equation by iteration but I never get a reasonable answer.

do f=0.0000,180.0000
y= (Thita_ow*pi/180d0) + (f*pi/180d0) - pi - ((cos(Thita_ow*pi/180d0)*cos((Thita_ow-Half_Angle)*pi/180d0))/(sin(Half_Angle*pi/180))) &
   + ((2*cos(Thita_ow*pi/180d0)-cos(f*pi/180d0))*((cos((f+Half_Angle)*pi/180d0))/(sin(Half_Angle*pi/180d0))))
if (y==0.0) exit
end do

! Creating the TxT file
open(unit=3 , file='test.txt')
write(3,*) f, y
close(unit=3)

 

Any help ?

0 Kudos
21 Replies
jimdempseyatthecove
Honored Contributor III
167 Views

David brings up a good point.

If the function produces what is called a telephone pole graph (a series of punctuated points), then most search algorithms will get stuck on the first pole encountered. This "pole" may not necessarily be the tallest. Before you get hung up on the telephone pole analogy, consider a wave form of multiple frequencies. This wave form has multiple localized crests (and troughs), any of which might constrict the search.

Jim Dempsey

0 Kudos
Reply