close all
clear all



b = .25;  
a = 0; 
c = 1; 

rho = 1025;  %kg/m^3

for v = .5:.5:2;  %m/s

alpha0 = 40*pi/180;   phi0 = pi/2;
beta0 = 0.0;    phi1 = 0;
h0 = 1.3;       phi2 = 0;

T = 10;
f = 1/T;  %hz
p = 2*pi*f;  %Frequency

k = p*b/v;

dt = 1/f/100;
t = 0:dt:1/f;  %100 timesteps through period

alpha = alpha0*exp(i*(p*t+phi0));
alphadot = i*p*alpha;
alphaddot = -p^2*alpha;
beta = beta0*exp(i*(p*t+phi1));
betadot = i*p*beta;
betaddot = -p^2*beta;
h = h0*exp(i*(p*t+phi2));
hdot = i*p*h;
hddot = -p^2*h;


gamma = -imag(alpha)-atan2(-imag(hdot),v);


figure(1)
plot(t,gamma*180/pi);
set(gca,'FontSize',16);
hold on
hold all

end
figure(1)
xlabel('time (s)')
ylabel('angle of attack (deg)')
title('Heave (1.3m@10s), Pitch (40deg@10s) V = .5 m/s, 1.0 m/s 1.5 m/s, 2.0 m/s')

