

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


−2.5 z / H
0 H
0 H
0 H
%% sailBoat: Compute total force and line of action on a sail % % Input: H = Height of mast (ft) % % Output: F = Total force (lb) % d = Line of action (ft) %% --- define and examine forcing functions clc close all H = 30; % (ft) f = @(z) 200z./(7+z).exp(-2.5z/H); % (lb/ft) zf = @(z) z.f(z); z = linspace(0,H); subplot(2,1,1), plot(z,f(z)) xlabel('height, z (ft)'), ylabel('f (lb/ft)'), grid title('Wind force on a Sail') subplot(2,1,2), plot(z,zf(z)) xlabel('height, z (ft)'), ylabel('z*f (lb)'), grid %% --- total force Ftrap = my_trap(f,0,H,6); Fsimp = simpson(f,0,H,3); Fquad = quad(f,0,H); fprintf(' Total Force, F (lb) \n ---------------------- \n') fprintf(' Ftrap = %8.1f \n',Ftrap) fprintf(' Fsimp = %8.1f \n',Fsimp) fprintf(' Fquad = %8.1f \n',Fquad) %% --- line of action dtrap = my_trap(zf,0,H,6)/Ftrap; dsimp = simpson(zf,0,H,3)/Fsimp; dquad = quad(zf,0,H)/Fquad; fprintf('\n\n Line of Action, d (ft) \n ---------------------- \n') fprintf(' trap = %8.1f \n',dtrap) fprintf(' simp = %8.1f \n',dsimp) fprintf(' quad = %8.1f \n',dquad)