comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Floating underflow in a plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Floating underflow in a plot [message #90771] Tue, 14 April 2015 00:50 Go to previous message
Miguel is currently offline  Miguel
Messages: 18
Registered: April 2015
Junior Member
Hi,

I'm trying to plot an implicit function f(x,y)=a by computing the function for many values of x and y and plotting the result.
But when the number of point (x,y) become too large, there is a problem of floating underflow.
Here is my code :

-------------------------------------------------------
set_plot, 'ps'
device, filename="Essai",/color, bits_per_pixel=8
loadct,13, /silent
!EXCEPT=2
close,/all
plot,[1,1],xrange=[-30,30],yrange=[-30,100],psym=3
openw,1,"bla.cat"

l=(dindgen(45)+0)/1*!PI/180
d=dindgen(1000)/10.+0
l_n=0
inc_color=0
Ro=8.5
To=220

resultat=dblarr(3,n_elements(l)*n_elements(d))
foreach i,l do begin
foreach j,d do begin
R=sqrt(j^2+Ro^2-2*Ro*j*cos(i))
if (R NE 0.) then begin
T=To*(1.00767*(R/Ro)^(0.0394)+0.00712)
V=Ro*sin(i)*((T/R)-(To/Ro))
resultat(0,l_n)=i
resultat(1,l_n)=j
resultat(2,l_n)=V
printf,1,-sin(!PI-i)*j,-cos(!PI-i)*j;,i*180/!PI,j,V
l_n=l_n+1
endif
endforeach
endforeach

k=min(resultat(2,*))
while ( k LE max(resultat(2,*)) ) do begin
ind=where(resultat(2,*) GE k AND resultat(2,*) LE k+0.5)
if (ind(0) NE -1.) then begin
trajectoire=resultat(*,ind)
oplot,-sin(!PI-trajectoire(0,*))*trajectoire(1,*),-cos(!PI-t rajectoire(0,*))*trajectoire(1,*),psym=3,color=fix(inc_color ),NSUM=1
endif
k=k+0.5
inc_color=inc_color+1
if (inc_color EQ 256) then inc_color=0
endwhile
close,1
--------------------------------------------------------

Th bla.cat file contains all the points and when I plot them, it seems fine (except for the last value of l)

What is the problem here =


Thanks
Miguek
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Regridding NCEP Data
Next Topic: FG-arithmetic error and moving objects

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:11:55 PDT 2025

Total time taken to generate the page: 0.00455 seconds