Periodic Functions

Charles Seman Charles.Seman at NOAA.GOV
Wed Apr 20 17:12:02 EDT 2005


Dear Jeff,

http://grads.iges.org/grads/gadoc/gradfunccos.html

says that the argument "x" is in radians... so if we use x =
2*pie*lon/(lon2-lon1)
we get one period between "x" values "lon1" and "lon2"...
where "lon" is the longitude in degrees...

For example, open a GrADS ctl file (assuming it is on the globe...),
and you can define "pie" in GrADS as follows:

ga-> define pie = 2.*acos(0.)
  or
ga-> define pie = 2.*asin(1.)
  then
ga-> d pie
Result value = 3.14159
ga-> say 'Value of pie = 'subwrd(result,4)
ga-> set lon 180 240
ga-> d cos(2*pie*lon/60)

I hope this helps,
Chuck

Jeff Frame wrote:

> Hi,
>
> I would like to display a periodic function, such as cos(x), for an
> analytic terrain profile.  How would I limit this function to one
> period, between two given x values?  For example, say my mountain exists
> from x=190 - 210 km, but my display is set from x=170-230 km (to see the
> upstream and downstream effects of the terrain).  Currently, I can only
> get this function to plot for every period in the display range, whereas
> I only want one period displayed.  My ultimate goal is to subtract off
> this terrain height to convert heights from above sea level to above
> ground level.
>
> Any suggestions??
>
> Thanks,
>
> --
>
> --------------------------------
> Jeffrey Frame
> Graduate Research Assistant
> Ph.D. Candidate
> Department of Meteorology
> Penn State University
> --------------------------------


--

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08542                 http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."



More information about the gradsusr mailing list