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

Home » Public Forums » archive » summation and 3d 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
summation and 3d plot [message #68421] Tue, 27 October 2009 01:19 Go to previous message
Nicki is currently offline  Nicki
Messages: 14
Registered: September 2009
Junior Member
Hey!
I have two problems... First of all I need to sum up something. it
should be pretty easy but i just get really confused with my arrays.
first i have the following:
nx=findgen(64.)
ny=findgen(64.)
for i=0,63 do begin
for j=0,63 do begin
x0=(30./32.*(0.5+nx[i]))-30.
y0=(30./32.*(0.5+ny[j]))-30.
.......
N=findgen(10.)
r0=sqrt(x0^2+y0^2)
if (r0 gt 30.) then S=0 $ ; as it's an area of an circle with radius
30 (but not important for my problem)
else begin
for k=0,9 do begin
phi=N[k]*36*!pi/180
x=abs(x0*cos(phi)+y0*sin(phi))
y=-x0*sin(phi)+y0*cos(phi)
h=50.-y
deffs=sqrt(d^2+2/mu*tan(a/2*!pi/180))
S=deffs^2*(sin(atan(x/(h))))^3/(4*h)^2*100
deffr=d+alog(2)/mu*tan(a/2*!pi/180)
R=sqrt((h/f*ri)^2+(deffr*(h+f)/f)^2)
endfor
endelse
endfor
endfor
end

So what i wanna do now is summing up all "S" over k like "stot=s[k=0]+s
[k=1]+....+s[k=9]" and then i want to have a 3 D plot of x0, y0 and
stot (however i have no idea how to do that either...).
i know that a summation is usually done with "total(s)" but i don't
know how to tell idl that it should be a summation over k. And i know
that there are different ways how to do the 3D plot, but i don't
really get the commands...
i actually only want to have a 3D surface plot...

Can somebody please help me out?

Cheers,
Nicki
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems with dialog_pickfile and JavaBridge
Next Topic: weird contour lines

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

Current Time: Wed Oct 08 19:44:05 PDT 2025

Total time taken to generate the page: 0.00443 seconds