Professional Documents
Culture Documents
k2 = Sail(gi + .5*h*L1)
L2 = Mast(z+.5*(h),I)
k3 = Sail(gi + .5*h*L2)
L3 = Mast(z+.5*h,I)
k4 = Sail(gi+L3*h)
L4 = Mast(z+h,I)
g = gi + (1/6)*(k1 +2*k2+2*k3+k4)*dh
y = yi + (1/6)*(L1+2*L2+2*L3+L4)*dh
out(1,count) = g
out(2,count) = y
out(3,count) = h
count = count +1
h = h + dh
end Do
---------------------------------------------------------!Outputs finished array of values to a text file
open (unit = 1, file = 'Sailboat.txt')
write (1,*) out
close (unit=1)
---------Sensitivity trial 1------------------------!Sensitivity to parameter I (+- 5%)
!Find peak deflection at top of mast for:
!I2 = 3.8x10^-4
!I3 = 4.2x10^-4
!Rerun code with new I values
!Reset variables:
dh = .5
h = 0
gi = 0
yi = 0
z = 0
g = 0
y = 0
count = 1
Do while (h<13.5)
k1 = Sail(gi)
L1 = Mast(z,I2)
k2 = Sail(gi + .5*h*L1)
L2 = Mast(z+.5*(h),I2)
k3 = Sail(gi + .5*h*L2)
L3 = Mast(z+.5*h,I2)
k4 = Sail(gi+L3*h)
L4 = Mast(z+h,I2)
g = gi + (1/6)*(k1 +2*k2+2*k3+k4)*dh
y = yi + (1/6)*(L1+2*L2+2*L3+L4)*dh
out2(1,count) = g
out2(2,count) = y
out2(3,count) = h
end Do
write (*,*) "The deflection at the top of the mast for [I-(.05)*I] =" , y
-------------------Sensitivity Trial 2----------------dh = .5
h = 0
gi = 0
yi = 0
g = 0
y = 0
z = 0
count = 1
Do while (h<13.5)
k1 = Sail(gi)
L1 = Mast(z)
k2 = Sail(gi + .5*h*L1)
L2 = Mast(z+.5*(h))
k3 = Sail(gi + .5*h*L2)
L3 = Mast(z+.5*h)
k4 = Sail(gi+L3*h)
L4 = Mast(z+h)
g = gi + (1/6)*(k1 +2*k2+2*k3+k4)*dh
y = yi + (1/6)*(L1+2*L2+2*L3+L4)*dh
out3(1,count) = g
out3(2,count) = y
out3(3,count) = h
count = count +1
h = h + dh
end Do
write (*,*) "The deflection at the top of the mast for [I+(.05)*I] =" , y
--------------------------------end-------------------------
end program