## Iteration code going wrong somewhere

### Iteration code going wrong somewhere

Hi,

I need help finishing off my iteration code. I can't seem to find
where it is going wrong.

I currently have:

clc
clear all
%define initial conditions and constants
u = 600;
m = 50;
t=0;
p(t)=0;
dt=0.1;
rho = 1.207*(((1-2.333*10e-5)*y)^5);
Fg = -m*9.81;
Fa = [(-1/2*rho*0.4*0.01*abs(v))*v(1)
(-1/2*rho*0.4*0.01*abs(v))*v(2)];
Fp = [(-1/2*rho*1.2*0.05*abs(v))*v(1)
(-1/2*rho*1.2*0.05*abs(v))*v(2)];
p = [(u*cos(theta)*t) ((u*sin(theta)*t)+(1/2*-9.8*t^2))];
v = [((u*cos(theta)*t)+a(1)*t)
((u*sin(theta)*t)+(1/2*-9.81*t^2)+a(2)*t)];

vDir = input('Enter initial angle (deg): ');

theta = theta / 360.0 * (2.0 * pi);

for i = 1:1000
t = t+dt
p(t+dt)=(p(t)+dt)*v(t)
v(t+dt)=(a(t)+dt)*a(t)

if t<15
a(t) = (Fg+Fa)/m
else if t>15
a(t) =(Fg+Fa+Fp)/m
end
end
end

plot (v)
print theta

Gavin

Weird problem the last couple of days on our network - when everyone logs
into their pc, they effectively get a new profile. Their old profile folder
in documents and settings is there, but not shown as a profile. Going into
control panel/users and re-adding their domain account puts everything back
as it should be.
Same happened again this morning, so I checked the event log on the server.
Strangely, the 3 or 4 domain admin users we have each had an event logged
removing them from the builtin\administrators group. This was exhibitied by
the fact I could no longer log onto the server as myself, and had to use the
actual admin account. I got a "the policy of this system does not allow you
to log on interactively..." error, alhough the local policy doesn't specify