I am writing a simple GDL(IDL) code for an introductory programming class. It is used to determine the velocity of a man parachuting in relation to time. It uses an Euler approximation and I keep getting an error that I am sure has something to do with defining my variables at the beginning but I don’t know how to. (I imagine it is something similar to the way its done in FORTRAN but that hasn’t worked for me.) Any help is appreciated. Thanks
pro para
print,"enter inital time"
read,t(1)
print,"enter initial velovity"
read,v(1)
print,"enter drag coefficient"
read,c
print,"enter mass"
read,m
for i=1,10 do begin
v(i+1)=v(i)+(32-(c*v(i)*v(i))/m)*(h)
h=((t(i)+1)-t(i))
t(i+1)=t(i)+1
endfor
for j=1,11 do print,t(j),v(j)
endfor
end
When I try and run this code I get the error message
% Ambiguous: Function not found: T or: Variable is undefined: T
% Execution halted at: $MAIN$
% Ambiguous: Function not found: V or: Variable is undefined: V
% Execution halted at: $MAIN$